예제 #1
0
파일: kimportdlg.cpp 프로젝트: KDE/kmymoney
void KImportDlg::slotBrowse()
{
  // determine what the browse prefix should be from the current profile

  MyMoneyQifProfile tmpprofile;
  tmpprofile.loadProfile("Profile-" + profile());

  QUrl file = QFileDialog::getOpenFileUrl(this, i18n("Import File..."), QUrl("kfiledialog:///kmymoney-import"),
      i18n("Import files (%1);;All files (%2)", tmpprofile.filterFileType(), "*")
  );

  if (!file.isEmpty()) {
    m_qlineeditFile->setText(file.toDisplayString(QUrl::PreferLocalFile));
  }
}
예제 #2
0
void KImportDlg::slotBrowse()
{
  // determine what the browse prefix should be from the current profile

  MyMoneyQifProfile tmpprofile;
  tmpprofile.loadProfile("Profile-" + profile());

  QPointer<KFileDialog> dialog = new KFileDialog(KUrl("kfiledialog:///kmymoney-import"),
      i18n("%1|Import files\n%2|All files", tmpprofile.filterFileType(), "*"),
      this);
  dialog->setCaption(i18n("Import File..."));
  dialog->setMode(KFile::File | KFile::ExistingOnly);

  if (dialog->exec() == QDialog::Accepted) {
    m_qlineeditFile->setText(dialog->selectedUrl().pathOrUrl());
  }
  delete dialog;
}