Olive
oliveglobal.h
1 #ifndef OLIVEGLOBAL_H
2 #define OLIVEGLOBAL_H
3 
4 #include "project/undo.h"
5 
6 #include <QTimer>
7 #include <QFile>
8 
14 class OliveGlobal : public QObject {
15  Q_OBJECT
16 public:
22  OliveGlobal();
23 
29  const QString& get_project_file_filter();
30 
44  void update_project_filename(const QString& s);
45 
54 
71  void set_rendering_state(bool rendering);
72 
83  void load_project_on_launch(const QString& s);
84 
90 
91 public slots:
95  void undo();
96 
100  void redo();
101 
109  void paste();
110 
119  void paste_insert();
120 
127  void new_project();
128 
135  void open_project();
136 
146  void open_recent(int index);
147 
158  bool save_project_as();
159 
170  bool save_project();
171 
184  bool can_close_project();
185 
189  void open_export_dialog();
190 
194  void open_about_dialog();
195 
199  void open_debug_log();
200 
204  void open_speed_dialog();
205 
209  void open_action_search();
210 
216  void clear_undo_stack();
217 
224  void finished_initialize();
225 
232  void save_autorecovery_file();
233 
237  void open_preferences();
238 
239 private:
256  void open_project_worker(const QString& fn, bool autorecovery);
257 
262 
267 
272 
273 
274 private slots:
275 
276 };
277 
278 namespace Olive {
282  extern QSharedPointer<OliveGlobal> Global;
283 
290  extern QString ActiveProjectFilename;
291 
295  extern QString AppName;
296 }
297 
298 #endif // OLIVEGLOBAL_H
void open_debug_log()
Open the Debug Log window.
Definition: oliveglobal.cpp:259
bool save_project_as()
Shows a save file dialog and saves the project as the resulting filename.
Definition: oliveglobal.cpp:134
void check_for_autorecovery_file()
Check whether an auto-recovery file exists and ask the user if they want to load it.
Definition: oliveglobal.cpp:57
QTimer autorecovery_timer
Regular interval to save an auto-recovery project.
Definition: oliveglobal.h:266
void load_project_on_launch(const QString &s)
Set a project to load just after launching.
Definition: oliveglobal.cpp:83
void set_rendering_state(bool rendering)
Set the application state depending on if the user is exporting a video.
Definition: oliveglobal.cpp:74
void redo()
Redo user's last action.
Definition: oliveglobal.cpp:234
void save_autorecovery_file()
Save an auto-recovery file of the current project.
Definition: oliveglobal.cpp:204
void clear_undo_stack()
Clears the current undo stack.
Definition: oliveglobal.cpp:276
OliveGlobal()
OliveGlobal Constructor.
Definition: oliveglobal.cpp:30
void open_recent(int index)
Open recent project from list.
Definition: oliveglobal.cpp:118
void open_preferences()
Opens the Preferences dialog.
Definition: oliveglobal.cpp:211
void finished_initialize()
Function called when Olive has finished starting up.
Definition: oliveglobal.cpp:189
void paste_insert()
Paste contents of clipboard, making space for it when possible.
Definition: oliveglobal.cpp:248
QString get_recent_project_list_file()
Retrieves the URL of the config file containing the autorecovery projects.
Definition: oliveglobal.cpp:88
void open_action_search()
Open the Action Search overlay.
Definition: oliveglobal.cpp:280
void open_project()
Open a project from file.
Definition: oliveglobal.cpp:111
const QString & get_project_file_filter()
Returns the file dialog filter used when interfacing with Olive project files.
Definition: oliveglobal.cpp:45
void paste()
Paste contents of clipboard.
Definition: oliveglobal.cpp:242
bool can_close_project()
Determine whether the current project can be closed.
Definition: oliveglobal.cpp:156
void update_project_filename(const QString &s)
Change the current active project filename.
Definition: oliveglobal.cpp:49
bool save_project()
Saves the current project to file.
Definition: oliveglobal.cpp:147
bool enable_load_project_on_init
Internal variable set to TRUE by main() if a project file was set as an argument.
Definition: oliveglobal.h:271
The Olive Global class.
Definition: oliveglobal.h:14
void open_export_dialog()
Open the Export dialog to trigger an export of the current sequence.
Definition: oliveglobal.cpp:177
void open_project_worker(const QString &fn, bool autorecovery)
Internal function to handle loading a project from file.
Definition: oliveglobal.cpp:220
void open_speed_dialog()
Open the Speed/Duration dialog.
Definition: oliveglobal.cpp:263
void new_project()
Create new project.
Definition: oliveglobal.cpp:92
QString project_file_filter
File filter used for any file dialogs relating to Olive project files.
Definition: oliveglobal.h:261
void undo()
Undo user's last action.
Definition: oliveglobal.cpp:226
void open_about_dialog()
Open the About Olive dialog.
Definition: oliveglobal.cpp:254