Replaced WebView with a custom BrowserWidget
Added browser navigation buttons and url textbox FossilOrigin-Name: 4914092dd81da4678e5aa76e8c8a15bc7cb1e146
This commit is contained in:
parent
dc38db4452
commit
9e4e35a56a
9
fuel.pro
9
fuel.pro
@ -45,7 +45,8 @@ SOURCES += src/main.cpp\
|
||||
src/Utils.cpp \
|
||||
src/FileTableView.cpp \
|
||||
src/CloneDialog.cpp \
|
||||
src/LoggedProcess.cpp
|
||||
src/LoggedProcess.cpp \
|
||||
src/BrowserWidget.cpp
|
||||
|
||||
HEADERS += src/MainWindow.h \
|
||||
src/CommitDialog.h \
|
||||
@ -54,13 +55,15 @@ HEADERS += src/MainWindow.h \
|
||||
src/Utils.h \
|
||||
src/FileTableView.h \
|
||||
src/CloneDialog.h \
|
||||
src/LoggedProcess.h
|
||||
src/LoggedProcess.h \
|
||||
src/BrowserWidget.h
|
||||
|
||||
FORMS += ui/MainWindow.ui \
|
||||
ui/CommitDialog.ui \
|
||||
ui/FileActionDialog.ui \
|
||||
ui/SettingsDialog.ui \
|
||||
ui/CloneDialog.ui
|
||||
ui/CloneDialog.ui \
|
||||
ui/BrowserWidget.ui
|
||||
|
||||
RESOURCES += \
|
||||
rsrc/resources.qrc
|
||||
|
17
manifest
17
manifest
@ -1,11 +1,11 @@
|
||||
C Added\sFrench\stranslation.\sThanks\sFringale\nFixed\sEnglish\stext
|
||||
D 2012-12-22T04:03:17.922
|
||||
C Replaced\sWebView\swith\sa\scustom\sBrowserWidget\nAdded\sbrowser\snavigation\sbuttons\sand\surl\stextbox\n\n\n
|
||||
D 2012-12-22T16:29:06.140
|
||||
F dist/arch/PKGBUILD bf020b73b610f4c14e38feba027fe8f45b4fbc5c
|
||||
F dist/win/fuel.iss ef3558dbba409eb194938b930377fc9ee27d319e
|
||||
F doc/Building.txt 7c0f1060d4a08ed330058d4a3a68905c05228381
|
||||
F doc/Changes.txt b4494e409960f22705c8624eaa935e3f195df10b
|
||||
F doc/License.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
||||
F fuel.pro 2241d17c100af7bfb338daca12af9ae2cc45204a
|
||||
F fuel.pro 5ca9e8f6817cda42dbdd4f02079bb33e9044db5e
|
||||
F intl/convert.bat 7e878e302a8be2324fd51b9eed1aab272dbd8bbd x
|
||||
F intl/convert.sh 5694496585ff5f4363c90ff8b6f48e19e0b6b4aa x
|
||||
F intl/de_DE.ts 6230de8f647218960853b339909cf8c3d09f45ed
|
||||
@ -172,6 +172,8 @@ F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
|
||||
F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
|
||||
F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
|
||||
F rsrc/resources.qrc cce04d202b0f833ee1057ab2aa33782c45370161
|
||||
F src/BrowserWidget.cpp 8b8f545cdff4a4188edc698a1b4777f5df46f056
|
||||
F src/BrowserWidget.h 764d66aa9a93b890298bd0301097739cb4e16597
|
||||
F src/CloneDialog.cpp 8652480baa3f13f0f0e7df019751338c7cbeb1b5
|
||||
F src/CloneDialog.h c97e8c266819292622ca3e84b68e04e81ec05ba3
|
||||
F src/CommitDialog.cpp 5300522ac11bc1096a11a6ce22f8c1665d4afc05
|
||||
@ -190,12 +192,13 @@ F src/Utils.cpp caca5268e3194abe77211040bf9511a82909d2e6
|
||||
F src/Utils.h 5af911147390879176e587fc60fb662490bb9e97
|
||||
F src/main.cpp 8f8790822f82870a12169bcf204e571138adb065
|
||||
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
|
||||
F ui/BrowserWidget.ui e0f4fa810d1989b77e503d37ccb6b01e1c9b4129
|
||||
F ui/CloneDialog.ui 0fc820804df91f16506ee466a44519fdd44e468f
|
||||
F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui c0d25619f571d67f8e1607ac010be88636dbf287
|
||||
F ui/MainWindow.ui 624844304042b74c462df27793a433183049f43f
|
||||
F ui/SettingsDialog.ui 55aefad7145c40d936c43759789d1b50e361b020
|
||||
P 5de753035ea0f6c277123f36d25a2d35fb5c63c9
|
||||
R 1185bb8d4def5093dc95a19e4291af34
|
||||
P 8bcd65e5fa2194a7edb5ddf56e5c9caddd7316cf
|
||||
R 9ab6b655f11070587a547e7ffdee40a0
|
||||
U kostas
|
||||
Z 494b8b9aa442d41541a84207deb8dfef
|
||||
Z 9493aba2c684dca13ce6b9bb52bb4ebd
|
||||
|
@ -1 +1 @@
|
||||
8bcd65e5fa2194a7edb5ddf56e5c9caddd7316cf
|
||||
4914092dd81da4678e5aa76e8c8a15bc7cb1e146
|
73
src/BrowserWidget.cpp
Normal file
73
src/BrowserWidget.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
#include <QLineEdit>
|
||||
#include "BrowserWidget.h"
|
||||
#include "ui_BrowserWidget.h"
|
||||
|
||||
BrowserWidget::BrowserWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
loading(false)
|
||||
{
|
||||
ui = new Ui::BrowserWidget;
|
||||
ui->setupUi(this);
|
||||
ui->toolBar->addWidget(ui->txtUrl);
|
||||
connect(ui->txtUrl, SIGNAL(returnPressed()), this, SLOT(on_txtUrl_returnPressed()) );
|
||||
ui->actionBrowserStop->setVisible(false);
|
||||
}
|
||||
|
||||
BrowserWidget::~BrowserWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void BrowserWidget::load(const QUrl &url)
|
||||
{
|
||||
ui->webView->load(url);
|
||||
}
|
||||
|
||||
void BrowserWidget::on_webView_urlChanged(const QUrl &url)
|
||||
{
|
||||
ui->txtUrl->setText(url.toString());
|
||||
}
|
||||
|
||||
void BrowserWidget::on_webView_loadStarted()
|
||||
{
|
||||
loading=true;
|
||||
ui->actionBrowserRefresh->setVisible(false);
|
||||
ui->actionBrowserStop->setVisible(true);
|
||||
}
|
||||
|
||||
void BrowserWidget::on_webView_loadFinished(bool /*errorOccured*/)
|
||||
{
|
||||
loading=false;
|
||||
ui->actionBrowserRefresh->setVisible(true);
|
||||
ui->actionBrowserStop->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
void BrowserWidget::on_txtUrl_returnPressed()
|
||||
{
|
||||
QUrl url(ui->txtUrl->text());
|
||||
if(url.scheme().isEmpty())
|
||||
url.setScheme("http");
|
||||
ui->webView->load(url);
|
||||
}
|
||||
|
||||
|
||||
void BrowserWidget::on_actionBrowserBack_triggered()
|
||||
{
|
||||
ui->webView->back();
|
||||
}
|
||||
|
||||
void BrowserWidget::on_actionBrowserForward_triggered()
|
||||
{
|
||||
ui->webView->forward();
|
||||
}
|
||||
|
||||
void BrowserWidget::on_actionBrowserRefresh_triggered()
|
||||
{
|
||||
ui->webView->reload();
|
||||
}
|
||||
|
||||
void BrowserWidget::on_actionBrowserStop_triggered()
|
||||
{
|
||||
ui->webView->stop();
|
||||
}
|
37
src/BrowserWidget.h
Normal file
37
src/BrowserWidget.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef BROWSERWIDGET_H
|
||||
#define BROWSERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QUrl>
|
||||
|
||||
namespace Ui {
|
||||
class BrowserWidget;
|
||||
}
|
||||
|
||||
class BrowserWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BrowserWidget(QWidget *parent = 0);
|
||||
~BrowserWidget();
|
||||
|
||||
void load(const QUrl &url);
|
||||
|
||||
private slots:
|
||||
void on_webView_urlChanged(const QUrl &url);
|
||||
void on_webView_loadStarted();
|
||||
void on_webView_loadFinished(bool);
|
||||
void on_actionBrowserBack_triggered();
|
||||
void on_actionBrowserForward_triggered();
|
||||
void on_actionBrowserRefresh_triggered();
|
||||
void on_txtUrl_returnPressed();
|
||||
|
||||
void on_actionBrowserStop_triggered();
|
||||
|
||||
private:
|
||||
Ui::BrowserWidget *ui;
|
||||
bool loading;
|
||||
};
|
||||
|
||||
#endif // BROWSERWIDGET_H
|
110
ui/BrowserWidget.ui
Normal file
110
ui/BrowserWidget.ui
Normal file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BrowserWidget</class>
|
||||
<widget class="QWidget" name="BrowserWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<addaction name="actionBrowserBack"/>
|
||||
<addaction name="actionBrowserForward"/>
|
||||
<addaction name="actionBrowserRefresh"/>
|
||||
<addaction name="actionBrowserStop"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtUrl"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWebView" name="webView">
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionBrowserBack">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Button Previous-01.png</normaloff>:/icons/icons/Button Previous-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBrowserForward">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Button Next-01.png</normaloff>:/icons/icons/Button Next-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Forward</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Forward</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBrowserRefresh">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Button Refresh-01.png</normaloff>:/icons/icons/Button Refresh-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBrowserStop">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Button Close-01.png</normaloff>:/icons/icons/Button Close-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>browserStop</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKit/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../rsrc/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
880
ui/MainWindow.ui
880
ui/MainWindow.ui
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user