Esempio n. 1
0
fluid_menu::fluid_menu(osman *oss)
{
    pictureFlowWidget = new PictureFlow();
    pictureFlowWidget->setFocus();
    addWidget(pictureFlowWidget);
    setCurrentWidget(pictureFlowWidget);
    pictureFlowWidget->setFocus();
    QRect screen_size = QApplication::desktop()->screenGeometry();
    introAni.setInterval(250);
    this->oss=oss;
    QObject::connect(&introAni,SIGNAL(timeout()),this,SLOT(aniSlide()));
    QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(showThat(int)));
	QObject::connect(oss,SIGNAL(showMenu()),this,SLOT(showFullScreen()));
	QObject::connect(oss,SIGNAL(showMenu()),oss,SLOT(hide()));
    h = screen_size.height() * SIZING_FACTOR_HEIGHT;
    w = screen_size.width() * SIZING_FACTOR_WIDTH;

    const int hh = qMin(h, w);
    const int ww = hh;
    pictureFlowWidget->setSlideSize(QSize(ww, hh));
    addIntroItems();
    populatePictureFlow();
    pictureFlowWidget->setCurrentSlide(0);
    pictureFlowWidget->isIntroRunning=true;
    introAni.start();
 

}
Esempio n. 2
0
void fluid_menu::addIntroItems()
{
    menu_item *o=new menu_item(":/logos/o");
    menu_item *s=new menu_item(":/logos/s");
    menu_item *m=new menu_item(":/logos/m");
    menu_item *a=new menu_item(":/logos/a");
    menu_item *n=new menu_item(":/logos/n");
    menu_items.append(o);
    menu_items.append(s);
    menu_items.append(m);
    menu_items.append(a);
    menu_items.append(n);
    populatePictureFlow();
}
FluidLauncher::FluidLauncher(QStringList* args)
{
    pictureFlowWidget = new PictureFlow();
    slideShowWidget = new SlideShow();
    inputTimer = new QTimer();

    addWidget(pictureFlowWidget);
    addWidget(slideShowWidget);
    setCurrentWidget(pictureFlowWidget);
    pictureFlowWidget->setFocus();

    QRect screen_size = QApplication::desktop()->screenGeometry();

    QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(launchApplication(int)));
    QObject::connect(pictureFlowWidget, SIGNAL(inputReceived()),    this, SLOT(resetInputTimeout()));
    QObject::connect(slideShowWidget,   SIGNAL(inputReceived()),    this, SLOT(switchToLauncher()));
    QObject::connect(inputTimer,        SIGNAL(timeout()),          this, SLOT(inputTimedout()));

    inputTimer->setSingleShot(true);
    inputTimer->setInterval(DEFAULT_INPUT_TIMEOUT);

    const int h = screen_size.height() * SIZING_FACTOR_HEIGHT;
    const int w = screen_size.width() * SIZING_FACTOR_WIDTH;
    const int hh = qMin(h, w);
    const int ww = hh / 3 * 2;
    pictureFlowWidget->setSlideSize(QSize(ww, hh));

    bool success;
    int configIndex = args->indexOf("-config");
    if ( (configIndex != -1) && (configIndex != args->count()-1) )
        success = loadConfig(args->at(configIndex+1));
    else
        success = loadConfig("config.xml");

    if (success) {
      populatePictureFlow();

      showFullScreen();
      inputTimer->start();
    } else {
        pictureFlowWidget->setAttribute(Qt::WA_DeleteOnClose, true);
        pictureFlowWidget->close();
    }

}
Esempio n. 4
0
FluidLauncher::FluidLauncher(QWidget * parent, QStringList config, LaunchType type):QStackedWidget(parent)
{
//    qWarning("CFL 1\n");

    Type = type;
    Config = config;

    pictureFlowWidget = new PictureFlow();

    addWidget(pictureFlowWidget);

    setCurrentWidget(pictureFlowWidget);
    pictureFlowWidget->setFocus();

    QRect screen_size = parent->geometry();//QApplication::desktop()->screenGeometry();
    resize(parent->size());

//    qWarning()<<screen_size;
//    qWarning()<<mainwindow->centralwidget->geometry();

    QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(launchApplication(int)));

    const int h = screen_size.height() * SIZING_FACTOR_HEIGHT;
    const int w = screen_size.width() * SIZING_FACTOR_WIDTH;

    const int hh = qMin(h, w);
    const int ww = hh / 3 * 4;
    pictureFlowWidget->setSlideSize(QSize(ww, hh));

    if (type == PictureFlowType) {
        bool success;
        success = loadConfig(Config);

        if (success) {
            populatePictureFlow();
            //        qWarning("CFL 4\n");
            //        show();
        }else { pictureFlowWidget->close();  }
    }
    else
        if (type == FileBrowserType) {
            populateFileBrowser(Config);
        }
}
Esempio n. 5
0
void fluid_menu::introFinished()
{
    menu_items.clear();
    addMenuItems(oss);
    populatePictureFlow();
}