void ImportLibraryDialog::setupUI()
{
	nameLabel = new QLabel(tr("Library Name : "));
	nameEdit = new QLineEdit;
	nameLabel->setBuddy(nameEdit);
	connect(nameEdit,SIGNAL(textChanged(QString)),this,SLOT(nameEntered()));

	textLabel = new QLabel(tr("Package location : "));
	path = new QLineEdit;
	textLabel->setBuddy(path);

	destLabel = new QLabel(tr("Destination folder : "));
	destPath = new QLineEdit;
	textLabel->setBuddy(destPath);

	accept = new QPushButton(tr("Unpack"));
	accept->setDisabled(true);
	connect(accept,SIGNAL(clicked()),this,SLOT(add()));

	cancel = new QPushButton(tr("Cancel"));
	connect(cancel,SIGNAL(clicked()),this,SLOT(close()));
	//connect(cancel,SIGNAL(clicked()),this,SIGNAL(rejected()));

	find = new QPushButton(QIcon(":/images/coversPackage.png"),"");
	connect(find,SIGNAL(clicked()),this,SLOT(findPath()));

	findDest = new QPushButton(QIcon(":/images/open.png"),"");
	connect(findDest,SIGNAL(clicked()),this,SLOT(findDestination()));

	QGridLayout * content = new QGridLayout;

	content->addWidget(nameLabel,0,0);
	content->addWidget(nameEdit,0,1);

	content->addWidget(textLabel,1,0);
	content->addWidget(path,1,1);
	content->addWidget(find,1,2);
	content->setColumnStretch(2,0); //TODO

	content->addWidget(destLabel,2,0);
	content->addWidget(destPath,2,1);
	content->addWidget(findDest,2,2);
	//destLayout->setStretchFactor(findDest,0); //TODO

	QHBoxLayout *bottomLayout = new QHBoxLayout;
	bottomLayout->addStretch();
	bottomLayout->addWidget(accept);
	bottomLayout->addWidget(cancel);

	progressBar = new QProgressBar(this);
	progressBar->setMinimum(0);
	progressBar->setMaximum(0);
	progressBar->setTextVisible(false);
	progressBar->hide();

	QVBoxLayout *mainLayout = new QVBoxLayout;
	mainLayout->addLayout(content);
	//mainLayout->addWidget(progress = new QLabel());
	mainLayout->addStretch();
	mainLayout->addWidget(progressBar);
	mainLayout->addLayout(bottomLayout);

	QHBoxLayout * imgMainLayout = new QHBoxLayout;
	QLabel * imgLabel = new QLabel(this);
	QPixmap p(":/images/importLibrary.png");
	imgLabel->setPixmap(p);
	imgMainLayout->addWidget(imgLabel);
	imgMainLayout->addLayout(mainLayout);
	
	setLayout(imgMainLayout);

	setModal(true);
	setWindowTitle(tr("Extract a catalog"));
}
Пример #2
0
TiltNRoll::TiltNRoll(QWidget *parent)
        : QStackedWidget(parent), m_channel(0), m_embedded(true)
{
    // call TrickManager::instance for initialization
    TrickManager::instance();
    // call SoundPlayer::instance for initialization
    SoundPlayer::instance();

    // start screen (tab 0)
    StartScreen *s0 = new StartScreen();
    addWidget(s0);
    connect(s0, SIGNAL(playPressed()), this, SLOT(onPlay()));
    connect(s0, SIGNAL(trainingPressed()), this, SLOT(onTraining()));
    connect(s0, SIGNAL(quitPressed()), this, SLOT(onQuit()));
    connect(s0, SIGNAL(simulPressed()), this, SLOT(onSimul()));

    // play screen (tab 1)
    PlayScreen *s1 = new PlayScreen();
    connect(s1, SIGNAL(backPressed()), this, SLOT(onStart()));
    connect(s1, SIGNAL(singlePlayerPressed()), this, SLOT(onSingleplayer()));
    addWidget(s1);

    // training screen (tab 2)
    //SettingsScreen *s2 = new SettingsScreen();
    //TrainPage *s2 = new TrainPage;
    SettingsPage *s2 = new SettingsPage;
    connect(s2, SIGNAL(backPressed()), this, SLOT(onStart()));
    addWidget(s2);

    // DEBUG
    //addWidget(createGraph());

    // single player screen (tab 3)
    SingleplayerScreen *s3 = new SingleplayerScreen();
    connect(s3, SIGNAL(backPressed()), this, SLOT(onPlay()));
    connect(s3, SIGNAL(freestylePressed()), this, SLOT(onFreestyle()));
    connect(s3, SIGNAL(highscorePressed()), this, SLOT(onHighscore()));
    addWidget(s3);

    // freestyle screen (tab 4)
    freestyle_screen = new FreestyleScreen();
    connect(freestyle_screen, SIGNAL(showPauseScreen()), this, SLOT(onPause()));
    connect(s3, SIGNAL(freestylePressed()), freestyle_screen, SLOT(reset()));
    addWidget(freestyle_screen);

    // pause screen (tab 5)
    PauseScreen *s5 = new PauseScreen();
    qDebug("added!");
    connect(s5, SIGNAL(resumePressed()), this, SLOT(onFreestyle()));
    connect(s5, SIGNAL(endGamePressed()), this, SLOT(checkHighscore()));
    addWidget(s5);

    // enter name screen (tab 6)
    EnterNameScreen *s6 = new EnterNameScreen();
    qDebug("added!");
    connect(s6, SIGNAL(nameEntered(QString)), this, SLOT(addToHighscore(QString)));
    addWidget(s6);

    // highscore screen (tab 7)
    HighscoreScreen *s7 = new HighscoreScreen(&hs);
    connect(s7, SIGNAL(backPressed()), this, SLOT(onStart()));
    addWidget(s7);

    // TrickSimulator (tab 8)
    //TrickSimulator* sim = TrickSimulator::instance();
//    BTCapture* sim = BTCapture::instance();
//    connect(sim, SIGNAL(backPressed()), this, SLOT(onStart()));
//    addWidget(sim->widget());

    QSize s(640,360);
    resize(s);
    setMinimumSize(s);
    setMaximumSize(s);
   //setStyle(new QPlastiqueStyle());
    //qApp->setOverrideCursor(Qt::BlankCursor);
    setWindowState(Qt::WindowFullScreen);



    onStart();
}