All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Slots | Signals | Public Member Functions
Qtilities::ProjectManagement::ProjectManager Class Reference

The ProjectManager class. More...

#include <ProjectManager.h>

Inheritance diagram for Qtilities::ProjectManagement::ProjectManager:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ContainedTasks { TaskSaveProject = 0, TaskOpenProject = 1, TaskCloseProject = 2 }
 Access names for tasks provided by ProjectManager. More...
enum  ExecStyle { ExecNormal = 0, ExecSilent = 1 }
 Defines the execution mode of the project manager. More...
enum  ModifiedProjectsHandlingPolicy { PromptUser = 0, AutoSave = 1 }
 The possible ways to handle unsaved open projects when the application closes. More...
- Public Types inherited from Qtilities::Core::Interfaces::IModificationNotifier
enum  NotificationTarget { NotifyNone = 0, NotifyListeners = 1, NotifySubjects = 2 }
 The targets which should be notified when the state of the object implementing this interface changes. More...

Public Slots

void clearRecentProjects ()
 Clears the list of recent projects.
QStringList removeNonExistingRecentProjects ()
 Removes all recent project paths which does not exist and return the files that were removed.

Signals

void currentProjectChanged (IProject *project)
 A signal which is emitted when the active project changed.
void customProjectPathsChanged ()
 Signal which is emitted whenever the custom project paths are changed.
void modificationStateChanged (bool is_modified) const
 Implement this function as a signal when implementing the object.
void projectClosingFinished (bool success)
 A signal which is emitted when a project closing process completes.
void projectClosingStarted (const QString &project_file)
 A signal which is emitted when a project closing process starts.
void projectCreationFinished ()
 A signal which is emitted when a project loading/opening process completes.
void projectCreationStarted ()
 A signal which is emitted when a project loading/opening process starts.
void projectLoadingFinished (const QString &project_file, bool success)
 A signal which is emitted when a project loading/opening process completes.
void projectLoadingStarted (const QString &project_file)
 A signal which is emitted when a project loading/opening process starts.
void projectSaveRequestedWithoutOpenProject ()
 Signal which is emitted when a project save operation was requested while no project was open.
void projectSavingFinished (const QString &project_file, bool success)
 A signal which is emitted when a project save process completes.
void projectSavingStarted (const QString &project_file)
 A signal which is emitted when a project save process starts.
void recentProjectsChanged (const QStringList &names, const QStringList &paths)
 Signal which is emitted whenever the recent projects list changes.

Public Member Functions

QAction * actionCloseProject ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
QAction * actionNewProject ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
QAction * actionOpenProject ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
QAction * actionSaveAsProject ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
QAction * actionSaveProject ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
bool activeProjectBusy () const
 Gets if the active project is busy, thus it cannot be closed, saved etc.
IExportable::ExportModeFlags allowedProjectTypes () const
 Provides the allowed project types that can be used by the project manager to save projects.
QString allowedProjectTypesFilter () const
 Function which returns a string which can be used in file dialog as a filter with the current allowed project types.
bool checkModifiedOpenProjects () const
 Indicates if the project manager will check for modified open projects when the application exits.
void clearCustomProjectsPaths ()
 Clears all custom projects paths except for the Default one.
bool closeProject ()
 Close the current project.
QWidget * configWidget ()
 Returns a widget with project management options.
bool createNewProjectOnStartup () const
 Gets the configuration option to open the last project from the previous session on application startup.
IProjectcurrentProject () const
 Returns an interface to the current project.
QString currentProjectFileName () const
 Returns the file name of the current project.
QString currentProjectName () const
 Returns the name of the current project.
QStringList customProjectCategories () const
 Returns a list of all registered project categories.
QString customProjectsPath (QString projects_category=QString()) const
 Returns the custom projects path.
QString defaultCustomProjectsCategory () const
 Gets the default project paths category.
IExportable::ExportMode defaultProjectType () const
 The default project type.
ExecStyle executionStyle () const
 Gets the execution style of the project manager.
