RemoteDirectorySelectDialog::RemoteDirectorySelectDialog (const QByteArray& accId,
			AccountsManager *am, QWidget *parent)
	: QDialog (parent)
	, AccountId_ (accId)
	, Model_ (new QStandardItemModel (this))
	, ProxyModel_ (new FilesProxyModel (this))
	, AM_ (am)
	{
		Ui_.setupUi (this);

		const auto iconMgr = AM_->GetProxy ()->GetIconThemeManager ();
		auto createDir = new QPushButton (iconMgr->GetIcon ("folder-new"),
				tr ("New directory..."));
		Ui_.ButtonBox_->addButton (createDir, QDialogButtonBox::ActionRole);
		connect (createDir,
				SIGNAL (clicked ()),
				this,
				SLOT (createNewDir ()));

		Model_->setHorizontalHeaderLabels ({ tr ("Directory") });
		ProxyModel_->setSourceModel (Model_);
		Ui_.DirectoriesView_->setModel (ProxyModel_);
		if (auto account = am->GetAccountFromUniqueID (accId))
			if (auto isfl = qobject_cast<ISupportFileListings*> (account->GetQObject ()))
				Util::Sequence (this, isfl->RefreshListing ())
						.MultipleResults ([this] (const ISupportFileListings::RefreshResult_t& result)
								{ HandleGotListing (result); });
	}
示例#2
0
/*! strip part of \a path if it matches
 *  one of the paths in the Config_getList(STRIP_FROM_PATH) list
 */
DirDef *DirDef::mergeDirectoryInTree(const QCString &path)
{
  //printf("DirDef::mergeDirectoryInTree(%s)\n",path.data());
  int p=0,i=0;
  DirDef *dir=0;
  while ((i=path.find('/',p))!=-1)
  {
    QCString part=path.left(i+1);
    if (!matchPath(part,Config_getList(STRIP_FROM_PATH)) && (part!="/" && part!="//"))
    {
      dir=createNewDir(part); 
    }
    p=i+1;
  }
  return dir;
}
示例#3
0
//Construtor
UserFiles::UserFiles()
{
    //Gerando a interface
    interface = new QWidget;

    newDirName = new QLineEdit;

    QPushButton *logoutButton = new QPushButton("Logout");
    QPushButton *newDir = new QPushButton("Novo Diretorio");
    layout = new QVBoxLayout;
    folder = new QLabel;

    layout->addWidget(logoutButton);
    layout->addWidget(newDir);
    layout->addWidget(folder);
    interface->setLayout(layout);

    connect(logoutButton,SIGNAL(clicked()),this,SLOT(logout()));
    connect(newDir,SIGNAL(clicked()),this,SLOT(createNewDir()));
    connect(ServicosRedes::getSingletonInstance(),SIGNAL(facaListagem(QList<QList<QString> >)),this,SLOT(lista(QList<QList<QString> >)));
    connect(ServicosRedes::getSingletonInstance(),SIGNAL(facaCriarPasta(QList<QString>)),this,SLOT(showNewDir(QList<QString>)));
    connect(ServicosRedes::getSingletonInstance(),SIGNAL(facaDeletar(QList<QString>)),this,SLOT(showDelete(QList<QString>)));
}