OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SaveOptionsCmd Class Reference

#include <SaveOptionsCmd.hh>

Inheritance diagram for SaveOptionsCmd:
Inheritance graph
Collaboration diagram for SaveOptionsCmd:
Collaboration graph

Public Member Functions

 SaveOptionsCmd ()
 
virtual ~SaveOptionsCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual SaveOptionsCmdcreate () const
 
virtual std::string icon () const
 
virtual std::string shortName () const
 
virtual bool isEnabled ()
 
- Public Member Functions inherited from EditorCommand
 EditorCommand (std::string name, wxWindow *parent=NULL)
 
virtual ~EditorCommand ()
 
void setView (wxView *view)
 
wxView * view () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

wxCommand for saving editor options.

Creates and shows an OptionsDialog.

Definition at line 42 of file SaveOptionsCmd.hh.

Constructor & Destructor Documentation

◆ SaveOptionsCmd()

SaveOptionsCmd::SaveOptionsCmd ( )

The Constructor.

Definition at line 49 of file SaveOptionsCmd.cc.

49 :
51}
static const std::string CMD_NAME_SAVE_OPTIONS
Command name for the "Save Options" command.

Referenced by create().

◆ ~SaveOptionsCmd()

SaveOptionsCmd::~SaveOptionsCmd ( )
virtual

The Destructor.

Definition at line 57 of file SaveOptionsCmd.cc.

57{}

Member Function Documentation

◆ create()

SaveOptionsCmd * SaveOptionsCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 98 of file SaveOptionsCmd.cc.

98 {
99 return new SaveOptionsCmd();
100}

References SaveOptionsCmd().

Here is the call graph for this function:

◆ Do()

bool SaveOptionsCmd::Do ( )
virtual

Executes the command.

Returns
True, if the command was succesfully executed, false otherwise.

Implements GUICommand.

Definition at line 66 of file SaveOptionsCmd.cc.

66 {
67
68 ProDeOptions* options = wxGetApp().options();
71
72 try {
73 writer.writeOptions(*options);
74 options->clearModified();
75 } catch (Exception const& e) {
76 ErrorDialog errorDialog(parentWindow(),
78 errorDialog.ShowModal();
79 return false;
80 }
81 return true;
82}
static MachInfoCmdLineOptions options
Definition MachInfo.cc:46
static TCEString userConfPath(const std::string &fileName)
std::string errorMessage() const
Definition Exception.cc:123
wxWindow * parentWindow() const
Definition GUICommand.cc:75
void writeOptions(const GUIOptions &options)
static wxString toWxString(const std::string &source)
void setDestinationFile(const std::string &fileName)

References Exception::errorMessage(), options, GUICommand::parentWindow(), XMLSerializer::setDestinationFile(), WxConversion::toWxString(), Environment::userConfPath(), and GUIOptionsSerializer::writeOptions().

Here is the call graph for this function:

◆ icon()

string SaveOptionsCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 117 of file SaveOptionsCmd.cc.

117 {
119}
static const std::string CMD_ICON_SAVE_OPTIONS
Icon location for the "Save Options" command.

References ProDeConstants::CMD_ICON_SAVE_OPTIONS.

◆ id()

int SaveOptionsCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 89 of file SaveOptionsCmd.cc.

References ProDeConstants::COMMAND_SAVE_OPTIONS.

◆ isEnabled()

bool SaveOptionsCmd::isEnabled ( )
virtual

This command is enabled when the options have been modified.

Returns
True if the options have been modified, otherwise false.

Reimplemented from EditorCommand.

Definition at line 128 of file SaveOptionsCmd.cc.

128 {
129 return wxGetApp().options()->isModified();
130}

◆ shortName()

string SaveOptionsCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 108 of file SaveOptionsCmd.cc.

108 {
110}
static const std::string CMD_SNAME_SAVE_OPTIONS
Command name for the "Save Options" command.

References ProDeConstants::CMD_SNAME_SAVE_OPTIONS.


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