void finalize ()
 Function which finalizes the project manager on application exit.
void initialize ()
 Function which initializes the project manager on application startup.
bool isAllowedFileName (const QString &file_name) const
 Function which checks if a file name's suffix is one of the allowed project types' suffices.
bool isModified () const
 Indicates the modification state of the object.
void markProjectAsChangedDuringLoad (bool changed=true)
 Sets that changes happened during the loading of the project. When loading is complete this information can be used by project item wrappers.
ModifiedProjectsHandlingPolicy modifiedProjectsHandlingPolicy () const
 Indicates how the project manager will handle modified open projects when set to check for them.
bool newProject ()
 Creates a new project.
QObject * objectBase ()
 Returns the QObject* base of the interface.
const QObject * objectBase () const
 Returns a const QObject* base of the interface.
bool openLastProjectOnStartup () const
 Gets the configuration option to open the last project from the previous session on application startup.
bool openProject (const QString &file_name)
 Open a project.
bool projectChangedDuringLoad ()
 Gets if changes happened during the loading of the project. When loading is complete this information can be used by project item wrappers.
QString projectMenuItemsBeforeCommand () const
 Gets the command before which the project menus must be placed in the menu specified by projectMenuItemsTargetMenu().
QString projectMenuItemsTargetMenu () const
 Gets the target menu where project menu items should be placed.
bool projectSavingEnabled () const
 Gets if project saving is enabled.
QString projectSavingInfoMessage () const
 Gets the info message about why project saving was disabled (if so).
IExportable::ExportMode projectTypeFromTypeFilter (const QString &project_type_filter_string) const
 Gets the project type from a project types filter string provided by allowedProjectTypesFilter().
QString projectTypeSuffix (IExportable::ExportMode project_type)
 Get the suffix used for a specific project type.
void readSettings ()
 Loads the project manager settings using QSettings.
QStringList recentProjectNames () const
 Returns a list of recent project names.
QString recentProjectPath (const QString &recent_project_name) const
 Returns the file for a recent project.
QStringList recentProjectPaths () const
 Returns a list of recent project paths.
ActionContainerrecentProjectsMenuContainer ()
 Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.
void refreshPartList ()
 Refreshes the project part list by scanning the global object pool.
QStringList registeredProjectItemNames () const
 Returns a list of recent project paths.
void removeCustomProjectsPath (QString projects_category)
 Removes the custom projects path specified by the given category.
void removeRecentProject (const QString &path)
 Removes a recent project path from the list of recent projects.
bool saveProject (QString file_name=QString(), bool respect_project_busy=true)
 Save the current project to the specified file.
void setActiveProjectBusy (bool is_busy)
 Sets if the current open project is busy, thus it cannot be closed, saved etc.
void setAllowedProjectTypes (IExportable::ExportModeFlags project_types)
 Sets the allowed project types that can be used by the project manager to save projects.
void setCheckModifiedOpenProjects (bool toggle)
 Toggles if the project manager will check for modified open projects when the application exists.
void setCreateNewProjectOnStartup (bool toggle)
 Sets the configuration option to create a new project when the no last open project is available.
void setCustomProjectsPath (const QString &projects_path, QString projects_category=QString())
 Sets a custom projects path to use for saving projects.
void setDefaultCustomProjectsCategory (const QString &projects_category)
 Sets the default project paths category.
void setDefaultProjectType (IExportable::ExportMode default_project_type)
 Sets default project type.
void setExecutionStyle (ExecStyle exec_style)
 Sets the execution style of the project manager.
void setModifiedProjectsHandlingPolicy (ModifiedProjectsHandlingPolicy handling_policy)
 Sets how the project manager should handle modified open projects when set to check for them.
void setOpenLastProjectOnStartup (bool toggle)
 Sets the configuration option to open the last project from the previous session on application startup.
void setProjectItemList (QList< IProjectItem * > item_list)
 Set project item list.
