19 #include "internal/org_mitk_gui_qt_application_Activator.h"
27 #include <QFileDialog>
29 class QmitkFileOpenActionPrivate
36 action->setText(
"&Open File...");
37 action->setToolTip(
"Open data files (images, surfaces,...)");
39 QObject::connect(action, SIGNAL(triggered(
bool)), action, SLOT(Run()));
52 QString getLastFileOpenPath()
const
57 return prefs->Get(
"LastFileOpenPath",
"");
62 void setLastFileOpenPath(
const QString& path)
const
67 prefs->Put(
"LastFileOpenPath", path);
72 bool GetOpenEditor()
const
77 return prefs->GetBool(
"OpenEditor",
true);
86 : QAction(0), d(new QmitkFileOpenActionPrivate)
92 : QAction(0), d(new QmitkFileOpenActionPrivate)
99 : QAction(0), d(new QmitkFileOpenActionPrivate)
101 d->init(window,
this);
113 QStringList fileNames = QFileDialog::getOpenFileNames(NULL,
"Open",
114 d->getLastFileOpenPath(),
117 if (fileNames.empty())
120 d->setLastFileOpenPath(fileNames.front());
virtual SmartPointer< IPreferences > GetSystemPreferences()=0
Implements transparent reference counting.
static void LoadFiles(const QStringList &fileNames, berry::IWorkbenchWindow::Pointer wnd, bool openEditor=true)
static QString GetFileOpenFilterString()
GetFilterString.
ObjectType * GetPointer() const
berry::SmartPointer< Self > Pointer
QmitkFileOpenAction(berry::IWorkbenchWindow::Pointer window)