Esempio n. 1
0
void update(void)
{
  StatRec stats;

  if (check_mnt_table())
    get_mnt_table();
  cur_changed = False;
  root_modified = check(rootdir);
  cur_modified = dirModified(curdir);
  shelf_modified = dirModified(shelfdir);
  if (!root_modified && !cur_modified && !shelf_modified)
    return;
  if (root_modified || shelf_modified ||
      !dirIsReadable(shelfdir) && !stat(dirName(shelfdir), &stats) &&
      S_ISDIR(stats.st_mode))
    WaitMsg("Updating view, please wait ...");
  else
    Wait();
  if (root_modified)
    dirUpdate(rootdir);
  if (shelf_modified)
    dirUpdate(shelfdir);
  else if (!dirIsReadable(shelfdir) && !stat(dirName(shelfdir), &stats) &&
	   S_ISDIR(stats.st_mode)) {
    /* force shelf to be reread */
    dirReread(shelfdir);
    dirReadFileInfo(shelfdir);
    shelf_modified = True;
  }
  cur_check();
  Done();
}
Esempio n. 2
0
void djvFileBrowserModel::setPath(const QString & path)
{
    if (path == _p->path)
        return;
    
    _p->path = path;
    
    dirUpdate();
    modelUpdate();
    
    Q_EMIT pathChanged(_p->path);
}
Esempio n. 3
0
void djvFileBrowserModel::setSequence(djvSequence::COMPRESS in)
{
    if (in == _p->sequence)
        return;

    _p->sequence = in;

    dirUpdate();
    modelUpdate();
    
    Q_EMIT sequenceChanged(_p->sequence);
    Q_EMIT optionChanged();
}
Esempio n. 4
0
/// Constructor
TUIFileBrowserButton::TUIFileBrowserButton(int id, int type, QWidget *w, int parent, QString name)
    : TUIElement(id, type, w, parent, name)
{
    QPushButton *b = new QPushButton(w);
    if (name.contains("."))
    {
        QPixmap pm(name);
        if (pm.isNull())
        {
            QString covisedir = QString(getenv("COVISEDIR"));
            QPixmap pm(covisedir + "/" + name);
            if (pm.isNull())
            {
                b->setText(name);
            }
            else
            {
                b->setIcon(pm);
            }
        }
        else
        {
            b->setIcon(pm);
        }
    }
    else
        b->setText(name);

    //b->setFixedSize(b->sizeHint());
    //std::cerr << "Creating new Filebrowser instance!" << std::endl;
    this->mFileBrowser = new FileBrowser(this, 0, id);
    connect(this, SIGNAL(dirUpdate(QStringList)), this->mFileBrowser, SLOT(handleDirUpdate(QStringList)));
    connect(this, SIGNAL(fileUpdate(QStringList)), this->mFileBrowser, SLOT(handleFileUpdate(QStringList)));
    connect(this, SIGNAL(clientUpdate(QStringList)), this->mFileBrowser, SLOT(handleClientUpdate(QStringList)));
    /*connect(this,SIGNAL(filterUpdate(QStringList)),this->mFileBrowser, SLOT(handleFilterUpdate(QStringList)));*/
    connect(this, SIGNAL(curDirUpdate(QString)), this->mFileBrowser, SLOT(handleCurDirUpdate(QString)));
    connect(this, SIGNAL(driveUpdate(QStringList)), this->mFileBrowser, SLOT(handleDriveUpdate(QStringList)));
    connect(this, SIGNAL(updateMode(int)), this->mFileBrowser, SLOT(handleUpdateMode(int)));
    connect(this, SIGNAL(updateFilterList(char *)), this->mFileBrowser, SLOT(handleUpdateFilterList(char *)));
    connect(this, SIGNAL(locationUpdate(QString)), this->mFileBrowser, SLOT(handleLocationUpdate(QString)));
    connect(this, SIGNAL(updateRemoteButtonState(int)), this->mFileBrowser, SLOT(handleupdateRemoteButtonState(int)));
    connect(this, SIGNAL(updateLoadCheckBox(bool)), this->mFileBrowser, SLOT(handleUpdateLoadCheckBox(bool)));

    mFileBrowser->setWindowTitle("TabletUI VRML - Remote File Browser");

    widget = b;

    connect(b, SIGNAL(pressed()), this, SLOT(onPressed()));
}
Esempio n. 5
0
void TUIFileBrowserButton::setValue(int type, covise::TokenBuffer &tb)
{
    int size;
    char *entry;
    QString strEntry;
    QStringList list;

    if (type == TABLET_SET_DIRLIST)
    {
#ifdef MB_DEBUG
        std::cerr << "Received DirList!" << std::endl;
#endif
        tb >> size;
        for (int i = 0; i < size; i++)
        {
            tb >> entry;
            strEntry = entry;
            list.append(entry);
        }
        emit dirUpdate(list);
    }
Esempio n. 6
0
void djvFileBrowserModel::reload()
{
    dirUpdate();
    modelUpdate();
}
Esempio n. 7
0
void Player::move(){
	dirUpdate(select_dir);
	//ブロック選択

	if (select_dir == SELECTDIR::NON_Y0)
	{
		if (env.isPressKey('S') &&
			(env.isPushKey('D') ||
			env.isPushKey('A')))
		{
			;
		}
		if (selection.y() > -2){
			if (env.isPushKey('W')){
				selection.y()--;
			}
		}


	}
	
	if (select_dir == SELECTDIR::NON){
		if (env.isPressKey('S') &&
			(env.isPushKey('D') ||
			env.isPushKey('A')))
		{
			;
		}
		else if (env.isPushKey('W') &&
			(env.isPushKey('D') ||
			env.isPushKey('A')))
		{
			;
		}
		else if (env.isPushKey('A')){
			selection.x()--;
		}
		else if (env.isPushKey('D')){
			selection.x()++;
		}
		else if (env.isPushKey('S')){
			selection.y()++;
		}
		else	if (env.isPushKey('W')){
			selection.y()--;
		}


	}
	if (select_dir == SELECTDIR::NON_Y1)
	{
		if (env.isPushKey('W') &&
			(env.isPushKey('D') ||
			env.isPushKey('A')))
		{
			;
		}

		if (selection.y() < 4){
			if (env.isPushKey('S')){
				selection.y()++;
			}
		}

	}
	if (select_dir == SELECTDIR::Y){
		if (selection.y() > -3){
			if (env.isPushKey('W')){
				selection.y()--;
			}
		}
		if (selection.y() < 2){
			if (env.isPushKey('S')){
				selection.y()++;
			}
		}
	}



	if (
		select_dir == SELECTDIR::NON_Y0 ||
		select_dir == SELECTDIR::NON_Y1){
		if (selection.x() > -2){
			if (env.isPushKey('A')){
				selection.x()--;
			}
		}
		if (selection.x() < 2){
			if (env.isPushKey('D')){
				selection.x()++;
			}
		}
	}

	//移動
	if (env.isPressKey('Z') && env.isPressKey('C')){
		;
	}
	else if (env.isPressKey('Z')){
		animation();
		player.vec.x() -= speed.x();


		if (player.vec.x() < -8){
			player.vec.x() = -8;
		}
		direction = DIRECTION::LEFT;
	}
	else if (env.isPressKey('C')){
		animation();
		player.vec.x() += speed.x();
		if (player.vec.x() > 8){
			player.vec.x() = 8;
		}
		direction = DIRECTION::RIGHT;
	}




	player.pos.x() += player.vec.x();

	if (player.vec.x()*player.vec.x() > 0.01){
		player.vec.x() *= 0.9;
	}
	else{
		player.vec.x() = 0;
	}

	//ジャンプ
	if (player.vec.y() > -3){
		if (jump_flag == true){
			if (env.isPushKey('K')){
				jump.play();
				player.vec.y() = speed.y();
				jump_flag = false;
			}
		}
	}

	player.pos.y() += player.vec.y();
	if (player.vec.y() >= -25){
		player.vec.y() -= g;
	}

}