void setProjectMenuItemsBeforeCommand (const QString &command_id)
 Sets the command before which the project menus must be placed in the menu specified by projectMenuItemsTargetMenu().
void setProjectMenuItemsTargetMenu (const QString &menu_id)
 Sets the target menu where project menu items should be placed.
void setProjectTypeSuffix (IExportable::ExportMode project_type, const QString &suffix)
 Set the suffix used for a specific project type.
void setUseCustomProjectsPath (bool toggle)
 Toggles if a custom projects path is used.
void setUseProjectFileLocks (bool toggle)
 Sets if project file locking is enabled.
QString taskNameToString (ContainedTasks task_name) const
 ContainedTasks to string conversion function.
void toggleProjectSaving (bool is_enabled, const QString &info_message=QString())
 Disables/enables the ability to save projects.
bool useCustomProjectsPath () const
 Indicates if a custom projects path is used.
bool useProjectFileLocks () const
 Gets if project file locking is enabled.
void writeSettings () const
 Saves the project manager settings using QSettings.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IModificationNotifier
virtual void setModificationState (bool new_state, NotificationTargets notification_targets=NotifyListeners, bool force_notifications=false)=0
 Sets the modification state of the object. Returns true if it was successfull.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.
- Public Member Functions inherited from Qtilities::Core::Interfaces::ITaskContainer
void disableTask (int task_id)
 Disables the creation and registering in the global object pool of a task object to monitor the progress of the task.
void enableTask (int task_id)
 Enables the creation and registering in the global object pool of a task object to monitor the progress of the task.
int findTaskID (const QString &task_name) const
 Returns the task ID for the task specified by the given task_name.
bool isTaskActive (int task_id) const
 Checks if a specific task is active.
bool isTaskGlobal (int task_id) const
 Checks if a specific task is global or local. See Qtilities::Core::Interfaces::ITask::TaskType.
void setTaskGlobal (int task_id)
 Sets a task a global. See Qtilities::Core::Interfaces::ITask::TaskType.
void setTaskLocal (int task_id)
 Sets a task a local. See Qtilities::Core::Interfaces::ITask::TaskType.
ITasktask (int task_id) const
 Returns the task specified by the given task_id.
QList< ITask * > tasks () const
 A list of tasks provided by the object.

Additional Inherited Members

- Protected Member Functions inherited from Qtilities::Core::Interfaces::ITaskContainer
TaskfindTask (const QString &task_name) const
 Returns the Task object specified by the given task_name.
void registerTask (Task *task, const QString &task_name)
 Registers a task in this container.

Detailed Description

The ProjectManager class.

The ProjectManager class is a singleton which provides access to the project manager instance. The project manager can manage one "current" project at any time.

For more information see the Working with projects (creating, saving and loading) section of the Project Management article.


Member Enumeration Documentation

Access names for tasks provided by ProjectManager.

Enumerator:
TaskSaveProject 

Save project task with progress information for saveProject(). Enabled by default.

TaskOpenProject 

Open project task with progress information for openProject(). Enabled by deafult.

TaskCloseProject 

Close project task with progress information for closeProject(). Enabled by deafult.

Defines the execution mode of the project manager.

Enumerator:
ExecNormal 

Normal operation, prompt user when feedback or input action is required.

ExecSilent 

Silent, do not prompt user when feedback or input action is required. Operate on defaults and if no defaults exists, fails.

The possible ways to handle unsaved open projects when the application closes.

See also:
checkModifiedOpenProjects()
Enumerator:
PromptUser 

All observer operations are available to the user (Attachment, Detachement etc.).

AutoSave 

The observer is read only to the user.


Member Function Documentation

QAction * ProjectManagement::ProjectManager::actionCloseProject ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This action is registered in the action manager under the following id: Qtilities::CoreGui::Constants::Actions::qti_action_PROJECTS_CLOSE.

This function was added in Qtilities v1.3.

QAction * ProjectManagement::ProjectManager::actionNewProject ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This action is registered in the action manager under the following id: Qtilities::CoreGui::Constants::Actions::qti_action_PROJECTS_NEW.

