void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes/* = false*/, bool is_resident/* = true*/)
{
    if (mAvatarId.notNull())
    {
        LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this);
        LLAvatarTracker::instance().removeFriendPermissionObserver(mAvatarId, this);
    }

    mAvatarId = id;
    mSpeakingIndicator->setSpeakerId(id, session_id);

    // We'll be notified on avatar online status changes
    if (!ignore_status_changes && mAvatarId.notNull())
        LLAvatarTracker::instance().addParticularFriendObserver(mAvatarId, this);

    if (mAvatarId.notNull())
        LLAvatarTracker::instance().addFriendPermissionObserver(mAvatarId, this);

    if (is_resident)
    {
        mAvatarIcon->setValue(id);

        // Set avatar name.
        LLAvatarNameCache::get(id,
                               boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
    }

    // AO: Always show permissions icons, like in V1.
    // we put this here so because it's the nearest update point where we have good av data.
    showPermissions(mShowPermissions && gSavedSettings.getBOOL("FriendsListShowPermissions"));
    updateChildren();
}
void propertiesDialog::on_applyButton_clicked()
{
    if (!applyPermissions()){
        QMessageBox::warning(this,trUtf8("Ошибка"),trUtf8("\nОшибка изменения прав доступа"),QMessageBox::Ok);
        showPermissions();
    } else ui->applyButton->setEnabled(false);
}
propertiesDialog::propertiesDialog(threadParam *p ,QIcon *icon,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::propertiesDialog)
{
    ui->setupUi(this);
    setFixedSize(size());
    param=p;
    if (p->files.size()>1){
        ui->nameLabel->setText(trUtf8("(несколько элементов)"));
        ui->label_6->setText(trUtf8("Размещение: "));
        ui->pathLabel->setText(p->source);

        ui->label_8->setText(trUtf8("Кол-во элементов: "));
        ui->typeLabel->setText(trUtf8("файлов: ") + QString().number(p->count_files)+
                               trUtf8(" папок: ")+QString().number(p->count_dirs));
        ui->sizeLabel->setText(filesize(p->total_size));
        ui->time1Label->setText(trUtf8("(несколько элементов)"));
        ui->time2Label->setText(trUtf8("(несколько элементов)"));
    } else {


        ui->nameLabel->setText(p->files.first().fileName());
        ui->pathLabel->setText(p->files.first().absolutePath());
        if (p->files.first().isDir()) ui->sizeLabel->setText(filesize(p->total_size)+trUtf8(", папок: ")+
                                                             QString().number(p->count_dirs)+trUtf8(" файлов: ")+
                                                             QString().number(p->count_files));
        else ui->sizeLabel->setText(filesize(p->total_size));

        if (p->files.first().isSymLink()){
            ui->typeLabel->setText(QFileIconProvider().type(p->files.first())+trUtf8(" (ссылка)"));
            ui->label_12->setText(trUtf8("Ссылка на: "));
            ui->linkLabel->setText(param->files.first().symLinkTarget());
        }
        else{
            ui->typeLabel->setText(QFileIconProvider().type(p->files.first())) ;

        }

        ui->time1Label->setText(p->files.first().lastModified().toString("hh:mm:ss, dd MMM yyyy"));
        ui->time2Label->setText(p->files.first().lastRead().toString("hh:mm:ss, dd MMM yyyy"));

        showPermissions();
        ui->label_11->setPixmap(icon->pixmap(48,48));
    }

    connect(ui->u_read,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->u_write,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->u_exec,SIGNAL(stateChanged(int)),this,SLOT(changged()));

    connect(ui->g_read,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->g_write,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->g_exec,SIGNAL(stateChanged(int)),this,SLOT(changged()));

    connect(ui->o_read,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->o_write,SIGNAL(stateChanged(int)),this,SLOT(changged()));
    connect(ui->o_exec,SIGNAL(stateChanged(int)),this,SLOT(changged()));

}
Esempio n. 4
0
// virtual, called by LLAvatarTracker
void LLAvatarListItem::changed(U32 mask)
{
    // no need to check mAvatarId for null in this case
    setOnline(LLAvatarTracker::instance().isBuddyOnline(mAvatarId));

    if (mask & LLFriendObserver::POWERS)
    {
        showPermissions(mShowPermissions && mHovered);
        updateChildren();
    }
}
// virtual, called by LLAvatarTracker
void LLAvatarListItem::changed(U32 mask)
{
    // no need to check mAvatarId for null in this case
    setOnline(LLAvatarTracker::instance().isBuddyOnline(mAvatarId));

    if ((mask & LLFriendObserver::POWERS) || (mask & LLFriendObserver::PERMS))
    {
        showPermissions(mShowPermissions && gSavedSettings.getBOOL("FriendsListShowPermissions"));
        updateChildren();
    }
}
Esempio n. 6
0
void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask)
{
    getChildView("hovered_icon")->setVisible( false);
    mInfoBtn->setVisible(false);
    mProfileBtn->setVisible(false);

    mHovered = false;
    LLPanel::onMouseLeave(x, y, mask);

    showPermissions(false);
    updateChildren();
}
Esempio n. 7
0
void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
{
    getChildView("hovered_icon")->setVisible( true);
    mInfoBtn->setVisible(mShowInfoBtn);
    mProfileBtn->setVisible(mShowProfileBtn);

    mHovered = true;
    LLPanel::onMouseEnter(x, y, mask);

    showPermissions(mShowPermissions);
    updateChildren();
}
Esempio n. 8
0
void ls(Directory *currentDirectory, int argCount)
{
  int numOfLines = currentDirectory -> numOfSubs;

  if (argCount == 1)// when command is ls-l
  {
    int i = 0;

    for (i = 0; i < numOfLines; i++)
    {
        showPermissions((currentDirectory -> subdirectories[i]).per.octalPermission);
        printf("%d ", (currentDirectory -> subdirectories[i].time) + 1);
        printf("%s \n", currentDirectory -> subdirectories[i].name);
    }// for(i = 0; i < numOfLines; i++)
  }// if(argCount == 1)

  if (argCount == 0)// when command is ls
  {
    int i = 0;

    for (i = 0; i < numOfLines; i++)
    {

      if (i == (numOfLines - 1))// printing spaces
      {
        printf("%s", currentDirectory -> subdirectories[i].name);
      }

      else //printing spaces
      {
        printf("%s ", currentDirectory -> subdirectories[i].name);
      }

    }// for(i = 0; i < numOfLines; i++)

    printf("\n");
  }// if (argCount == 0)
}// void ls(Directory *currentDirectory, int argCount)
void LLAvatarListItem::setShowPermissions(bool show)
{
    mShowPermissions=show;
    showPermissions(show);
}
Esempio n. 10
0
void NBFolderView::createAndSetupActions() {

	connect( IconView, SIGNAL( peek( QModelIndex ) ), this, SLOT( doPeek( QModelIndex ) ) );

	connect( IconView, SIGNAL( open( QModelIndex ) ), this, SLOT( doOpen( QModelIndex ) ) );
	connect( IconView, SIGNAL( open( QString ) ), this, SLOT( doOpen( QString ) ) );

	connect( IconView, SIGNAL( contextMenuRequested( QPoint ) ), this, SLOT( showContextMenu( QPoint ) ) );
	connect( IconView, SIGNAL( actionsMenuRequested( QPoint ) ), this, SLOT( showActionsMenu( QPoint ) ) );

	connect(
		IconView->selectionModel(), SIGNAL( selectionChanged( const QItemSelection&, const QItemSelection& ) ),
		this, SIGNAL( selectionChanged( const QItemSelection&, const QItemSelection& ) )
	);

	connect( IconView->selectionModel(), SIGNAL( selectionChanged( const QItemSelection&, const QItemSelection& ) ), this, SLOT( updateActions() ) );

	connect( IconView, SIGNAL( link( QStringList, QString ) ), this, SLOT( link( QStringList, QString ) ) );

	// DragDrop copy
	connect( IconView, SIGNAL( copy( QStringList, QString ) ), this, SLOT( copy( QStringList, QString ) ) );

	// DragDrop move
	connect( IconView, SIGNAL( move( QStringList, QString ) ), this, SLOT( move( QStringList, QString ) ) );

	// Update actions once the directory is loaded
	connect( fsModel, SIGNAL( directoryLoaded( QString ) ), this, SLOT( updateActions() ) );

	// Peek
	peekAct = new QAction( QIcon( ":/icons/peek.png" ), "Pee&k", this );
	peekAct->setShortcuts( Settings->shortcuts( "Peek" ) );

	connect( peekAct, SIGNAL( triggered() ), this, SLOT( doPeek() ) );
	addAction( peekAct );

	// Home Dir
	actHomeDir = new QAction( QIcon( ":/icons/home.png" ), "&Home", this );
	actHomeDir->setShortcuts( Settings->shortcuts( "GoHome" ) );

	connect( actHomeDir, SIGNAL( triggered() ), this, SLOT( loadHomeDir() ) );
	addAction( actHomeDir );

	// Home
	actGoHome = new QAction( QIcon( ":/icons/home.png" ), "&Home", this );
	actGoHome->setShortcut( tr( "Alt+Shift+Home" ) );

	connect( actGoHome, SIGNAL( triggered() ), this, SLOT( doOpenHome() ) );
	addAction( actGoHome );

	// Up
	actParDir = new QAction( QIcon( ":/icons/up.png" ), "&Up", this );
	actParDir->setShortcuts( Settings->shortcuts( "GoUp" ) );

	connect( actParDir, SIGNAL( triggered() ), fsModel, SLOT( goUp() ) );
	addAction( actParDir );

	// Back
	actPrevDir = new QAction( QIcon( ":/icons/prev.png" ), "&Back", this );
	actPrevDir->setShortcuts( Settings->shortcuts( "GoLeft" ) );

	connect( actPrevDir, SIGNAL( triggered() ), fsModel, SLOT( goBack() ) );
	addAction( actPrevDir );

	// Forward
	actNextDir = new QAction( QIcon( ":/icons/next.png" ), "&Forward", this );
	actNextDir->setShortcuts( Settings->shortcuts( "GoRight" ) );

	connect( actNextDir, SIGNAL( triggered() ), fsModel, SLOT( goForward() ) );
	addAction( actNextDir );

	// New Folder
	actNewDir = new QAction( QIcon::fromTheme( "folder-new" ), "New folder", this );
	actNewDir->setShortcuts( Settings->shortcuts( "NewFolder" ) );

	connect( actNewDir, SIGNAL( triggered() ), this, SLOT( newFolder() ) );
	addAction( actNewDir );

	// New file
	actNewFile = new QAction( QIcon::fromTheme( "document-new" ), "New File", this );
	actNewFile->setShortcuts( Settings->shortcuts( "NewFile" ) );

	connect( actNewFile, SIGNAL( triggered() ), this, SLOT( newFile() ) );
	addAction( actNewFile );

	// New file
	actNewEncFS = new QAction( QIcon::fromTheme( "document-new" ), "New Encrypted Directory", this );
	actNewEncFS->setShortcuts( Settings->shortcuts( "NewEncFS" ) );

	connect( actNewEncFS, SIGNAL( triggered() ), this, SLOT( createEncFS() ) );
	addAction( actNewEncFS );

	// Copy
	copyAct = new QAction( QIcon( ":/icons/copy.png" ), "&Copy", this );
	copyAct->setShortcuts( Settings->shortcuts( "Copy" ) );

	connect( copyAct, SIGNAL( triggered() ), this, SLOT( prepareCopy() ) );
	addAction( copyAct );

	// Move
	moveAct = new QAction( QIcon( ":/icons/cut.png" ), "Cu&t", this );
	moveAct->setShortcuts( Settings->shortcuts( "Cut" ) );

	connect( moveAct, SIGNAL( triggered() ), this, SLOT( prepareMove() ) );
	addAction( moveAct );

	// Paste
	pasteAct = new QAction( QIcon( ":/icons/paste.png" ), "&Paste", this );
	pasteAct->setShortcuts( Settings->shortcuts( "Paste" ) );

	connect( pasteAct, SIGNAL( triggered() ), this, SLOT( prepareIO() ) );
	addAction( pasteAct );

	// Rename
	renameAct = new QAction( QIcon( ":/icons/rename.png" ), "&Rename", this );
	renameAct->setShortcuts( Settings->shortcuts( "Rename" ) );

	connect( renameAct, SIGNAL( triggered() ), this, SLOT( doRename() ) );
	addAction( renameAct );

	// Reload
	reloadAct = new QAction( QIcon( ":/icons/reload.png" ), "Re&fresh", this );
	reloadAct->setShortcuts( Settings->shortcuts( "Reload" ) );

	connect( reloadAct, SIGNAL( triggered() ), this, SLOT( doReload() ) );
	addAction( reloadAct );

	// showDotFiles
	showHideDotFiles = new QAction( QIcon( ":/icons/showDotFiles.png" ), "Show &Hidden", this );
	showHideDotFiles->setShortcuts( Settings->shortcuts( "ToggleHidden" ) );

	connect( showHideDotFiles, SIGNAL( triggered() ), this, SLOT( doToggleHidden() ) );
	addAction( showHideDotFiles );

	// Trash
	trashAct = new QAction( QIcon( ":/icons/trash.png" ), "Move to trash", this );
	trashAct->setShortcuts( Settings->shortcuts( "Trash" ) );

	connect( trashAct, SIGNAL( triggered() ), this, SLOT( doSendToTrash() ) );
	addAction( trashAct );

	// Delete
	delAct = new QAction( QIcon( ":/icons/delete.png" ), "Delete", this );
	delAct->setShortcuts( Settings->shortcuts( "Delete" ) );

	connect( delAct, SIGNAL( triggered() ), this, SLOT( doDelete() ) );
	addAction( delAct );

	// Properties
	propertiesAct = new QAction( QIcon( ":/icons/props.png" ), "&Properties", this );
	propertiesAct->setShortcuts( Settings->shortcuts( "Properties" ) );

	connect( propertiesAct, SIGNAL( triggered() ), this, SIGNAL( showProperties() ) );
	addAction( propertiesAct );

	// Permissions
	permissionsAct = new QAction( QIcon::fromTheme( "system-users" ), "P&ermissions", this );
	permissionsAct->setShortcuts( Settings->shortcuts( "Permissions" ) );

	connect( permissionsAct, SIGNAL( triggered() ), this, SIGNAL( showPermissions() ) );
	addAction( permissionsAct );

	// Open a virtual terminal emulator
	openVTE = new QAction( QIcon::fromTheme( "utilities-terminal" ), "Open &VTE", this );
	openVTE->setShortcuts( Settings->shortcuts( "Terminal" ) );

	connect( openVTE, SIGNAL( triggered() ), this, SLOT( openTerminal() ) );
	addAction( openVTE );

	// Open a virtual terminal emulator
	openVTEin = new QAction( QIcon::fromTheme( "utilities-terminal" ), "Open &VTE Here", this );
	// openVTEin->setShortcuts( Settings->shortcuts( "Terminal" ) );
	connect( openVTEin, SIGNAL( triggered() ), this, SLOT( openTerminalIn() ) );

	// Select All
	QAction *selectAllAct = new QAction( "&Select All", this );
	selectAllAct->setShortcuts( Settings->shortcuts( "SelectAll" ) );

	connect( selectAllAct, SIGNAL( triggered() ), this, SLOT( selectAll() ) );
	addAction( selectAllAct );

	// Sorting
	sortByNameAct = new QAction( QIcon::fromTheme( "format-text-underline" ), "&Name", this );
	sortByNameAct->setCheckable( true );
	connect( sortByNameAct, SIGNAL( triggered() ), this, SLOT( sortByName() ) );

	sortByTypeAct = new QAction( QIcon::fromTheme( "preferences-other" ), "&Type", this );
	sortByTypeAct->setCheckable( true );
	connect( sortByTypeAct, SIGNAL( triggered() ), this, SLOT( sortByType() ) );

	sortBySizeAct = new QAction( QIcon( ":/icons/size.png" ), "&Size", this );
	sortBySizeAct->setCheckable( true );
	connect( sortBySizeAct, SIGNAL( triggered() ), this, SLOT( sortBySize() ) );

	sortByDateAct = new QAction( QIcon::fromTheme( "office-calendar" ), "&Date", this );
	sortByDateAct->setCheckable( true );
	connect( sortByDateAct, SIGNAL( triggered() ), this, SLOT( sortByDate() ) );

	QActionGroup *sortGroup = new QActionGroup( this );
	sortGroup->addAction( sortByNameAct );
	sortGroup->addAction( sortByTypeAct );
	sortGroup->addAction( sortBySizeAct );
	sortGroup->addAction( sortByDateAct );

	switch( ( int )Settings->value( "SortColumn" ) ) {
		case 0: {
			sortByNameAct->setChecked( true );
			break;
		}
		case 1: {
			sortBySizeAct->setChecked( true );
			break;
		}
		case 2: {
			sortByTypeAct->setChecked( true );
			break;
		}
		case 4: {
			sortByDateAct->setChecked( true );
			break;
		}
	}

	groupsAct = new QAction( QIcon::fromTheme( "view-group", QIcon( ":/icons/groups.png" ) ), "Show in &Groups", this );
	groupsAct->setCheckable( true );
	groupsAct->setChecked( Settings->value( "Grouping" ) );
	connect( groupsAct, SIGNAL( triggered() ), this, SIGNAL( toggleGroups() ) );

	// Add bookmark
	addBookMarkAct = new QAction( QIcon( ":/icons/bookmark.png" ), "Add &Bookmark", this );
	addBookMarkAct->setShortcuts( Settings->shortcuts( "AddBookmark" ) );

	connect( addBookMarkAct, SIGNAL( triggered() ), this, SLOT( addBookMark() ) );
	addAction( addBookMarkAct );

	/* Add to SuperStart */
	addToSuperStartAct = new QAction( QIcon( ":/icons/superstart.png" ), "Add to S&uperStart", this );
	addToSuperStartAct->setShortcut( tr( "Ctrl+U" ) );

	connect( addToSuperStartAct, SIGNAL( triggered() ), this, SLOT( addToSuperStart() ) );
	addAction( addToSuperStartAct );

	updateActions();
};