Exemple #1
0
bool QNapiOpenDialog::selectDirectory() {
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
  files.clear();
  QString dir = getExistingDirectory(this, windowTitle(), directory().path());

  if (dir == directory().path()) dir = "";

  if (!dir.isEmpty()) files << dir;

  return !dir.isEmpty();
#else
  if (!placeWindow()) return false;
  // QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ?
  setFileMode(QFileDialog::DirectoryOnly);
  return exec();
#endif
}
void TestMainWindow::activatedListItem(HbListWidgetItem *item)
{
    if( item->text().compare( getDir ) == 0 ) {
        getExistingDirectory();
    } else if( item->text().compare( getFile ) == 0 ) {
        getOpenFileName();
    } else if( item->text().compare( saveFile ) == 0 ) {
       getSaveFileName();
    } else if( item->text().compare( getDir_SetDir ) == 0 ) {
        getExistingDirectory_SetDir();
    } else if( item->text().compare( getFile_SetDir ) == 0 ) {
       getOpenFileName_SetDir();
    } else if( item->text().compare( saveFile_SetDir ) == 0 ) {
        getSaveFileName_SetDir();
    } else if( item->text().compare( getDir_SetFilter ) == 0 ) {
        getExistingDirectory_SetFilter();
    } else if( item->text().compare( getDir_SetFilter_AllDirs ) == 0 ) {
        getExistingDirectory_SetFilter_AllDirs();
    } else if( item->text().compare( getFile_SetFilter ) == 0 ) {
        getOpenFileName_SetFilter();
    } else if( item->text().compare( saveFile_SetFilter ) == 0 ) {
       getSaveFileName_SetFilter();
    }
}