This function was added in Qtilities v1.3.

QAction * ProjectManagement::ProjectManager::actionOpenProject ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This action is registered in the action manager under the following id: Qtilities::CoreGui::Constants::Actions::qti_action_PROJECTS_OPEN.

This function was added in Qtilities v1.3.

QAction * ProjectManagement::ProjectManager::actionSaveAsProject ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This action is registered in the action manager under the following id: Qtilities::CoreGui::Constants::Actions::qti_action_PROJECTS_SAVE_AS.

This function was added in Qtilities v1.3.

QAction * ProjectManagement::ProjectManager::actionSaveProject ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This action is registered in the action manager under the following id: Qtilities::CoreGui::Constants::Actions::qti_action_PROJECTS_SAVE.

This function was added in Qtilities v1.3.

Qtilities::Core::Interfaces::IExportable::ExportModeFlags Qtilities::ProjectManagement::ProjectManager::allowedProjectTypes ( ) const

Provides the allowed project types that can be used by the project manager to save projects.

When prompting to save projects, the allowed project types will be used as the possible file types that the user see. You can define the suffix used for a specific project type in your application using setProjectTypeSuffix().

By default all available project types are allowed.

See also:
setAllowedProjectTypes()
QString Qtilities::ProjectManagement::ProjectManager::allowedProjectTypesFilter ( ) const

Function which returns a string which can be used in file dialog as a filter with the current allowed project types.

See also:
allowedProjectTypes(), projectTypeFromTypeFilter()
bool Qtilities::ProjectManagement::ProjectManager::closeProject ( )

Close the current project.

If the current project is modified when calling this function, the saveProject() function will be called before closing the current project.

This function deletes the current project instance. Thus always use a QPointer when storing a reference to an active project returned by currentProject().

void Qtilities::ProjectManagement::ProjectManager::currentProjectChanged ( IProject project)
signal

A signal which is emitted when the active project changed.

This function was added in Qtilities v1.3.

QStringList ProjectManagement::ProjectManager::customProjectCategories ( ) const

Returns a list of all registered project categories.

This function was added in Qtilities v1.1.

void Qtilities::ProjectManagement::ProjectManager::customProjectPathsChanged ( )
signal

Signal which is emitted whenever the custom project paths are changed.

This function signal was added in Qtilities v1.1.

QString ProjectManagement::ProjectManager::defaultCustomProjectsCategory ( ) const

Gets the default project paths category.

This function was added in Qtilities v1.1.

Qtilities::Core::Interfaces::IExportable::ExportMode Qtilities::ProjectManagement::ProjectManager::defaultProjectType ( ) const

The default project type.

This default project type is used when the user saves a project without specifying a project file extension.

See also:
setDefaultProjectType()
ProjectManagement::ProjectManager::ExecStyle ProjectManagement::ProjectManager::executionStyle ( ) const

Gets the execution style of the project manager.

Default is ExecNormal.

This function was added in Qtilities v1.1.

void Qtilities::ProjectManagement::ProjectManager::finalize ( )

Function which finalizes the project manager on application exit.

This function will save modified open projects if needed.

See also:
PROJECT_MANAGER_FINALIZE
void Qtilities::ProjectManagement::ProjectManager::initialize ( )

Function which initializes the project manager on application startup.

The initialize function check the openLastProjectOnStartup() and createNewProjectOnStartup() settings and load or create the needed project on startup.

See also:
PROJECT_MANAGER_INITIALIZE
void Qtilities::ProjectManagement::ProjectManager::markProjectAsChangedDuringLoad ( bool  changed = true)

Sets that changes happened during the loading of the project. When loading is complete this information can be used by project item wrappers.

Note:
The project manager will reset this mark immediately after the projectLoadingFinished() signal was emitted.
See also:
projectChangedDuringLoad()
void Qtilities::ProjectManagement::ProjectManager::modificationStateChanged ( bool  is_modified) const
virtualsignal

Implement this function as a signal when implementing the object.

Because this interface does not use the Q_OBJECT macro, you cannot connect to this signal directly. Instead you need to connect to the signal on the base object implementing this interface as follows:

connect(iface->objectBase(),SIGNAL(modificationStateChanged(bool)),SLOT(yourSlot(bool)));

Implements Qtilities::Core::Interfaces::IModificationNotifier.

Qtilities::ProjectManagement::ProjectManager::ModifiedProjectsHandlingPolicy Qtilities::ProjectManagement::ProjectManager::modifiedProjectsHandlingPolicy ( ) const

Indicates how the project manager will handle modified open projects when set to check for them.

See also:
checkModifiedOpenProjects(), setCheckModifiedOpenProjects()
bool Qtilities::ProjectManagement::ProjectManager::newProject ( )

Creates a new project.

If no project is open when this function is called a new project will be created which does not have a project file associated with it. When the new project is saved, it will automatically prompt for a file to which the project must be saved.

Alternatively if a project is already open when this function is called, the function will call closeProject() on the current project and then create a new project as if no project was opened.

const QObject* Qtilities::ProjectManagement::ProjectManager::objectBase ( ) const
inlinevirtual

Returns a const QObject* base of the interface.

This function can be used in const methods, but make sure that you don't modify things that should stay const. An example where this is used is when we want to get a property on an object in a const method. This is a const operation.

Implements Qtilities::Core::Interfaces::IObjectBase.

bool Qtilities::ProjectManagement::ProjectManager::openProject ( const QString &  file_name)

Open a project.

If no project is open when this function is called, the specified project will be opened. If the specified file name does not exist, this function does nothing.

Alternatively if a project is already open when this function is called, the function will call closeProject() on the current project and then open the new project as if no project was opened.

If the current project file passed as file_name this function does nothing.

bool Qtilities::ProjectManagement::ProjectManager::projectChangedDuringLoad ( )

Gets if changes happened during the loading of the project. When loading is complete this information can be used by project item wrappers.

See also:
markProjectAsChangedDuringLoad()
void Qtilities::ProjectManagement::ProjectManager::projectClosingFinished ( bool  success)
signal

A signal which is emitted when a project closing process completes.

Parameters:
project_fileThe project file from which loading was done.
successIf the project was successfully closed, success will be true. False otherwise.
void Qtilities::ProjectManagement::ProjectManager::projectClosingStarted ( const QString &  project_file)
signal

A signal which is emitted when a project closing process starts.

Parameters:
project_fileThe current project file which is being closed.
void Qtilities::ProjectManagement::ProjectManager::projectCreationFinished ( )
signal

A signal which is emitted when a project loading/opening process completes.

This function was added in Qtilities v1.3.

void Qtilities::ProjectManagement::ProjectManager::projectCreationStarted ( )
signal

A signal which is emitted when a project loading/opening process starts.

This function was added in Qtilities v1.3.

void Qtilities::ProjectManagement::ProjectManager::projectLoadingFinished ( const QString &  project_file,
bool  success 
)
signal

A signal which is emitted when a project loading/opening process completes.

Parameters:
project_fileThe project file from which loading was done.
successIf the project was successfully loaded, success will be true. False otherwise.
void Qtilities::ProjectManagement::ProjectManager::projectLoadingStarted ( const QString &  project_file)
signal

A signal which is emitted when a project loading/opening process starts.

Parameters:
project_fileThe project file from which loading is done.
QString ProjectManagement::ProjectManager::projectMenuItemsBeforeCommand ( ) const

Gets the command before which the project menus must be placed in the menu specified by projectMenuItemsTargetMenu().

This function was added in Qtilities v1.2.

QString ProjectManagement::ProjectManager::projectMenuItemsTargetMenu ( ) const

Gets the target menu where project menu items should be placed.

This function was added in Qtilities v1.2.

void Qtilities::ProjectManagement::ProjectManager::projectSaveRequestedWithoutOpenProject ( )
signal

Signal which is emitted when a project save operation was requested while no project was open.

