コード例 #1
0
HomeAppliance::HomeAppliance(QObject *parent)
    : QObject(parent)
    , m_scene(0)
    , m_fileBox(0)
    , m_historyBox(0)
{
    // create and set the scene
    m_scene = new HomeScene;
    connect(m_scene, SIGNAL(keyPressed(int)), this, SLOT(slotSceneKeyPressed(int)));
    connect(m_scene, SIGNAL(startCanvas()), this, SLOT(slotStartCanvas()));
#if defined(HAS_WORDCLOUD_APPLIANCE)
    connect(m_scene, SIGNAL(startWordcloud()), this, SLOT(slotStartWordcloud()));
#endif
    connect(m_scene, SIGNAL(startWizard()), this, SLOT(slotStartWizard()));
    sceneSet(m_scene);

    // create the History Box, if enough history
    QList<QUrl> recentUrls = App::settings->recentFotowallUrls();
    QPalette brightPal;
    brightPal.setBrush(QPalette::Window, QColor(255, 255, 255, 128));
    if (!recentUrls.isEmpty()) {
        m_historyBox = new UrlHistoryBox(recentUrls);
        m_historyBox->setTitle(tr("RECENT FILES"));
#if !defined(MOBILE_UI)
        m_historyBox->setBorderFlags(0x0000);
        m_historyBox->setCheckable(false);
#endif
        m_historyBox->setPalette(brightPal);
        m_historyBox->setAutoFillBackground(true);
        connect(m_historyBox, SIGNAL(urlClicked(const QUrl &)), this, SLOT(slotLoadCanvas(const QUrl &)));
        connect(m_historyBox, SIGNAL(urlRemoved(const QUrl &)), this, SLOT(slotRemoveFromHistory(const QUrl &)));
        topbarAddWidget(m_historyBox);
    }
コード例 #2
0
ファイル: HelpAppliance.cpp プロジェクト: arielmr/fotowall
HelpAppliance::HelpAppliance(QObject *parent)
  : QObject(parent)
  , m_helpScene(new HelpScene)
  , m_dummyWidget(new QWidget)
{
    // create the gui components over a dummy widget
    ui.setupUi(m_dummyWidget);
    ui.tutorialButton->setVisible(App::onlineServices->checkForTutorial());
    connect(App::onlineServices, SIGNAL(tutorialFound(bool)), ui.tutorialButton, SLOT(setVisible(bool)));
    connect(ui.webButton, SIGNAL(clicked()), App::onlineServices, SLOT(openWebpage()));
    connect(ui.blogButton, SIGNAL(clicked()), App::onlineServices, SLOT(openBlog()));
    connect(ui.tutorialButton, SIGNAL(clicked()), App::onlineServices, SLOT(openTutorial()));
    connect(ui.updateButton, SIGNAL(clicked()), App::onlineServices, SLOT(checkForUpdates()));

    // listen to scene events
    connect(m_helpScene->helpItem, SIGNAL(closeMe()), this, SLOT(slotClose()));

    // customize appliance
    sceneSet(m_helpScene);
    topbarAddWidget(ui.helpBox);
    setFocusToScene();
}
コード例 #3
0
CanvasAppliance::CanvasAppliance(Canvas * extCanvas, QObject * parent)
  : QObject(parent)
  , m_extCanvas(extCanvas)
  , m_dummyWidget(new QWidget)
  , m_gBackModeGroup(0)
  , m_gBackRatioGroup(0)
  , m_gBackContentAction(0)
{
    // init UI
    ui.setupUi(m_dummyWidget);
    connect(ui.bPicture, SIGNAL(clicked()), this, SLOT(slotAddPicture()));
    connect(ui.bText, SIGNAL(clicked()), this, SLOT(slotAddText()));
    connect(ui.bWordcloud, SIGNAL(clicked()), this, SLOT(slotAddWordcloud()));
    connect(ui.bCanvas, SIGNAL(clicked()), this, SLOT(slotAddCanvas()));
    connect(ui.bWebsearch, SIGNAL(toggled(bool)), this, SLOT(slotSearchPicturesToggled(bool)));
#if !defined(MOBILE_UI)
    ui.propertiesBox->collapse();
    ui.canvasPropertiesBox->expand();
#endif
    connect(ui.projectCombo, SIGNAL(activated(int)), this, SLOT(slotProjectComboActivated(int)));
    connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(slotFileSave()));
#if defined(HAS_EXPORTDIALOG)
    connect(ui.exportButton, SIGNAL(clicked()), this, SLOT(slotFileExport()));
#else
    ui.exportButton->hide();
#endif

    // configure the appliance
    windowTitleSet(m_extCanvas->prettyBaseName());
    sceneSet(m_extCanvas);
    ui.addContentBox->setProperty("@onTopbar", true);
    topbarAddWidget(ui.addContentBox);
    topbarAddWidget(ui.propertiesBox);
    topbarAddWidget(ui.canvasPropertiesBox);
    topbarAddWidget(ui.fileBox, true);

    // populate menus
    ui.arrangeButton->setMenu(createArrangeMenu());
    ui.backButton->setMenu(createBackgroundMenu());
    ui.decoButton->setMenu(createDecorationMenu());

    // react to canvas
    connect(m_extCanvas, SIGNAL(backConfigChanged()), this, SLOT(slotBackConfigChanged()));
    connect(m_extCanvas, SIGNAL(requestContentEditing(AbstractContent*)), this, SLOT(slotEditContent(AbstractContent*)));
    connect(m_extCanvas, SIGNAL(showPropertiesWidget(QWidget*)), this, SLOT(slotShowPropertiesWidget(QWidget*)));
    connect(m_extCanvas, SIGNAL(filePathChanged()), this, SLOT(slotFilePathChanged()));

    // react to VideoProvider
    slotVerifyVideoInputs(VideoProvider::instance()->inputCount());
    connect(VideoProvider::instance(), SIGNAL(inputCountChanged(int)), this, SLOT(slotVerifyVideoInputs(int)));

    // set the startup project mode
    int pComboIndex = 0;
    switch (extCanvas->modeInfo()->projectMode()) {
        case CanvasModeInfo::ModeNormal:    pComboIndex = 0; break;
        case CanvasModeInfo::ModeCD:        pComboIndex = 3; break;
        case CanvasModeInfo::ModeDVD:       pComboIndex = 4; break;
        case CanvasModeInfo::ModeExactSize: pComboIndex = 1; break;
        case CanvasModeInfo::ModeWallpaper: pComboIndex = 2; break;
    }
    slotProjectComboActivated(pComboIndex);
}