00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CD_WRITING_DIALOG_H
00023 #define CD_WRITING_DIALOG_H
00024
00025 #include "ui_CDWritingDialog.h"
00026
00027 #include <QDialog>
00028 #include <QCloseEvent>
00029 #include <QProcess>
00030
00031 class Project;
00032 class Sheet;
00033 struct ExportSpecification;
00034 class QProcess;
00035
00036 class CDWritingDialog : public QDialog, protected Ui::CDWritingDialog
00037 {
00038 Q_OBJECT
00039
00040 public:
00041 CDWritingDialog(QWidget* parent = 0);
00042 ~CDWritingDialog();
00043
00044 void set_was_closed();
00045
00046 protected:
00047 void closeEvent(QCloseEvent* event);
00048
00049 private:
00050 Project* m_project;
00051 QProcess* m_burnprocess;
00052 ExportSpecification* m_exportSpec;
00053
00054 void show_progress_view();
00055
00056 bool is_safe_to_export();
00057 void cd_render();
00058 void write_to_cd();
00059 void disable_ui_interaction();
00060 void enable_ui_interaction();
00061
00062 void update_cdburn_status(const QString& message, int type);
00063 void unlock_device();
00064
00065 enum {
00066 NO_STATE,
00067 RENDER,
00068 BURNING,
00069 ABORT_BURN,
00070 QUERY_DEVICE,
00071 UNLOCK_DEVICE,
00072 NORMAL_MESSAGE,
00073 ERROR_MESSAGE
00074 };
00075
00076 int m_writingState;
00077 int m_lastSheetExported;
00078 bool m_wasClosed;
00079 bool m_wodimAvailable;
00080 int m_copyNumber;
00081 QString get_device(int index);
00082
00083 private slots:
00084 void set_project(Project* project);
00085 void on_stopButton_clicked();
00086 void export_only_changed(int state);
00087 void start_burn_process();
00088 void stop_burn_process();
00089 void read_standard_output();
00090 void cdrdao_process_started();
00091 void cdrdao_process_finished(int exitcode, QProcess::ExitStatus exitstatus);
00092 void cd_export_finished();
00093 void cd_export_progress(int progress);
00094 void query_devices();
00095
00096 void reject();
00097 };
00098
00099 #endif
00100
00101
00102
00103