This function signal was added in Qtilities v1.2.

bool ProjectManagement::ProjectManager::projectSavingEnabled ( ) const

Gets if project saving is enabled.

This function was added in Qtilities v1.1.

void Qtilities::ProjectManagement::ProjectManager::projectSavingFinished ( const QString &  project_file,
bool  success 
)
signal

A signal which is emitted when a project save process completes.

Parameters:
project_fileThe project file to which the project is saved.
successIf the project was successfully saved, success will be true. False otherwise.
QString ProjectManagement::ProjectManager::projectSavingInfoMessage ( ) const

Gets the info message about why project saving was disabled (if so).

This function was added in Qtilities v1.1.

void Qtilities::ProjectManagement::ProjectManager::projectSavingStarted ( const QString &  project_file)
signal

A signal which is emitted when a project save process starts.

Parameters:
project_fileThe project file to which the project is saved.
IExportable::ExportMode ProjectManagement::ProjectManager::projectTypeFromTypeFilter ( const QString &  project_type_filter_string) const

Gets the project type from a project types filter string provided by allowedProjectTypesFilter().

See also:
allowedProjectTypesFilter(), allowedProjectTypes()

This function was added in Qtilities v1.2.

QString Qtilities::ProjectManagement::ProjectManager::projectTypeSuffix ( IExportable::ExportMode  project_type)

Get the suffix used for a specific project type.

The file naming conventions used by default are defined by the following constants:

  • Binary: qti_def_SUFFIX_PROJECT_BINARY
  • XML: qti_def_SUFFIX_PROJECT_XML
See also:
setProjectTypeSuffix()
void Qtilities::ProjectManagement::ProjectManager::readSettings ( )

Loads the project manager settings using QSettings.

For more information about the saving of settings by Qtilities classes, see Configuration settings storage in Qtilities.

void Qtilities::ProjectManagement::ProjectManager::recentProjectsChanged ( const QStringList &  names,
const QStringList &  paths 
)
signal

Signal which is emitted whenever the recent projects list changes.

This function was added in Qtilities v1.1.

ActionContainer * ProjectManagement::ProjectManager::recentProjectsMenuContainer ( )

Convenience function which returns an action which can be placed in a menu to allow switching back to the previous mode.

This function was added in Qtilities v1.3.

QStringList ProjectManagement::ProjectManager::removeNonExistingRecentProjects ( )
slot

Removes all recent project paths which does not exist and return the files that were removed.

This function was added in Qtilities v1.1.

void ProjectManagement::ProjectManager::removeRecentProject ( const QString &  path)

Removes a recent project path from the list of recent projects.

This function was added in Qtilities v1.1.

bool Qtilities::ProjectManagement::ProjectManager::saveProject ( QString  file_name = QString(),
bool  respect_project_busy = true 
)

Save the current project to the specified file.

Parameters:
file_nameWhen empty the current open project will be saved to its current file. If there is not current project this function will do nothing. If there is a current project which has not been saved yet this function will also do nothing.
respect_project_busyWhen true the project won't save when its busy. It is however to ignore that the project is busy and still save it by settings this parameter to false.
void Qtilities::ProjectManagement::ProjectManager::setActiveProjectBusy ( bool  is_busy)

Sets if the current open project is busy, thus it cannot be closed, saved etc.

This function uses a stacked approach, thus your setActiveProjectBusy(false) calls must match the number of setActiveProjectBusy(true) calls.

For more information on this type of stacked approach, see Qtilities::Core::Observer::startProcessingCycle().

When settings a project as busy, the application will automatically be set as busy as well. For more information see Qtilities::Core::QtilitiesCoreApplication::setApplicationBusy().

void Qtilities::ProjectManagement::ProjectManager::setAllowedProjectTypes ( IExportable::ExportModeFlags  project_types)

Sets the allowed project types that can be used by the project manager to save projects.

This functionality is usefull if you want to force the users of your application to use a specific format.

