Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Signals | Public Member Functions | Private Attributes
omni::ui::RecentFileAction Class Reference

Action for recent file. More...

#include <RecentSessions.h>

Inheritance diagram for omni::ui::RecentFileAction:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::RecentFileAction:
Collaboration graph
[legend]

Public Slots

void loadSession ()
 Load session triggers fileToBeLoaded signal. More...
 
void setState ()
 Action is disabled when file does not exist. More...
 

Signals

void fileToBeLoaded (QString const &)
 

Public Member Functions

 RecentFileAction (QString const &_file, QObject *=nullptr)
 
 ~RecentFileAction ()
 
bool fileExists () const
 Check if file exists. More...
 

Private Attributes

QString file_
 

Detailed Description

Action for recent file.

Constructor & Destructor Documentation

omni::ui::RecentFileAction::RecentFileAction ( QString const &  _file,
QObject *  _parent = nullptr 
)
29  :
30  QAction(_file, _parent),
31  file_(_file)
32  {
33  connect(this, SIGNAL(triggered()), this, SLOT(loadSession()));
34  setState();
35  }
void setState()
Action is disabled when file does not exist.
Definition: RecentSessions.cpp:48
void loadSession()
Load session triggers fileToBeLoaded signal.
Definition: RecentSessions.cpp:39
QString file_
Definition: RecentSessions.h:51
omni::ui::RecentFileAction::~RecentFileAction ( )
37 {}

Member Function Documentation

bool omni::ui::RecentFileAction::fileExists ( ) const

Check if file exists.

44  {
45  return util::fileExists(file_);
46  }
bool fileExists(QString const &_filename)
Checks if file exists and is actually a file and not a directory.
Definition: util.cpp:49
QString file_
Definition: RecentSessions.h:51
void omni::ui::RecentFileAction::fileToBeLoaded ( QString const &  )
signal
void omni::ui::RecentFileAction::loadSession ( )
slot

Load session triggers fileToBeLoaded signal.

39  {
40  setState();
41  emit fileToBeLoaded(file_);
42  }
void setState()
Action is disabled when file does not exist.
Definition: RecentSessions.cpp:48
void fileToBeLoaded(QString const &)
QString file_
Definition: RecentSessions.h:51
void omni::ui::RecentFileAction::setState ( )
slot

Action is disabled when file does not exist.

48  {
49  setEnabled(fileExists());
50  }
bool fileExists() const
Check if file exists.
Definition: RecentSessions.cpp:44

Field Documentation

QString omni::ui::RecentFileAction::file_
private

The documentation for this class was generated from the following files: