Example #1
0
MainWindowMobile::MainWindowMobile(QWidget * parent)
    : PlugGui::Container(parent)
    , m_networkAccessManager(new QNetworkAccessManager)
    , m_pictureSearch(0)
    , m_sceneView(0)
    , m_topbarContainer(0)
{
    // setup widget
    applianceSetTitle(QString());

    // vertical layout
    QVBoxLayout * mainLayout = new QVBoxLayout(this);
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);

    // container for the navigation bar
    QWidget * nbContainer = new NavibarContainer(this);
    mainLayout->addWidget(nbContainer);
    QLayout * nbLayout = new QHBoxLayout(nbContainer);
    nbLayout->setMargin(0);

    // create the Workflow navigation bar
    BreadCrumbBar * workflowBar = new BreadCrumbBar(nbContainer);
    workflowBar->setObjectName(QString::fromUtf8("applianceNavBar"));
    workflowBar->setClickableLeaves(false);
    workflowBar->setBackgroundOffset(-1);
    nbLayout->addWidget(workflowBar);
    workflowBar->show();

    nbLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));

    // create the exit button on the right side
    BreadCrumbBar * exitBar = new BreadCrumbBar(nbContainer);
    connect(exitBar, SIGNAL(nodeClicked(quint32)), qApp, SLOT(quit()));
    exitBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
    exitBar->setBackgroundOffset(1);
    exitBar->addNode(1, tr("Exit"), 0);
    nbLayout->addWidget(exitBar);
    exitBar->show();

    // create the Help navigation bar
    /*BreadCrumbBar * helpBar = new BreadCrumbBar(m_sceneView);
    connect(helpBar, SIGNAL(nodeClicked(quint32)), this, SLOT(slotHelpBarClicked(quint32)));
    helpBar->setBackgroundOffset(1);
    helpBar->addNode(1, tr(" ? "), 0);
    helpBar->show();
    addNavigationWidget(helpBar, 0, Qt::AlignRight);*/

    // the scene view, where applicances will plug into!
    m_sceneView = new SceneView(this);
    mainLayout->addWidget(m_sceneView);
    m_sceneView->setFrameShape(QFrame::NoFrame);

    // the topbar container, populated by the framework
    m_topbarContainer = new TopbarContainer(m_sceneView);
    m_topbarContainer->setFixedHeight(App::TopBarHeight);
    m_topbarContainer->show();
    QHBoxLayout * topbarLayout = new QHBoxLayout(m_topbarContainer);
    topbarLayout->setMargin(0);
    topbarLayout->setSpacing(0);

    // show (with last geometry)
    showFullScreen();

    // start the workflow
    new Workflow((PlugGui::Container *)this, workflowBar);

    // create the online services
    new OnlineServices(m_networkAccessManager);

    // focus the scene
    applianceSetFocusToScene();

#if 0
    // start with the Help appliance the first time
    if (App::settings->firstTime())
        App::workflow->stackHelpAppliance();
#endif
}
Example #2
0
MainWindow::MainWindow(QWidget * parent)
    : PlugGui::Container(parent)
    , ui(new Ui::MainWindow())
    , m_networkAccessManager(new QNetworkAccessManager)
    , m_navigationLayout(0)
    , m_pictureSearch(0)
    , m_likeBack(0)
    , m_applyingAccelState(false)
{
    // setup widget
    applianceSetTitle(QString());
    setWindowIcon(QIcon(":/data/fotowall.png"));

    // init ui
    ui->setupUi(this);
    ui->topBar->setFixedHeight(App::TopBarHeight);
    ui->transpBox->setEnabled(true);
    ui->accelBox->setEnabled(ui->sceneView->supportsOpenGL());
    ui->accelTestButton->setEnabled(ui->sceneView->supportsOpenGL());
    ui->applianceSidebar->hide();
    ui->sceneView->setFocus();
    connect(ui->sceneView, SIGNAL(heavyRepaint()), this, SLOT(slotRenderingSlow()));
    createLikeBack();

    // create the navigation layout
    m_navigationLayout = new QGridLayout;
    m_navigationLayout->setContentsMargins(0, 0, 0, 0);
    m_navigationLayout->setSpacing(3);
    ui->navBar->setLayout(m_navigationLayout);

    // create the Workflow navigation bar
    BreadCrumbBar * workflowBar = new BreadCrumbBar(ui->sceneView);
    workflowBar->setObjectName(QString::fromUtf8("applianceNavBar"));
    workflowBar->setClickableLeaves(false);
    workflowBar->setBackgroundOffset(-1);
    addNavigationWidget(workflowBar, 0, Qt::AlignLeft);

    // create the Help bar
    BreadCrumbBar * helpBar = new BreadCrumbBar(ui->sceneView);
    connect(helpBar, SIGNAL(nodeClicked(quint32)), this, SLOT(slotHelpBarClicked(quint32)));
    helpBar->setBackgroundOffset(1);
    helpBar->addNode(1, tr(" ? "), 0);
    addNavigationWidget(helpBar, 0, Qt::AlignRight);

    // show (with last geometry)
    if (!restoreGeometry(App::settings->value("Fotowall/Geometry").toByteArray())) {
        QRect desktopGeometry = QApplication::desktop()->availableGeometry();
        resize(2 * desktopGeometry.width() / 3, 2 * desktopGeometry.height() / 3);
        showMaximized();
    } else
        show();

    // re-apply transparency
    if (App::settings->value("Fotowall/Tranlucent", false).toBool())
        ui->transpBox->setChecked(true);

    // start the workflow
    new Workflow((PlugGui::Container *)this, workflowBar);

    // create the online services
    new OnlineServices(m_networkAccessManager);

#if 0
    // start with the Help appliance the first time
    if (App::settings->firstTime())
        App::workflow->stackHelpAppliance();
#endif
}