From 0dd3ac5305a783d9ad40895fcde6a35700fb847a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 13 May 2009 00:25:37 +0200 Subject: strings fix --- src/main.cpp | 28 ++++------------------------ src/searchbar.cpp | 2 +- src/settings.cpp | 6 +++--- src/settings_general.ui | 4 ++-- src/settings_webkit.ui | 2 +- 5 files changed, 11 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 4dcdd902..600961c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,10 +26,10 @@ static const char description[] = - I18N_NOOP("KDE Browser Webkit Based"); + I18N_NOOP("Webkit Based Browser for KDE"); -static const char version[] = "0.1alpha"; +static const char version[] = "0.1"; int main(int argc, char **argv) @@ -48,12 +48,12 @@ int main(int argc, char **argv) // about authors about.addAuthor(ki18n("Andrea Diamantini"), - ki18n("Project Lead, Developer, Italian translation"), + ki18n("Project Lead, Developer"), "adjam7@gmail.com", "http://www.adjam.org"); about.addAuthor(ki18n("Domrachev Alexandr"), - ki18n("Developer, Russian translation"), + ki18n("Developer"), "alexandr.domrachev@gmail.com", ""); @@ -62,26 +62,6 @@ int main(int argc, char **argv) "kojots350@gmail.com", ""); - about.addAuthor(ki18n("Panagiotis Papadopoulos"), - ki18n("German translation"), - "pano_90@gmx.net", - ""); - - about.addAuthor(ki18n("Juan Pablo Scaletti"), - ki18n("Spanish translation"), - "juanpablo@jpscaletti.com", - ""); - - about.addAuthor(ki18n("Eelko Berkenpies"), - ki18n("Dutch translation"), - "kaboon@gmail.com", - ""); - - about.addAuthor(ki18n("Alain Laporte"), - ki18n("French translation"), - "alain_laporte123@yahoo.fr", - ""); - // Initialize command line args KCmdLineArgs::init(argc, argv, &about); diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 2110b4d9..9f6b306d 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -55,7 +55,7 @@ SearchBar::SearchBar(QWidget *parent) : setClearButtonShown(true); // better solution than using QPalette(s).. - setClickMessage(i18n("Search..")); + setClickMessage(i18n("Search...")); // setting QNetworkAccessManager.. connect(m_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleNetworkData(QNetworkReply*))); diff --git a/src/settings.cpp b/src/settings.cpp index d3da6dbc..198ab3e0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -143,11 +143,11 @@ SettingsDialog::~SettingsDialog() void SettingsDialog::setWebSettingsToolTips() { d->webkitUi.kcfg_autoLoadImages->setToolTip(i18n("Specifies whether images are automatically loaded in web pages")); - d->webkitUi.kcfg_javascriptEnabled->setToolTip(i18n("Enables the running of JavaScript programs.")); + d->webkitUi.kcfg_javascriptEnabled->setToolTip(i18n("Enables the execution of JavaScript programs.")); d->webkitUi.kcfg_javaEnabled->setToolTip(i18n("Enables Java applets.")); d->webkitUi.kcfg_pluginsEnabled->setToolTip(i18n("Enables plugins in web pages.")); - d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("Allows JavaScript programs to opening new windows.")); - d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("Allows JavaScript programs to reading/writing to the clipboard.")); + d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("Allows JavaScript programs to open new windows.")); + d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("Allows JavaScript programs to read from and to write to the clipboard.")); d->webkitUi.kcfg_linksIncludedInFocusChain->setToolTip(i18n("Includes hyperlinks in the keyboard focus chain.")); d->webkitUi.kcfg_zoomTextOnly->setToolTip(i18n("Applies the zoom factor on a frame to only the text or all content.")); d->webkitUi.kcfg_printElementBackgrounds->setToolTip(i18n("Draws also background color and images when the page is printed.")); diff --git a/src/settings_general.ui b/src/settings_general.ui index 44561b02..f9d272c6 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -23,7 +23,7 @@ - Home Page: + Home page: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -80,7 +80,7 @@ - ask where saving downloads + ask where to save downloads diff --git a/src/settings_webkit.ui b/src/settings_webkit.ui index 56ce7839..32a9c0c9 100644 --- a/src/settings_webkit.ui +++ b/src/settings_webkit.ui @@ -20,7 +20,7 @@ - Auto Load Images + Autoload Images -- cgit v1.2.1 From cf501ead612195b14b42a5351085e36a4d56a6f9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 10:11:26 +0200 Subject: Fixed unusual cut/copy/paste actions on top of menu --- src/webview.cpp | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/webview.cpp b/src/webview.cpp index 055f2f7d..ddfd986f 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -375,9 +375,27 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) addBookmarkAction->setData(QVariant()); KMenu menu(this); + // link actions + bool linkIsEmpty = result.linkUrl().isEmpty(); + if (!linkIsEmpty) + { + menu.addAction(webActions()->action("open_link_in_new_tab")); + } + else + { + menu.addAction(mainwindow->actionByName("new_tab")); + } + menu.addAction(mainwindow->actionByName("view_redisplay")); + menu.addSeparator(); + + // Developer Extras actions + if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) + { + menu.addAction(webActions()->action("inspect_element")); + menu.addSeparator(); + } // cut - copy - paste Actions. - // If someone selects text perhaps wanna work with it.. bool b = false; if (result.isContentSelected() && result.isContentEditable()) @@ -403,26 +421,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addSeparator(); } - // link actions - bool linkIsEmpty = result.linkUrl().isEmpty(); - if (!linkIsEmpty) - { - menu.addAction(webActions()->action("open_link_in_new_tab")); - } - else - { - menu.addAction(mainwindow->actionByName("new_tab")); - } - menu.addAction(mainwindow->actionByName("view_redisplay")); - menu.addSeparator(); - - // Developer Extras actions - if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) - { - menu.addAction(webActions()->action("inspect_element")); - menu.addSeparator(); - } - // save/copy link actions if (!linkIsEmpty) { -- cgit v1.2.1 From 48bc2c054a94a0e0aab86219fe045effddbea04f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 11:50:50 +0200 Subject: Removed static ActionCollection and creating them on loading. This because there are too much crashes on rekonq depending on lazy action associations. --- src/webview.cpp | 113 +++++++++++++++++++++----------------------------------- src/webview.h | 4 -- 2 files changed, 42 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/webview.cpp b/src/webview.cpp index ddfd986f..dfb31279 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -290,9 +290,6 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) // ----------------------------------------------------------------------------------------------------------------- -KActionCollection* WebView::s_webActionCollection; - - WebView::WebView(QWidget* parent) : QWebView(parent) , m_page(new WebPage(this)) @@ -308,63 +305,6 @@ WebView::WebView(QWidget* parent) } -KActionCollection* WebView::webActions() -{ - if (!s_webActionCollection) - { - s_webActionCollection = new KActionCollection(this); - - QAction *a; - - a = new KAction(KIcon("tab-new"), i18n("Open Link in New &Tab"), this); - connect(a, SIGNAL(triggered()), this, SLOT(openLinkInNewTab())); - s_webActionCollection->addAction(QLatin1String("open_link_in_new_tab"), a); - - a = pageAction(QWebPage::Cut); - a->setIcon(KIcon("edit-cut")); - a->setText(i18n("Cu&t")); - s_webActionCollection->addAction(QLatin1String("edit_cut"), a); - - a = pageAction(QWebPage::Copy); - a->setIcon(KIcon("edit-copy")); - a->setText(i18n("&Copy")); - s_webActionCollection->addAction(QLatin1String("edit_copy"), a); - - a = pageAction(QWebPage::Paste); - a->setIcon(KIcon("edit-paste")); - a->setText(i18n("&Paste")); - s_webActionCollection->addAction(QLatin1String("edit_paste"), a); - - a = pageAction(QWebPage::DownloadImageToDisk); - a->setIcon(KIcon("folder-image")); - a->setText(i18n("&Save Image As...")); - s_webActionCollection->addAction(QLatin1String("save_image_as"), a); - - a = pageAction(QWebPage::CopyImageToClipboard); - a->setIcon(KIcon("insert-image")); - a->setText(i18n("&Copy This Image")); - s_webActionCollection->addAction(QLatin1String("copy_this_image"), a); - - a = pageAction(QWebPage::DownloadLinkToDisk); - a->setIcon(KIcon("folder-downloads")); - a->setText(i18n("&Save Link As...")); - s_webActionCollection->addAction(QLatin1String("save_link_as"), a); - - a = pageAction(QWebPage::CopyLinkToClipboard); - a->setIcon(KIcon("insert-link")); - a->setText(i18n("&Copy Link Location")); - s_webActionCollection->addAction(QLatin1String("copy_link_location"), a); - - a = pageAction(QWebPage::InspectElement); - a->setIcon(KIcon("tools-report-bug")); - a->setText(i18n("&Inspect Element")); - s_webActionCollection->addAction(QLatin1String("inspect_element"), a); - } - - return s_webActionCollection; -} - - void WebView::contextMenuEvent(QContextMenuEvent *event) { QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos()); @@ -373,13 +313,17 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("add_bookmark_payload"); addBookmarkAction->setText(i18n("Bookmark This Page")); addBookmarkAction->setData(QVariant()); + KMenu menu(this); + QAction *a; // link actions bool linkIsEmpty = result.linkUrl().isEmpty(); if (!linkIsEmpty) { - menu.addAction(webActions()->action("open_link_in_new_tab")); + a = new KAction(KIcon("tab-new"), i18n("Open Link in New &Tab"), this); + connect(a, SIGNAL(triggered()), this, SLOT(openLinkInNewTab())); + menu.addAction(a); } else { @@ -391,7 +335,10 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // Developer Extras actions if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) { - menu.addAction(webActions()->action("inspect_element")); + a = pageAction(QWebPage::InspectElement); + a->setIcon(KIcon("tools-report-bug")); + a->setText(i18n("&Inspect Element")); + menu.addAction(a); menu.addSeparator(); } @@ -400,19 +347,28 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) if (result.isContentSelected() && result.isContentEditable()) { - menu.addAction(webActions()->action("edit_cut")); + a = pageAction(QWebPage::Cut); + a->setIcon(KIcon("edit-cut")); + a->setText(i18n("Cu&t")); + menu.addAction(a); b = true; } if (result.isContentSelected()) { - menu.addAction(webActions()->action("edit_copy")); + a = pageAction(QWebPage::Copy); + a->setIcon(KIcon("edit-copy")); + a->setText(i18n("&Copy")); + menu.addAction(a); b = true; } if (result.isContentEditable()) { - menu.addAction(webActions()->action("edit_paste")); + a = pageAction(QWebPage::Paste); + a->setIcon(KIcon("edit-paste")); + a->setText(i18n("&Paste")); + menu.addAction(a); b = true; } @@ -424,15 +380,31 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // save/copy link actions if (!linkIsEmpty) { - menu.addAction(webActions()->action("save_link_as")); - menu.addAction(webActions()->action("copy_link_location")); + a = pageAction(QWebPage::DownloadLinkToDisk); + a->setIcon(KIcon("folder-downloads")); + a->setText(i18n("&Save Link As...")); + menu.addAction(a); + + a = pageAction(QWebPage::CopyLinkToClipboard); + a->setIcon(KIcon("insert-link")); + a->setText(i18n("&Copy Link Location")); + menu.addAction(a); + menu.addSeparator(); if (!result.pixmap().isNull()) { - // TODO Add "View Image" - menu.addAction(webActions()->action("save_image_as")); - menu.addAction(webActions()->action("copy_this_image")); + // TODO Add "View Image" && remove copy_this_image action + a = pageAction(QWebPage::DownloadImageToDisk); + a->setIcon(KIcon("folder-image")); + a->setText(i18n("&Save Image As...")); + menu.addAction(a); + + a = pageAction(QWebPage::CopyImageToClipboard); + a->setIcon(KIcon("insert-image")); + a->setText(i18n("&Copy This Image")); + menu.addAction(a); + menu.addSeparator(); } } @@ -532,4 +504,3 @@ void WebView::keyPressEvent(QKeyEvent *event) QWebView::keyPressEvent(event); } - diff --git a/src/webview.h b/src/webview.h index 3742a36d..eba02505 100644 --- a/src/webview.h +++ b/src/webview.h @@ -92,8 +92,6 @@ class WebView : public QWebView public: WebView(QWidget *parent = 0); - KActionCollection* webActions(); - // inline WebPage *webPage() const { return m_page; } KUrl url() const { return KUrl(QWebView::url()); } @@ -125,8 +123,6 @@ private slots: void openLinkInNewTab(); private: - static KActionCollection* s_webActionCollection; - WebPage *m_page; int m_progress; -- cgit v1.2.1 From 94329b092dae7d139b299416f4fe4e2bbae75a1d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 11:58:32 +0200 Subject: Fixed (hopefully) searchbar. Near its last release.. --- src/lineedit.cpp | 2 +- src/searchbar.cpp | 19 +++++++++---------- src/searchbar.h | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/lineedit.cpp b/src/lineedit.cpp index 9ca963af..dd90ce5a 100644 --- a/src/lineedit.cpp +++ b/src/lineedit.cpp @@ -33,7 +33,7 @@ LineEdit::LineEdit(QWidget* parent) : KLineEdit(parent) { - setMinimumWidth(180); + setMinimumWidth(200); setFocusPolicy(Qt::WheelFocus); setHandleSignals(true); diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 9f6b306d..48e9290a 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -28,6 +28,7 @@ // KDE Includes #include +#include // Qt Includes #include @@ -38,19 +39,16 @@ #include -SearchBar::SearchBar(QWidget *parent) : - KLineEdit(parent) - , m_networkAccessManager(new QNetworkAccessManager(this)) - , m_timer(new QTimer(this)) +SearchBar::SearchBar(QWidget *parent) + : LineEdit(parent) + , m_networkAccessManager(new QNetworkAccessManager(this)) + , m_timer(new QTimer(this)) { - setMinimumWidth(180); - setFocusPolicy(Qt::WheelFocus); setMouseTracking(true); setAcceptDrops(true); - QSizePolicy policy = sizePolicy(); - setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy()); + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setClearButtonShown(true); @@ -80,6 +78,7 @@ void SearchBar::searchNow() { m_timer->stop(); QString searchText = text(); + completionBox()->hide(); KUrl url(QLatin1String("http://www.google.com/search")); url.addQueryItem(QLatin1String("q"), searchText); @@ -92,8 +91,8 @@ void SearchBar::searchNow() void SearchBar::focusInEvent(QFocusEvent *event) { - KLineEdit::focusInEvent(event); - clear(); + selectAll(); + LineEdit::focusInEvent(event); } diff --git a/src/searchbar.h b/src/searchbar.h index 29588c58..fe30c946 100644 --- a/src/searchbar.h +++ b/src/searchbar.h @@ -22,8 +22,8 @@ #ifndef SEARCHBAR_H #define SEARCHBAR_H -// KDE Includes -#include +// Local Includes +#include "lineedit.h" // Forward Declarations class KUrl; @@ -36,7 +36,7 @@ class QNetworkReply; * This class defines an internet search bar. * */ -class SearchBar : public KLineEdit +class SearchBar : public LineEdit { Q_OBJECT -- cgit v1.2.1 From fc07debcf06be1648afb60653bead970c93258ac Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 12:17:46 +0200 Subject: Fixed FullScreen Action & provided it in contextual menu, in fullscreen mode --- src/mainwindow.cpp | 6 +++++- src/webview.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index adc6fc87..3311dfa8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -224,7 +224,11 @@ void MainWindow::setupActions() KStandardAction::find(this, SLOT(slotViewFindBar()) , actionCollection()); KStandardAction::findNext(this, SLOT(slotFindNext()) , actionCollection()); KStandardAction::findPrev(this, SLOT(slotFindPrevious()) , actionCollection()); - KStandardAction::fullScreen(this, SLOT(slotViewFullScreen(bool)), this, actionCollection()); + + // we all like "short" shortcuts.. ;) + a = KStandardAction::fullScreen(this, SLOT(slotViewFullScreen(bool)), this, actionCollection()); + a->setShortcut(KShortcut(Qt::Key_F11)); + KStandardAction::home(this, SLOT(slotHome()), actionCollection()); KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection()); KStandardAction::showMenubar(this, SLOT(slotShowMenubar(bool)), actionCollection()); diff --git a/src/webview.cpp b/src/webview.cpp index dfb31279..01fd0d00 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -422,6 +422,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(addBookmarkAction); } + if(mainwindow->isFullScreen()) + { + menu.addAction(mainwindow->actionByName("fullscreen")); + } + menu.exec(mapToGlobal(event->pos())); } -- cgit v1.2.1 From 639855d1e8ef84c5b84187893b38ef92773194f7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 12:25:45 +0200 Subject: Fixed non working SidePanel toogle view action --- src/mainwindow.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3311dfa8..930a4e64 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -336,15 +336,9 @@ void MainWindow::setupSidePanel() addDockWidget(Qt::LeftDockWidgetArea, m_sidePanel); // setup side panel actions - KAction* a = new KAction(this); - a->setText(i18n("History")); - a->setCheckable(true); - a->setChecked(ReKonfig::showSideBar()); - a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_H)); + QAction* a = m_sidePanel->toggleViewAction(); + a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); actionCollection()->addAction(QLatin1String("show_history_panel"), a); - - // connect to toogle action - connect(a, SIGNAL(triggered(bool)), m_sidePanel->toggleViewAction(), SLOT(trigger())); } -- cgit v1.2.1