Пример #1
0
void Navigator::checkDirectory (Q3ListBoxItem *item)
{
  //qDebug("checkDirectory(selected)");
  if (! item)
  {
    emit noSelection();
    selectedFlag = FALSE;
    return;
  }

  if (! item->text().compare(".."))
  {
    upDirectory();
    return;
  }

  QString s;
  if (item->pixmap())
  {
    // step directory tree down
    s = currentDir.absPath() + "/" + item->text();
    setDirectory(s);
    return;
  }

  getFileSelection(s);
  emit fileOpened(s);
}
Пример #2
0
void Navigator::setDirectory (QString &d)
{
  if (d.length())
  {
  //  QFileInfo fi(d);
  //  currentDir.setPath(fi.dirPath(TRUE));
    currentDir.setPath(d);
    updateList();
    emit noSelection();
    selectedFlag = FALSE;
  }
}
Пример #3
0
void Navigator::upDirectory ()
{
  QString s = currentDir.dirName();
  if (s == "data" || s == "group")
    return;
  currentDir.cdUp();
  updateList();
  setCurrentItem(findItem(s, Q3ListBox::ExactMatch));
  ensureCurrentVisible();
  emit noSelection();
  selectedFlag = FALSE;
}
Пример #4
0
void Navigator::fileSelection (Q3ListBoxItem *item)
{
  //qDebug("fileSelection(currentChanged)");
  if (! item)
  {
    emit noSelection();
    selectedFlag = FALSE;
    return;
  }

  if (item->pixmap())
  {
    emit noSelection();
    selectedFlag = FALSE;
    return;
  }

  QString s;
  getFileSelection(s);
  emit fileSelected(s);
  selectedFlag = TRUE;
}
Пример #5
0
LayerViewer::LayerViewer(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LayerViewer)
{
    ui->setupUi(this);

    connect(this->ui->treeView,SIGNAL(hasSelection(bool,bool)),SLOT(on_treeView_hasSelection(bool,bool)));
    connect(this->ui->treeView,SIGNAL(noSelection()),SLOT(on_treeView_noSelection()));

    this->ui->treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    this->ui->treeView->setSelectionBehavior(QAbstractItemView::SelectRows);
    this->ui->treeView->header()->setStretchLastSection(false);

    this->ui->buttonDeleteLayer->setDisabled(true);
    this->ui->buttonGroupLayer->setDisabled(true);
    this->ui->buttonUngroupLayer->setDisabled(true);
    this->ui->buttonMoveDown->setDisabled(true);
    this->ui->buttonMoveUp->setDisabled(true);
    this->ui->buttonMoveToBack->setDisabled(true);
    this->ui->buttonMoveToFront->setDisabled(true);
}
Пример #6
0
void Navigator::setFilter (QString &d)
{
  currentDir.setNameFilter(d);
  updateList();
  // If there is only one item, then select it automatically.
  if (currentDir.count() == 1)
  {
    setCurrentItem(0);
    QString s1;
    getFileSelection(s1);
    QFileInfo info(s1);
    if (info.isFile())
    {
      emit fileOpened(s1);
      selectedFlag = TRUE;
    }
  }
  else
  {
    emit noSelection();
    selectedFlag = FALSE;
  }
}