Beispiel #1
0
WebTabPanel::~WebTabPanel() {
	QObject::disconnect(web,SIGNAL(loadFinished(bool)),this,SLOT(handleLoadFinished(bool)));
	QObject::disconnect(web,SIGNAL(loadStarted()),this,SLOT(handleLoadStarted()));
	QObject::disconnect(web,SIGNAL(urlChanged(QUrl&)),this,SLOT(handleUrlChanged(QUrl&)));
	QObject::disconnect(this,SIGNAL(followUserByScreenName(QString)),tweets,SIGNAL(followUserByScreenName(QString)));
	QObject::disconnect(tweets,SIGNAL(haveUpdatedUser(TweetUser*)),this,SLOT(handleUpdatedUser(TweetUser*)));
	QObject::disconnect(cache,SIGNAL(update(QString)),this,SLOT(handleUpdateImage(QString)));
}
Beispiel #2
0
PhpWebView::PhpWebView(PhpBrowser *browser, QWidget *parent)
	: QWebView(parent)
{
	this->browser = browser;
	viewLoadState = 0;
	connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setTargetBlank()));
	connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setTabName(bool)));
	connect(this, SIGNAL(loadStarted()), this, SLOT(handleLoadStarted()));
}
Beispiel #3
0
WebTabPanel::WebTabPanel(BirdBox *t,ImageCache *c,QWidget *parent) : TabPanel(parent),statusUser(0) {
	type=1;
	tweets=t;
	cache=c;
	layout=new QVBoxLayout();
	widget()->setLayout(layout);
	state=0;
	web=new QWebView(this);
	QObject::connect(web,SIGNAL(loadFinished(bool)),this,SLOT(handleLoadFinished(bool)));
	QObject::connect(web,SIGNAL(loadStarted()),this,SLOT(handleLoadStarted()));
	QObject::connect(web,SIGNAL(urlChanged(const QUrl&)),this,SLOT(handleUrlChanged(const QUrl&)));
	QObject::connect(web,SIGNAL(linkClicked(const QUrl&)),this,SLOT(handleLinkClicked(const QUrl&)));
	QObject::connect(this,SIGNAL(followUserByScreenName(QString)),t,SIGNAL(followUserByScreenName(QString)));
	QObject::connect(t,SIGNAL(haveUpdatedUser(TweetUser*)),this,SLOT(handleUpdatedUser(TweetUser*)));
	QObject::connect(c,SIGNAL(update(QString)),this,SLOT(updateImage(QString)));
	QObject::connect(&timer,SIGNAL(timeout()),this,SLOT(handleTimeout()));
	statusArea = new QWidget(this);
	statusArea->setLayout(new QHBoxLayout());
	statusIcon = new QLabel(this);
	statusIcon->setMaximumSize(32,32);
	statusIcon->setScaledContents(true);
	message = new QLabel(this);
	message->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
	statusArea->layout()->setAlignment(Qt::AlignLeft);
	statusArea->layout()->addWidget(statusIcon);
	statusArea->layout()->addWidget(message);
	statusArea->layout()->setMargin(0);
	statusArea->layout()->setSpacing(1);
	infoArea = new QWidget(this);
	loadingText = new QLabel(this);
	loadingText->setText("Please wait, connecting to twitter...");
	progress = new QProgressBar(this);
	progress->setRange(0,0);
	progress->setMaximumHeight(15);
	progress->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
	loadingText->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Maximum);
	infoArea->setLayout(new QHBoxLayout());
	infoArea->layout()->addWidget(loadingText);
	infoArea->layout()->addWidget(progress);
	infoArea->layout()->setMargin(0);
	infoArea->layout()->setSpacing(1);
	layout->setAlignment(Qt::AlignTop);
	layout->addWidget(statusArea);
	layout->addWidget(infoArea);
	layout->addWidget(web);
	//web->hide();
	web->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled,false);
	web->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
	web->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

	setWidgetResizable(true);
	resetPage();
	handleTimeout();
}
/*!
    Constructor       
 */
WlanLoginView::WlanLoginView(WlanLoginMainWindow* mainWindow):
    mMainWindow(mainWindow),
    mDocLoader(new WlanLoginDocumentLoader(mainWindow)),
    mProgressBar(NULL),
    mScrollAreaContent(NULL),
    mWebView(NULL),
    mNextAction(NULL),
    mFirstIctsOkResult(true)
{   
    OstTraceFunctionEntry0(WLANLOGINVIEW_WLANLOGINVIEW_ENTRY);
    
    loadDocml();
    
    setTitleBarVisible(false);
    setStatusBarVisible(false);
    
    // Set white background to content widget
    QPixmap pixmap(10,10);
    pixmap.fill(Qt::white);
    QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(pixmap);
    mScrollAreaContent->setBackgroundItem(pixmapItem);
    
    mWebView->page()->setNetworkAccessManager(mMainWindow->application()->engine()->networkAccessManager());
    
    bool connectStatus = connect(
        mWebView,
        SIGNAL(loadStarted()),
        this,
        SLOT(handleLoadStarted())); 
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
        mWebView,
        SIGNAL(loadProgress(int)),
        this,
        SLOT(handleLoadProgress(int))); 
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
        mWebView,
        SIGNAL(loadFinished(bool)),
        this,
        SLOT(handleLoadFinished(bool)));
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
    mWebView,
    SIGNAL(urlChanged(const QUrl&)),
    this,
    SLOT(handleUrlChanged(const QUrl&)));
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
        mWebView->page(),
        SIGNAL(formSubmitted()),
        this,
        SLOT(handleFormSubmitted()));
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
        mCancelAction,
        SIGNAL(triggered()),
        this,
        SLOT(handleCancelAction()));
    Q_ASSERT(connectStatus == true);
    
    connectStatus = connect(
        mNextAction,
        SIGNAL(triggered()),
        this,
        SLOT(handleNextAction()));
    Q_ASSERT(connectStatus == true);
    
    show();
    
    OstTraceFunctionExit0(WLANLOGINVIEW_WLANLOGINVIEW_EXIT);
}