Note:
Make sure to call this function before creating your ProjectManagementConfig page. If you are using the Qtilities Project Management plugin, make sure you call this function before loading your plugins.
See also:
allowedProjectTypes()
void Qtilities::ProjectManagement::ProjectManager::setCreateNewProjectOnStartup ( bool  toggle)

Sets the configuration option to create a new project when the no last open project is available.

This configuration setting has no effect if the openLastProjectOnStartup() is false.

See also:
void Qtilities::ProjectManagement::ProjectManager::setCustomProjectsPath ( const QString &  projects_path,
QString  projects_category = QString() 
)

Sets a custom projects path to use for saving projects.

Parameters:
projects_pathThe path for projects of type category.
projects_categoryThe category to associated with the given path.
Note:
When the directory does not exist, this function will create it for you.
void ProjectManagement::ProjectManager::setDefaultCustomProjectsCategory ( const QString &  projects_category)

Sets the default project paths category.

This function was added in Qtilities v1.1.

void Qtilities::ProjectManagement::ProjectManager::setDefaultProjectType ( IExportable::ExportMode  default_project_type)

Sets default project type.

If default_project_type is not an allowed type, this function does nothing.

See also:
defaultProjectType(), allowedProjectTypes()
void ProjectManagement::ProjectManager::setExecutionStyle ( ExecStyle  exec_style)

Sets the execution style of the project manager.

Default is ExecNormal.

This function was added in Qtilities v1.1.

void ProjectManagement::ProjectManager::setProjectMenuItemsBeforeCommand ( const QString &  command_id)

Sets the command before which the project menus must be placed in the menu specified by projectMenuItemsTargetMenu().

These menu items are not added automatically by the project manager. Its done through the ProjectManagementPlugin. Alternatively they can be added manually using the access functions on ProjectManager.

See also:
actionNewProject(), actionCloseProject(), actionOpenProject(), actionSaveAsProject(), actionSaveProject(), recentProjectsMenuContainer()

The default menu is Qtilities::CoreGui::Actions::qti_action_FILE_SETTINGS.

See also:
setProjectMenuItemsTargetMenu()

This function was added in Qtilities v1.2.

void ProjectManagement::ProjectManager::setProjectMenuItemsTargetMenu ( const QString &  menu_id)

Sets the target menu where project menu items should be placed.

These menu items are not added automatically by the project manager. Its done through the ProjectManagementPlugin. Alternatively they can be added manually using the access functions on ProjectManager.

See also:
actionNewProject(), actionCloseProject(), actionOpenProject(), actionSaveAsProject(), actionSaveProject(), recentProjectsMenuContainer()

The default menu is Qtilities::CoreGui::Actions::qti_action_FILE.

See also:
setProjectMenuItemsBeforeCommand()

This function was added in Qtilities v1.2.

void Qtilities::ProjectManagement::ProjectManager::setProjectTypeSuffix ( IExportable::ExportMode  project_type,
const QString &  suffix 
)

Set the suffix used for a specific project type.

Parameters:
project_typeThe project type set the suffix for.
suffixThe suffix to use, for example "prj"
See also:
projectTypeSuffix()
void ProjectManagement::ProjectManager::setUseProjectFileLocks ( bool  toggle)

Sets if project file locking is enabled.

This function was added in Qtilities v1.2.

See also:
useProjectFileLocks()
void ProjectManagement::ProjectManager::toggleProjectSaving ( bool  is_enabled,
const QString &  info_message = QString() 
)

Disables/enables the ability to save projects.

Saving of projects are disabled by default.

This function was added in Qtilities v1.1.

bool ProjectManagement::ProjectManager::useProjectFileLocks ( ) const

Gets if project file locking is enabled.

*Default is true.

This function was added in Qtilities v1.2.

See also:
setUseProjectFileLocks()
void Qtilities::ProjectManagement::ProjectManager::writeSettings ( ) const

Saves the project manager settings using QSettings.

For more information about the saving of settings by Qtilities classes, see Configuration settings storage in Qtilities.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé