Ejemplo n.º 1
0
HomeView::HomeView(QWidget *parent)
    : QWidget(parent)
    , m_addressBar(0)
{
    m_addressBar = new AddressBar(parent);
    connect(m_addressBar, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));

    m_bookmarks = new BookmarksView(parent);
    connect(m_bookmarks, SIGNAL(urlSelected(QUrl)), SIGNAL(urlActivated(QUrl)));

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(4);
    layout->setSpacing(4);
    layout->addWidget(m_addressBar);
    layout->addWidget(m_bookmarks);
}
Ejemplo n.º 2
0
BrowserWindow::BrowserWindow()
    : m_slidingSurface(new QWidget(this))
    , m_homeView(new HomeView(m_slidingSurface))
    , m_browserView(new BrowserView(m_slidingSurface))
    , m_animation(new QPropertyAnimation(this, "slideValue"))
{
    m_slidingSurface->setAutoFillBackground(true);

    m_homeView->resize(size());

    m_browserView->resize(size());

    connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));
    connect(m_homeView, SIGNAL(urlActivated(QUrl)), SLOT(navigate(QUrl)));

    connect(m_browserView, SIGNAL(menuButtonClicked()), SLOT(showHomeView()));

    m_animation->setDuration(200);
    connect(m_animation, SIGNAL(finished()), SLOT(animationFinished()));

    setSlideValue(0.0f);
}
Ejemplo n.º 3
0
void BrowserWindow::initialize()
{
    m_homeView = new HomeView(this);
    m_browserView = new BrowserView(this);

    m_homeView->hide();
    m_homeView->resize(size());
    m_homeView->move(0, 0);

    m_browserView->hide();
    m_browserView->resize(size());
    m_browserView->move(0, 0);

    connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));
    connect(m_homeView, SIGNAL(urlActivated(QUrl)), SLOT(navigate(QUrl)));

    connect(m_browserView, SIGNAL(menuButtonClicked()), SLOT(showHomeView()));

    m_homeView->setVisible(false);
    m_browserView->setVisible(false);
    slide(0);

    connect(m_timeLine, SIGNAL(frameChanged(int)), SLOT(slide(int)));
}
Ejemplo n.º 4
0
void AddressBar::processAddress()
{
    if (!m_lineEdit->text().isEmpty())
        emit addressEntered(m_lineEdit->text());
}
Ejemplo n.º 5
0
void HomeView::gotoAddress(const QString &address)
{
    emit addressEntered(address);
}
Ejemplo n.º 6
0
void MainWindow::initialize()
{
    MyPreferences::m_prefInstance = new MyPreferences(this);
    SEMPERMERK_PREFS->hide();
    SEMPERMERK_PREFS->resize(size());
    SEMPERMERK_PREFS->move(0, 0);

    m_controlStrip = new ControlStrip(this);
    m_controlStrip->resizeBar(size(), true);
    m_controlStrip->show();

    m_homeView = new HomeView(this);

    m_mapView = new MapView(this);
    m_mapView->show();
    m_mapView->resize(QSize(width(), height()));

    loadTemplateDocument(":/doc/initial.mdc");
    m_mapView->setDocument(m_document);

//    ImageMapLayer* ilayer = m_document->addImageLayer();
//    ilayer->setMapAdapter(TMS_ADAPTER_UUID, "OSM Mapnik");
//    ilayer->setVisible(true);

    M_PREFS->initialPosition(m_mapView);
    m_mapView->launch(new EditInteraction(m_mapView));
    m_mapView->invalidate(true, true);

    m_homeView->resize(QSize(width(), height()));
    m_homeView->move(width(), m_homeView->y());
    m_homeView->show();

    m_gpsview = new QGPS(this);
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
    QGPSMobileDevice* aGps = new QGPSMobileDevice();
    if (aGps->openDevice()) {
        connect(aGps, SIGNAL(updatePosition(qreal, qreal, QDateTime, qreal, qreal, qreal)),
            this, SLOT(updateGpsPosition(qreal, qreal, QDateTime, qreal, qreal, qreal)));

//        ui->gpsConnectAction->setEnabled(false);
//        ui->gpsReplayAction->setEnabled(false);
//        ui->gpsDisconnectAction->setEnabled(true);
//        ui->gpsRecordAction->setEnabled(true);
//        ui->gpsPauseAction->setEnabled(true);
        m_gpsview->setGpsDevice(aGps);
        m_gpsview->resetGpsStatus();
        m_gpsview->startGps();
    }
#elif defined(Q_WS_SIMULATOR)
    QGPSFileDevice* aGps = new QGPSFileDevice(":/test/test.nma");
    if (aGps->openDevice()) {
        connect(aGps, SIGNAL(updatePosition(qreal, qreal, QDateTime, qreal, qreal, qreal)),
            this, SLOT(updateGpsPosition(qreal, qreal, QDateTime, qreal, qreal, qreal)));

//        ui->gpsConnectAction->setEnabled(false);
//        ui->gpsReplayAction->setEnabled(false);
//        ui->gpsDisconnectAction->setEnabled(true);
//        ui->gpsRecordAction->setEnabled(true);
//        ui->gpsPauseAction->setEnabled(true);
        m_gpsview->setGpsDevice(aGps);
        m_gpsview->resetGpsStatus();
        m_gpsview->startGps();
    }
#endif
    m_gpsview->resize(QSize(width(), height()));
    m_gpsview->move(width(), m_gpsview->y());
    m_gpsview->show();

    SEMPERMERK_PREFS->show();

    m_controlStrip->raise();

    connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));

//    connect(m_mapView, SIGNAL(menuButtonClicked()), SLOT(showHomeView()));

//    connect(m_controlStrip, SIGNAL(backClicked()), m_mapView, SLOT(backView()));
//    connect(m_controlStrip, SIGNAL(forwardClicked()), m_mapView, SLOT(fwdView()));
//    connect(m_controlStrip, SIGNAL(stopClicked()), m_mapView, SLOT(stop()));
//    connect(m_controlStrip, SIGNAL(zoomBestClicked()), m_mapView, SLOT(zoomBest()));
//    connect(m_controlStrip, SIGNAL(refreshClicked()), m_mapView, SLOT(reload()));
//    connect(m_controlStrip, SIGNAL(bookmarkClicked()), m_mapView, SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(zoomInClicked()), m_mapView, SLOT(zoomIn()));
    connect(m_controlStrip, SIGNAL(zoomOutClicked()), m_mapView, SLOT(zoomOut()));
    connect(m_controlStrip, SIGNAL(prefClicked()), SLOT(showPreferencesView()));
    connect(m_controlStrip, SIGNAL(menuClicked()), SLOT(showMenu()));

//    m_controlStrip->bookmarkBt->show();
//    m_controlStrip->searchBt->show();
//    m_controlStrip->editBt->hide();

    downSlide(0);

//    QTimer::singleShot(2000, this, SLOT(showHomeView()));
}