[Goodies-commits] r5095 - in xfburn/tags: . xfburn-0.3.2 xfburn-0.3.2/xfburn
David Mohr
squisher at xfce.org
Tue Jul 15 17:05:01 CEST 2008
Author: squisher
Date: 2008-07-15 15:05:01 +0000 (Tue, 15 Jul 2008)
New Revision: 5095
Added:
xfburn/tags/xfburn-0.3.2/
xfburn/tags/xfburn-0.3.2/ChangeLog
xfburn/tags/xfburn-0.3.2/NEWS
xfburn/tags/xfburn-0.3.2/README
xfburn/tags/xfburn-0.3.2/xfburn/
xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h
Removed:
xfburn/tags/xfburn-0.3.2/ChangeLog
xfburn/tags/xfburn-0.3.2/NEWS
xfburn/tags/xfburn-0.3.2/README
xfburn/tags/xfburn-0.3.2/xfburn/
xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c
xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h
Log:
tag for 0.3.2
Copied: xfburn/tags/xfburn-0.3.2 (from rev 5093, xfburn/trunk)
Deleted: xfburn/tags/xfburn-0.3.2/ChangeLog
Copied: xfburn/tags/xfburn-0.3.2/ChangeLog (from rev 5094, xfburn/trunk/ChangeLog)
===================================================================
--- xfburn/tags/xfburn-0.3.2/ChangeLog (rev 0)
+++ xfburn/tags/xfburn-0.3.2/ChangeLog 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,2543 @@
+2008-07-15 maximilian
+
+ * po/ChangeLog, po/pt_PT.po:
+ Xfburn European Portuguese translation update (pt_PT)
+
+2008-07-15 alnokta
+
+ * po/ar.po:
+ Update Arabic translations
+
+2008-07-15 majkl
+
+ * po/cs.po:
+ Updated Czech translations
+
+2008-07-15 maximilian
+
+ * po/ChangeLog:
+ Translations updated for the xfburn package (fr;nb_NO)
+ * po/fr.po, po/nb_NO.po:
+ Translations updated for the xfburn package (fr;nb_NO)
+
+2008-07-14 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translation.
+
+2008-07-14 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ xfburn translation update.
+
+2008-07-14 David Mohr <david at mcbf.net>
+
+ * po/ChangeLog, po/uk.po:
+ Ukrainian translation update by Dmitry Nikitin
+
+2008-07-14 omaciel
+
+ * po/ChangeLog, po/pt_BR.po:
+ Updated Brazilian Portuguese translation
+
+2008-07-14 David Mohr <david at mcbf.net>
+
+ * po/ChangeLog, po/ar.po, po/ca.po, po/cs.po, po/de.po, po/dz.po,
+ po/el.po, po/en_GB.po, po/es.po, po/eu.po, po/fi.po, po/fr.po,
+ po/gl.po, po/he.po, po/hu.po, po/it.po, po/ja.po, po/ko.po,
+ po/lt.po, po/lv.po, po/nb_NO.po, po/nl.po, po/pa.po, po/pl.po,
+ po/pt_BR.po, po/pt_PT.po, po/ru.po, po/sq.po, po/sv.po, po/uk.po,
+ po/ur.po, po/xfburn.pot, po/zh_CN.po, po/zh_TW.po,
+ xfburn/xfburn-blank-dialog.c:
+ Updating some strings according to suggestion from Og Maciel
+ * NEWS:
+ Updating NEWS
+ * po/ChangeLog, po/ar.po, po/ca.po, po/cs.po, po/de.po, po/dz.po,
+ po/el.po, po/en_GB.po, po/es.po, po/eu.po, po/fi.po, po/fr.po,
+ po/gl.po, po/he.po, po/hu.po, po/it.po, po/ja.po, po/ko.po,
+ po/lt.po, po/lv.po, po/nb_NO.po, po/nl.po, po/pa.po, po/pl.po,
+ po/pt_BR.po, po/pt_PT.po, po/ru.po, po/sq.po, po/sv.po, po/uk.po,
+ po/ur.po, po/xfburn.pot, po/zh_CN.po, po/zh_TW.po,
+ xfburn/xfburn-main-window.c:
+ Updating all po/pot files, de translation update
+
+2008-07-14 maximilian
+
+ * po/ChangeLog, po/fr.po:
+ Translation updated for the xfburn package (fr)
+
+2008-07-14 Mario Đanić <mario at libburnia-project.org>
+
+ * CONTRIBUTORS, xfburn/xfburn-blank-dialog.c:
+ Made blanking modes translatable
+
+2008-07-14 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translation.
+
+2008-07-14 maximilian
+
+ * po/ChangeLog, po/pt_PT.po:
+ Translations added and updated for most goodies (gl;pt_PT;zh_CN)
+
+2008-07-14 mvd
+
+ * po/uk.po:
+ Maxim Dziumanenko <dziumanenko at gmail.com>
+
+ * Update Ukrainian translatioon
+
+2008-07-13 David Mohr <david at mcbf.net>
+
+ * po/ChangeLog, xfburn/xfburn-main-window.c:
+ Fixing spelling mistake in translator's name
+ * po/zh_CN.po, xfburn/xfburn-main-window.c:
+ Adding simplified chinese translation update
+
+2008-07-13 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ xfburn Greek translation update
+
+2008-07-12 sas
+
+ * po/hu.po:
+ [intl:hu] screenshooter updated
+
+2008-07-12 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-main-window.c:
+ Fixing translator's email address
+
+2008-07-12 omaciel
+
+ * po/pt_BR.po:
+ Minor tweaks to Brazilian Portuguese translation
+ * po/ChangeLog, po/pt_BR.po:
+ Updated Brazilian Portuguese translation
+
+2008-07-12 majkl
+
+ * po/ar.po, po/ca.po, po/cs.po, po/de.po, po/dz.po, po/el.po,
+ po/en_GB.po, po/es.po, po/eu.po, po/fi.po, po/fr.po, po/gl.po,
+ po/he.po, po/hu.po, po/it.po, po/ja.po, po/ko.po, po/lt.po,
+ po/lv.po, po/nb_NO.po, po/nl.po, po/pa.po, po/pl.po, po/pt_BR.po,
+ po/pt_PT.po, po/ru.po, po/sq.po, po/sv.po, po/uk.po, po/ur.po,
+ po/xfburn.pot, po/zh_CN.po, po/zh_TW.po:
+ Updated POT and PO files: New string "Welcome to xfburn!" added.
+ Czech translation file updated
+
+2008-07-12 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-main-window.c:
+ Updating translators credit
+ * TODO, xfburn/Makefile.am, xfburn/xfburn-blank-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main.c,
+ xfburn/xfburn-main.h, xfburn/xfburn-progress-dialog.c:
+ Bugfixes: don't exit program if main window is not shown, don't
+ check for disc validity before drive status has been refreshed
+
+2008-07-11 majkl
+
+ * po/cs.po:
+ Updated and fixed Czech translations
+
+2008-07-11 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-welcome-tab.c:
+ Adding missing translation
+ * NEWS, xfburn/xfburn-burn-image-dialog.c:
+ Also set burn speed when burning an image
+ * NEWS, xfburn/xfburn-device-box.c:
+ Fix bug which caused a wrong complaint about a missing speed list
+
+2008-07-11 sas
+
+ * po/hu.po:
+ [intl:hu] little fixes2
+
+2008-07-11 majkl
+
+ * po/cs.po:
+ Updated Czech translations
+
+2008-07-11 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translation.
+
+2008-07-11 omaciel
+
+ * po/ChangeLog, po/pt_BR.po:
+ Updated Brazilian Portuguese translation
+
+2008-07-10 piarres
+
+ * po/ChangeLog, po/eu.po:
+ Basque translation update (xfburn)
+
+2008-07-10 David Mohr <david at mcbf.net>
+
+ * ChangeLog:
+ Updating changelog
+ * README, po/ChangeLog, po/ar.po, po/ca.po, po/cs.po, po/de.po,
+ po/dz.po, po/el.po, po/en_GB.po, po/es.po, po/eu.po, po/fi.po,
+ po/fr.po, po/gl.po, po/he.po, po/hu.po, po/it.po, po/ja.po,
+ po/ko.po, po/lt.po, po/lv.po, po/nb_NO.po, po/nl.po, po/pa.po,
+ po/pl.po, po/pt_BR.po, po/pt_PT.po, po/ru.po, po/sq.po, po/sv.po,
+ po/uk.po, po/ur.po, po/xfburn.pot, po/zh_CN.po, po/zh_TW.po,
+ xfburn/xfburn-device-box.c:
+ Updating po files, german translation
+
+2008-07-09 David Mohr <david at mcbf.net>
+
+ * TODO, configure.in.in:
+ Updating version number
+ * NEWS, xfburn/xfburn-data-composition.c:
+ Bugfix: release memory for thread parameters, update README
+ * xfburn/xfburn-blank-dialog.c, xfburn/xfburn-blank-dialog.h,
+ xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-hal-manager.c, xfburn/xfburn-hal-manager.h,
+ xfburn/xfburn-utils.c, xfburn/xfburn-utils.h:
+ Give option to blank disc if burn dialog comes up and a full but
+ erasable disc is in the drive
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-burn-data-composition-base-dialog.h,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-hal-manager.c,
+ xfburn/xfburn-hal-manager.h, xfburn/xfburn-main.c:
+ Creating global instance of hal manager, prepared code for a
+ switching proceed button's funcitonality
+
+2008-07-09 mvd
+
+ * po/uk.po:
+ Maxim Dziumanenko <dziumanenko at gmail.com>
+
+ Updated Ukrainian translation
+
+2008-07-09 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-composition.c:
+ Bugfix for bugfix of rev. 5033
+
+2008-07-08 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-composition.c:
+ Small bugfix: correctly enter / exit gdk threads
+ * xfburn/xfburn-device-box.c:
+ Making maximum speed the default
+
+2008-07-07 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-composition.c, xfburn/xfburn-main.c:
+ Adding cli option to open the blank dialog
+ * NEWS, TODO, xfburn/xfburn-adding-progress.c,
+ xfburn/xfburn-adding-progress.h,
+ xfburn/xfburn-data-composition.c:
+ Using threads for adding files, adding can now get aborted
+
+2008-07-05 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-data-composition-base-dialog.c:
+ Also allow deep paths
+ * NEWS, TODO, xfburn/xfburn-burn-data-composition-base-dialog.c:
+ Changing iso_write_opts profile to preserve file attribute
+
+2008-06-28 David Mohr <david at mcbf.net>
+
+ * TODO:
+ Updating TODO file
+
+2008-06-26 maximilian
+
+ * po/ChangeLog, po/gl.po:
+ Translations added and updated for most goodies (gl)
+
+2008-06-25 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-hal-manager.c:
+ Additional hal error check
+
+2008-06-22 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-progress-dialog.c:
+ Small bugfixes: make sure min. buffer fill is within 0.0-1.0
+ range; update burn button sensitivity when changing devices
+
+2008-06-21 David Mohr <david at mcbf.net>
+
+ * NEWS:
+ Updating NEWS
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-global.h,
+ xfburn/xfburn-perform-burn.c, xfburn/xfburn-perform-burn.h,
+ xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h:
+ Adding fifo buffering
+
+2008-06-20 David Mohr <david at mcbf.net>
+
+ * NEWS:
+ Update NEWS
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c:
+ Implementing setting of burn speed.
+
+ WARNING: my dvd test burn failed if a speed was set!! CD was ok
+ though.
+
+ Use "Max" as speed if that is the case for you to get the old
+ behavior, and _please_ report this as a bug! Please include the
+ console output if debug is enabled, or otherwise some info on the
+ burner that was used.
+
+2008-06-19 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-perform-burn.c, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.h:
+ Adding min. buffer fill info after burn is done
+ * xfburn/xfburn-data-composition.c, xfburn/xfburn-main.c:
+ Implementing adding of files to a data composition from the
+ command line
+
+2008-06-18 Mario Đanić <mario at libburnia-project.org>
+
+ * NEWS:
+ Updated NEWS file for 0.3.1
+
+2008-06-17 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-composition.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h, xfburn/xfburn-main.c:
+ Adding cli option to start with data composition window, adding
+ of files not implemented yet
+
+2008-06-13 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c:
+ Bugfix: only show busy cursor when the dialog is already realized
+
+2008-06-09 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h, xfburn/xfburn-main.c:
+ Adding infrastructure for command line options, implement burn
+ image cli option
+
+2008-06-08 Mario Đanić <mario at libburnia-project.org>
+
+ * xfburn/xfburn-device-box.c:
+ Fixed compilation warnings with regards to xfburn_*_cursor
+
+2008-06-05 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-composition.c:
+ Make data composition columns resizeable, increase default sizes
+ of columns (workaround for bug #2151)
+ * xfburn/xfburn-device-box.c:
+ Busy cursor during device box refreshes
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.h:
+ Checking inserted disc type against capabilites of the drive
+ * TODO, xfburn/xfburn-data-composition.c:
+ Adding busy cursors when adding files
+ * xfburn/xfburn-utils.c:
+ Small bugfixes: make sure xfburn_humanreadable_filesize returns a
+ sane string
+ * xfburn/xfburn-device-list.c:
+ Adding additional output while scanning for drives
+
+2008-06-03 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-composition.c:
+ Applying patch from jeromeg to have clear reset the title (fixes
+ #4130)
+
+2008-06-02 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in:
+ post tag version bump
+ * README, configure.in.in:
+ get ready for tagging
+
+2008-06-01 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/pt_BR.po:
+ run make update-po
+
+2008-06-01 David Mohr <david at mcbf.net>
+
+ * po/POTFILES.in:
+ added another missing source file to POTFILES
+ * po/POTFILES.in, po/de.po:
+ Updating i18n files
+ * ChangeLog, NEWS, README, TODO:
+ Updating README and NEWS
+
+2008-05-30 omaciel
+
+ * po/ChangeLog, po/pt_BR.po:
+ Updated Brazilian Portuguese translation
+
+2008-05-30 David Mohr <david at mcbf.net>
+
+ * TODO, po/ar.po, po/ca.po, po/cs.po, po/de.po, po/dz.po, po/el.po,
+ po/en_GB.po, po/es.po, po/eu.po, po/fi.po, po/fr.po, po/gl.po,
+ po/he.po, po/hu.po, po/it.po, po/ja.po, po/ko.po, po/lt.po,
+ po/lv.po, po/nb_NO.po, po/nl.po, po/pa.po, po/pl.po, po/pt_BR.po,
+ po/pt_PT.po, po/ru.po, po/sq.po, po/sv.po, po/uk.po, po/ur.po,
+ po/xfburn.pot, po/zh_CN.po, po/zh_TW.po:
+ Updating msgstrs and German translation
+
+2008-05-29 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-list.c:
+ Invalidate stored disc data upon refresh
+ * xfburn/xfburn-data-composition.c:
+ Adding warning when adding home directory to compilation
+ * xfburn/xfburn-blank-dialog.c:
+ Connecting blank dialog to device box refresh signal
+
+2008-05-28 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-blank-dialog.c, xfburn/xfburn-progress-dialog.c:
+ Fixing selection of blank mode by putting mode no into the combo
+ box
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-box.h:
+ Cleaning up setting of status label, make label grayed out when
+ insensitive
+ * xfburn/xfburn-blank-dialog.c:
+ Removed gotos from blanking code
+ * xfburn/xfburn-blank-dialog.c:
+ Adding format & deformat options to the blanking dialog
+
+2008-05-12 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-progress-dialog.c:
+ Adding a simple animation option to the progress dialog
+
+2008-05-10 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-device-list.h:
+ Showing inserted disc type in the device box
+ * xfburn/xfburn-blank-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-list.c, xfburn/xfburn-device-list.h:
+ Retrieving profile no, and checking it for blanking
+ * xfburn/xfburn-device-list.c, xfburn/xfburn-device-list.h:
+ Adding debugging output about disc format
+
+2008-05-06 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-perform-burn.c:
+ Bugfix: first check message queue for fatal errors before
+ retrieving other messages
+
+2008-05-05 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c:
+ Bugfix: correctly check for the presence of a device
+
+2008-05-04 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-device-list.h:
+ Bugfixes: * Allow refresh of disc when blanking * Don't allow
+ refresh when there is no detected drive Keep track of disc
+ profile.
+ * xfburn/xfburn-device-box.c:
+ Bugfix: don't complain about invalid disc if there is no
+ available drive
+
+2008-05-03 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-blank-dialog.c, xfburn/xfburn-perform-burn.c:
+ Adding error catching code to blanking
+ * xfburn/xfburn-perform-burn.c, xfburn/xfburn-progress-dialog.c:
+ Implement error reporting
+ * xfburn/xfburn-hal-manager.c:
+ Bugfix: corrected previous bugfix for hal, hal now correctly
+ registered globally instead of not at all
+ * xfburn/xfburn-hal-manager.c:
+ Bugfix: hal-manager allocation now done per object creation
+
+2008-05-02 David Mohr <david at mcbf.net>
+
+ * xfburn-toolbars.ui, xfburn.ui,
+ xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-welcome-tab.c:
+ Have welcome screen buttons sensitivity set by the main action
+ group -- better solution would be to overwrite GtkAction
+
+2008-05-01 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-hal-manager.c:
+ Bugfix: proper shutwdown of HAL
+ * xfburn/Makefile.am, xfburn/xfburn-blank-dialog.c,
+ xfburn/xfburn-blank-dialog.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-welcome-tab.c:
+ Reflecting the blank-dialog rename in the code
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-blank-dialog.c, xfburn/xfburn-blank-dialog.h:
+ Renaming blank dialog
+ * TODO, xfburn/Makefile.am:
+ Bugfix: corrected Makefile.am for HAL
+
+2008-04-29 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c:
+ Bugfix: deallocate HalManager, don't refresh speed list when the
+ DeviceBox is empty
+ * xfburn/xfburn-burn-data-composition-base-dialog.c:
+ Bugfix: Enable burn button when target is an iso file, not a
+ burner
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-global.h:
+ Ask for compilation name again in the burn dialog if it was left
+ as the default
+ * xfburn/xfburn-welcome-tab.c:
+ Adding icons and secondary text to the welcome screen
+
+2008-04-26 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-welcome-tab.c:
+ Adding basic content to the welcome tab
+
+2008-04-25 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-list.c:
+ Overlooked a g_error, now last commit works
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-device-list.h:
+ Adding error message when unable to grab drive (program aborted
+ before)
+ * xfburn/xfburn-device-box.c:
+ Adding default entry if no speed list is available
+ * TODO, xfburn/Makefile.am, xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-hal-manager.c, xfburn/xfburn-hal-manager.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-welcome-tab.c,
+ xfburn/xfburn-welcome-tab.h:
+ Adding basic welcome tab support
+
+2008-04-24 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c:
+ Adding formating to the empty device list dialog text
+ * xfburn/xfburn-device-list.c:
+ Forgot to delete debugging statement
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-preferences-dialog.c:
+ Adding setting and functionality to hide empty speed list dialog
+
+2008-04-23 David Mohr <david at mcbf.net>
+
+ * NEWS, TODO, configure.in.in, xfburn/Makefile.am,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-hal-manager.c, xfburn/xfburn-hal-manager.h:
+ Finished XfburnHalManager, device box now gets updated by hal
+ when the drive status changes
+ * xfburn/xfburn-hal-manager.c, xfburn/xfburn-hal-manager.h:
+ Start of XfburnHalManager to handle volume changes
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c:
+ Querying thunar for volume changes in device box
+
+2008-04-21 David Mohr <david at mcbf.net>
+
+ * configure.in.in:
+ Adding HAL detection to configure.in.in
+
+2008-04-20 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-device-list.c:
+ Improving feedback when no speed list can be retrieved
+
+2008-04-19 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c:
+ Bugfix for blank mode, 2nd try
+ * xfburn/xfburn-device-box.c:
+ Bugfix: actually parse BLANK_MODE flag in the device box
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-box.h:
+ Improving device box: - Adding blank mode for proper disc status
+ messages - Refreshing speed list also on device change, to get
+ always fresh info when the object is created
+
+2008-04-18 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-list.c:
+ Trying to grab the drive a bit more often now
+ * TODO:
+ Updating TODO
+ * xfburn-toolbars.ui, xfburn.ui:
+ Disabling copy cd toolbar /menu items
+ * TODO:
+ Updating TODO
+ * xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-list.c, xfburn/xfburn-device-list.h,
+ xfburn/xfburn-utils.c:
+ Cleaning up debugging statements. Make disc status messages more
+ precise. Disable burn button in burn compilation dialog if the
+ disc is not valid. Try one more time to grab drive in the device
+ list.
+
+2008-04-17 Mario Đanić <mario at libburnia-project.org>
+
+ * xfburn/xfburn-burn-image-dialog.c:
+ Now user knows he needs to choose image
+ * xfburn/xfburn-device-list.c:
+ No p0llux anymore
+ * xfburn/xfburn-device-list.c:
+ Will this debug p0llux?
+ * xfburn/xfburn-device-list.c:
+ Done minor formatting changes
+
+2008-04-17 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c:
+ Only access combo box if it has entries
+
+2008-04-17 Mario Đanić <mario at libburnia-project.org>
+
+ * INSTALL, xfburn/xfburn-device-list.c:
+ Implemented some checks for burning devices
+ * TODO:
+ Disable isnt done at proper moment yet
+ * TODO:
+ So again it is todo
+
+2008-04-17 David Mohr <david at mcbf.net>
+
+ * TODO:
+ Updating TODO
+
+2008-04-17 Mario Đanić <mario at libburnia-project.org>
+
+ * TODO:
+ Updated TODO for erasing magic
+ * TODO:
+ Updated TODO again
+ * TODO:
+ Migration to gvfs added to TODO
+ * TODO:
+ Sorting available burn speeds works now
+ * TODO:
+ Added more todo items
+
+2008-04-17 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-data-disc-usage.c:
+ Adding automatic switching between data disc types / sizes
+
+2008-04-16 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-data-cd-composition-dialog.h,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.c,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.h,
+ xfburn/xfburn-data-composition.c:
+ Creating burn data dvd subclass
+
+2008-04-16 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in:
+ bump required GTK+ version to 2.10 (fix bug #4024)
+
+2008-04-16 David Mohr <david at mcbf.net>
+
+ * xfburn/Makefile.am,
+ xfburn/xfburn-burn-data-cd-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-base-dialog.c,
+ xfburn/xfburn-burn-data-composition-base-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-perform-burn.c,
+ xfburn/xfburn-perform-burn.h:
+ Unifying the burn code: - Created base class
+ XfburnBurnDataCompositionBaseDialog, which both the CD and DVD
+ burning dialog can use - Factored actual burning and progress
+ dialog update code out into xfburn_perform_burn_write()
+
+2008-04-14 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-compositions-notebook.c:
+ Making compositions reorderable in the notebook (patch by
+ jeromeg)
+ * xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-box.h:
+ Adding new signal for a refresh to the device box class to be
+ able to en/disable the burn botton
+
+2008-04-14 Mario Đanić <mario at libburnia-project.org>
+
+ * NEWS:
+ Updated news with recent changes
+ * xfburn/xfburn-data-disc-usage.c:
+ Disable burn composition button when there is nothing in
+ composition
+ * xfburn/xfburn-device-box.c:
+ Made message when there is no disk in drive more specific
+
+2008-04-13 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c:
+ Adding label to notify user that no disc is inserted in the drive
+
+2008-04-13 Mario Đanić <mario at libburnia-project.org>
+
+ * xfburn/xfburn-directory-browser.c:
+ Hopefully fixed abort now ;))
+ * xfburn/xfburn-directory-browser.c:
+ Done some resize columns magic
+ * xfburn/xfburn-directory-browser.c:
+ Temporarily undone last patch
+ * xfburn/xfburn-directory-browser.c:
+ Done more work on resizable columns magic! Thanks Jerome
+ * NEWS:
+ Updated news to reflect that we fixed 4012
+
+2008-04-13 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-device-list.c:
+ Sort speed list, added fallback value if no list is available
+ (fixes bug #4012)
+
+2008-04-13 Mario Đanić <mario at libburnia-project.org>
+
+ * TODO:
+ Updated TODO again
+
+2008-04-13 Jean-François Wauthy <pollux at xfce.org>
+
+ * CONTRIBUTORS:
+ be more explicit about the contributions in order to keep track
+
+2008-04-13 Mario Đanić <mario at libburnia-project.org>
+
+ * CONTRIBUTORS:
+ Added Jerome to contributors
+ * NEWS, xfburn/xfburn-directory-browser.c:
+ Made list columns resizable
+ * TODO:
+ Once again updated TODO
+ * TODO:
+ Added popup in todo for proper speed detection
+ * NEWS:
+ Correct url of libburnia project in news
+ * AUTHORS, xfburn/xfburn-main-window.c:
+ Updated about dialog
+
+2008-04-13 David Mohr <david at mcbf.net>
+
+ * ChangeLog, TODO, committers.xml, update-changelog.sh:
+ Updating ChangeLog and its support scripts, and TODO file
+
+2008-04-13 Mario Đanić <mario at libburnia-project.org>
+
+ * AUTHORS:
+ Added David and myself to authors
+ * TODO:
+ Updated TODO file with various new tasks
+
+2008-04-12 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn.desktop.in:
+ remove deprecated Encoding key in .desktop file (fix bug #4006)
+
+2008-04-09 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translation.
+
+2008-04-05 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-copy-dvd-dialog.c,
+ xfburn/xfburn-format-dvd-dialog.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main.c:
+ Fixing compiler warnings
+
+2008-04-03 Mario Đanić <mario at libburnia-project.org>
+
+ * xfburn/xfburn-global.h:
+ Removed obsolete mkisofs defines
+ * xfburn/xfburn-global.h:
+ Removed obsolete CDRECORD defines
+ * CONTRIBUTORS:
+ Checked in contributors file
+
+2008-04-03 David Mohr <david at mcbf.net>
+
+ * xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-main.c:
+ Fixed bug: translate newly added error message strings Added
+ checks before burning an image: * Failed checks will not destroy
+ the dialog (before checks were done in the burn thread, with
+ progress dialog visible already) * Check for image existance &
+ permissions * Moved media check out of burn thread * Check image
+ size against media size
+ * xfburn-toolbars.ui, xfburn.ui, xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-global.h, xfburn/xfburn-main-window.c:
+ Rewriting image burning functions to work for both CD and DVD: *
+ Changed function names to be media agnostic * Calculate 'x' speed
+ ratings on the fly, instead of list lookup * Fixed dynamic speed
+ calculation in the progress dialog to work for the increased
+ number of sectors that fit on a DVD
+ * xfburn/xfburn-device-list.c, xfburn/xfburn-device-list.h,
+ xfburn/xfburn-main.c:
+ Adding a check during startup if libburn was able to aquire the
+ drive
+
+2008-03-14 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in, xfburn/xfburn-burn-data-cd-composition-dialog.c,
+ xfburn/xfburn-burn-data-cd-composition-dialog.h,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.c,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.h,
+ xfburn/xfburn-data-composition.c:
+ Updating libisofs support to 0.6.2 (patch by David Mohr)
+
+2007-12-09 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/LINGUAS, po/es.po:
+ add Spanish translations by Diego Rodriguez <dieymir at yahoo.es>
+
+2007-12-02 maximilian
+
+ * po/ChangeLog, po/de.po:
+ Spanish translations branch updates and German translations trunk
+ updates
+
+2007-11-15 mmassonnet
+
+ * po/ChangeLog, po/LINGUAS, po/ur.po:
+ Add Urdu translations to trunk (hope this is right *sigh*)
+
+2007-11-14 kelnos
+
+ * po/LINGUAS:
+ s/PT_BR/pt_BR/
+
+2007-11-11 mmassonnet
+
+ * po/ChangeLog, po/LINGUAS, po/lv.po:
+ Update/Add Latvian translations
+
+2007-11-08 omaciel
+
+ * po/ChangeLog, po/LINGUAS, po/pt_BR.po:
+ Added Brazilian Portuguese translation by Fábio Nogueira
+ <deb-user-ba at ubuntu.com>; Added pt_BR to LINGUAS
+
+2007-11-01 sas
+
+ * po/hu.po:
+ Hungarian updates before 4.4.2
+
+2007-10-25 kelnos
+
+ * po/POTFILES.in:
+ add missing file to POTFILES
+ * xfburn/Makefile.am:
+ add some files that aren't in the build yet to EXTRA_DIST so make
+ distcheck works
+ * po/POTFILES.in, po/xfburn.pot:
+ fix incorrect filename in POTFILES
+
+2007-10-24 kelnos
+
+ * configure.in.in:
+ remove trailing parens on AC_INIT version info to work around bug
+ in intltool 0.35.x and 0.36.x
+
+2007-09-22 alnokta
+
+ * po/ar.po:
+ Updating Arabic translations
+
+2007-09-16 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c:
+ Add Nuno Miguel to translator credits
+
+2007-08-21 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in, xfburn/xfburn-burn-data-cd-composition-dialog.c,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.c,
+ xfburn/xfburn-data-composition.c:
+ build with libisofs 0.2.8
+
+2007-08-20 sas
+
+ * po/hu.po:
+ hu trunk: burn & gui updates
+
+2007-07-08 maximilian
+
+ * po/ChangeLog, po/pt_PT.po:
+ * Updated some Brazilian Portuguese translations for Xfce 4.4. *
+ Updated some European Portuguese translations for trunk.
+
+2007-06-27 maximilian
+
+ * po/ChangeLog, po/LINGUAS, po/nb_NO.po:
+ * no_NO.po: Norwegian Bokmal translation update for the xfburn
+ package * pt_PT.po: European Portuguese translation update for
+ some packages in trunk * ka.po: Georgian translation update for
+ the xfce-mcs-manager package (4.4)
+
+2007-06-10 maximilian
+
+ * po/ChangeLog, po/LINGUAS, po/fr.po, po/pt_PT.po:
+ * nb_NO: Updated some Norwegian translations and added one for
+ Xfmedia * pt_PT: Added European Portuguese translations * Changed
+ my email address
+
+2007-05-05 majkl
+
+ * po/cs.po:
+ Updated Czech translations
+
+2007-05-01 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in, xfburn/Makefile.am:
+ explicitly check for gthread (fix bug #3196)
+
+2007-04-26 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/LINGUAS, po/zh_CN.po:
+ add Chinese translations
+
+2007-04-15 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-data-cd-composition-dialog.c,
+ xfburn/xfburn-burn-data-cd-composition-dialog.h,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.c,
+ xfburn/xfburn-burn-data-dvd-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-dvd-dialog.c,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-disc-usage.c, xfburn/xfburn-data-disc-usage.h,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-box.h,
+ xfburn/xfburn-format-dvd-dialog.c:
+ add *basic* DVD support
+ * configure.in.in, xfburn/xfburn-burn-image-dialog.c:
+ off_t *must* be 8 bytes long ! (fix bug #3140)
+
+2007-04-09 maximilian
+
+ * po/fr.po:
+ * fr.po: Fixed headers in trunk * Updated AUTHORS file in
+ xfce-utils trunk and branch 4.4
+ * po/fr.po:
+ * fr.po: Fixed typos and style in the French translation of
+ Terminal's manual * Changed my email address in all the fr.po
+ files in trunk and 4.4
+
+2007-04-05 paurullan
+
+ * po/ChangeLog, po/ca.po:
+ i18n catalan update
+
+2007-03-29 mvd
+
+ * po/ChangeLog, po/uk.po:
+ Maxim Dziumanenko <dziumanenko at gmail.com>
+
+ * Update Ukrainian translation by Dmitry Nikitin.
+
+2007-03-28 maximilian
+
+ * po/ChangeLog, po/LINGUAS, po/en_GB.po:
+ * de.po: Nico Schümann minor fixes to the German translations *
+ en_GB.po: Jeff Bailes updated the British English translations
+ for trunk and branches
+
+2007-03-25 daichi
+
+ * po/ChangeLog, po/gl.po, po/lt.po:
+ Fixed.
+
+2007-03-24 maximilian
+
+ * po/ChangeLog, po/de.po:
+ * de.po: Nico Schümann updated the following German translations
+ libexo; xfburn; xfce4-panel and xfdesktop * fr.po: Updated the
+ following French translations squeeze; xfce4-panel and xfdesktop
+
+2007-03-16 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/LINGUAS, po/it.po:
+ add Italian translations from David Paleino <d.paleino at gmail.com>
+
+2007-03-14 mvd
+
+ * po/ChangeLog, po/uk.po:
+ 2007-03-13 Maxim Dziumanenko <dziumanenko at gmail.com>
+
+ * Update Ukrainian translation by Dmitry Nikitin
+ <luckas_fb at mail.ru>
+
+2007-03-08 sas
+
+ * po/hu.po:
+ hu trunk: little updates
+
+2007-02-22 maximilian
+
+ * po/ChangeLog, po/de.po:
+ * de.po: Updated the German translation of xfburn by Nico
+ Schümann. * Updated the squeeze po files
+
+2007-02-20 maximilian
+
+ * po/ChangeLog, po/ko.po:
+ * fr.po: Updated the French translations of libexo and squeeze *
+ ko.po: Updated the Korean translations by ByungHyun Choi in
+ xfce-utils, thunar, xfburn and mousepad
+
+2007-02-18 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-device-list.c:
+ correctly free the 'drives' array
+
+2007-02-10 maximilian
+
+ * po/ChangeLog, po/LINGUAS:
+ Verified all LINGUAS files and added Albanian language to it.
+
+2007-02-08 alnokta
+
+ * po/ChangeLog:
+ Adding information to the ChangeLog
+ * po/ar.po:
+ 156 strings, 0 fuzzy, 66 not translated. initial commit.
+ * po/LINGUAS:
+ Adding AR language code.
+
+2007-02-03 piarres
+
+ * po/ChangeLog, po/eu.po:
+ Xfburn basque translation update
+
+2007-01-28 sas
+
+ * po/hu.po:
+ hu trunk: little updates
+
+2007-01-26 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-composition.h, xfburn/xfburn-data-disc-usage.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main-window.h:
+ deactivate actions that devices do not support
+ * ChangeLog, class diagram.zuml, committers.xml,
+ update-changelog.sh:
+ * update ChangeLog * clean up class diagram * add script to
+ update ChangeLog
+
+2007-01-25 maximilian
+
+ * po/ChangeLog, po/fr.po, po/sq.po:
+ Added the Albanian translations by Besnik Bleta for the core
+ packages. Updated some French translations
+
+2007-01-23 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c:
+ fix icon for Moe
+ * NEWS, TODO, configure.in.in, po/POTFILES.in, po/ca.po, po/cs.po,
+ po/de.po, po/dz.po, po/el.po, po/eu.po, po/fi.po, po/fr.po,
+ po/gl.po, po/he.po, po/hu.po, po/ja.po, po/ko.po, po/lt.po,
+ po/nl.po, po/pa.po, po/pl.po, po/ru.po, po/sv.po, po/uk.po,
+ po/xfburn.pot, po/zh_TW.po, xfburn-toolbars.ui, xfburn.ui,
+ xfburn/Makefile.am, xfburn/xfburn-adding-progress.c,
+ xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.h,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-burn-data-composition-progress-dialog.c,
+ xfburn/xfburn-burn-data-composition-progress-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.h,
+ xfburn/xfburn-copy-dvd-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-composition.h,
+ xfburn/xfburn-data-disc-usage.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-box.h, xfburn/xfburn-device-list.c,
+ xfburn/xfburn-device-list.h, xfburn/xfburn-format-dvd-dialog.c,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-write-mode-combo-box.c,
+ xfburn/xfburn-write-mode-combo-box.h:
+ merge libburn branch into trunk
+
+2007-01-20 yuvaltanny
+
+ * po/he.po:
+ Hebrew translation update
+
+2007-01-13 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-data-disc-usage.c:
+ fix cd sizes using values from
+ http://en.wikipedia.org/wiki/CD-ROM#Capacity (fix #2753)
+
+2007-01-09 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS:
+ update NEWS
+ * icons, icons/16x16, icons/22x22,
+ icons/24x24/stock_xfburn-blank-cdrw.png,
+ icons/24x24/stock_xfburn-burn-cd.png,
+ icons/24x24/stock_xfburn-data-copy.png,
+ icons/24x24/stock_xfburn-import-session.png,
+ icons/32x32/Makefile.am, icons/32x32/stock_xfburn-blank-cdrw.png,
+ icons/32x32/stock_xfburn-burn-cd.png,
+ icons/32x32/stock_xfburn-data-copy.png,
+ icons/32x32/stock_xfburn-import-session.png,
+ icons/48x48/Makefile.am, icons/48x48/stock_xfburn-blank-cdrw.png,
+ icons/48x48/stock_xfburn-burn-cd.png,
+ icons/48x48/stock_xfburn-data-copy.png,
+ icons/48x48/stock_xfburn-import-session.png, icons/Makefile.am,
+ icons/scalable/Makefile.am,
+ icons/scalable/stock_xfburn-blank-cdrw.svg,
+ icons/scalable/stock_xfburn-burn-cd.svg,
+ icons/scalable/stock_xfburn-data-copy.svg,
+ icons/scalable/stock_xfburn-import-session.svg,
+ xfburn/xfburn-burn-data-composition-progress-dialog.h,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-progress-dialog.h:
+ backport icons from libburn branch and revert not wanted changes
+ * configure.in.in, icons,
+ xfburn/xfburn-burn-data-composition-progress-dialog.h,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-progress-dialog.h:
+ remove icons in order to backport new icons
+
+2007-01-07 stephan
+
+ * po/nl.po:
+ set content-type of dutch translations to UTF-8
+ * po/nl.po:
+ Updated Dutch translation
+
+2006-12-26 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-directory-browser.c:
+ hide symbolic links in directory browser for consistency (related
+ to bug #2688)
+
+2006-12-23 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-progress-dialog.c:
+ Apply patch from Jasper to prevent crash when closing the
+ Blanking CD dialog (fix bug #2679)
+
+2006-12-23 aalam
+
+ * po/ChangeLog, po/LINGUAS, po/pa.po:
+ adding Punjabi Translation by alam and update Linguas/Changelog
+
+2006-12-22 maximilian
+
+ * po/ChangeLog:
+ Updated the French translation for the xarchiver package and
+ fixed a mistake I introduced in Changelog's lately
+
+2006-12-20 maximilian
+
+ * po/ChangeLog, po/ru.po:
+ Updated the Russian translations by Andrey Fedoseev for a lot of
+ packages
+
+2006-12-03 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-progress-dialog.c:
+ get rid of all the stupid g_object_{get,set}_data calls
+
+2006-11-30 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ E-mail address change. Sorry for the noise.
+
+2006-11-16 yuvaltanny
+
+ * po/he.po:
+ Updated Hebrew translations
+
+2006-11-11 maximilian
+
+ * po/fr.po:
+ Still missed one accelerator in xfburn and forgot to name
+ ByungHyun Choi for the Korean translation
+ * po/ChangeLog, po/fr.po:
+ Updated the Korean translation for the mousepad package and
+ corrected the French xfburn translation following the advice from
+ JFW
+
+2006-11-11 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ Greek translations update
+
+2006-11-11 maximilian
+
+ * po/ChangeLog, po/cs.po, po/pl.po:
+ Updated the Czech translations by Michal Várady for the following
+ packages: mousepad; thunar; xarchiver; xfburn; xfcalendar;
+ xfce-mcs-plugins; xfdesktop; xfce-battery-plugin Updated the
+ Polish translations by Szymon Kałasz for the following packages:
+ terminal; xarchiver; xfburn
+
+2006-11-05 paurullan
+
+ * po/ChangeLog, po/LINGUAS, po/de.po, po/fr.po, po/ko.po:
+ i18n French, German and Korean translations
+
+2006-11-05 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-format-dvd-dialog.c,
+ xfburn/xfburn-progress-dialog.c:
+ fix XfburnProgressDialog's expander behaviour
+
+2006-11-04 paurullan
+
+ * po/ChangeLog, po/ca.po:
+ i18n catalan update
+
+2006-11-03 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translations.
+
+2006-11-03 piarres
+
+ * po/ChangeLog, po/eu.po:
+ xfburn basque translation update
+
+2006-11-01 sas
+
+ * po/hu.po:
+ hu trunk: arch & burn updates
+
+2006-11-01 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, icons/24x24/Makefile.am,
+ icons/24x24/stock_xfburn-blank-dvdrw.png,
+ icons/24x24/stock_xfburn-format-dvdrw.png, po/POTFILES.in,
+ po/ca.po, po/cs.po, po/de.po, po/dz.po, po/el.po, po/eu.po,
+ po/fi.po, po/fr.po, po/gl.po, po/he.po, po/hu.po, po/ja.po,
+ po/lt.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po, po/uk.po,
+ po/xfburn.pot, po/zh_TW.po, xfburn-toolbars.ui, xfburn.ui,
+ xfburn/Makefile.am, xfburn/xfburn-copy-dvd-dialog.c,
+ xfburn/xfburn-copy-dvd-dialog.h,
+ xfburn/xfburn-create-iso-progress-dialog.c,
+ xfburn/xfburn-format-dvd-dialog.c,
+ xfburn/xfburn-format-dvd-dialog.h, xfburn/xfburn-global.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-stock.c,
+ xfburn/xfburn-stock.h:
+ Add create ISO from DVD support
+
+2006-10-29 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn.desktop.in:
+ use media-cdrom as icon until better comes up (fix bug #2421)
+
+2006-10-28 paurullan
+
+ * po/ChangeLog, po/LINGUAS, po/dz.po:
+ added whole Dzongkha translation
+
+ congratulations to the dz team.
+
+2006-10-22 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ Updated Greek translations
+
+2006-10-11 stavrosg
+
+ * po/el.po:
+ Greek translations update
+
+2006-10-10 eulex
+
+ * po/ChangeLog, po/LINGUAS, po/sv.po:
+ Added swedish translations by Daniel Nylander
+
+2006-10-02 paurullan
+
+ * po/ChangeLog, po/ru.po:
+ i18n updated Russian translations
+ * po/ChangeLog, po/nl.po:
+ i18n Dutch updates
+
+2006-09-18 paurullan
+
+ * po/ChangeLog, po/ca.po:
+ [i18n] update catalan translation
+
+2006-09-02 yuvaltanny
+
+ * po/he.po:
+ Update Hebrew translation
+
+2006-08-27 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/cs.po:
+ Add/Update Czech translations
+ * po/ChangeLog, po/de.po:
+ Updated German translations
+ * po/ChangeLog, po/LINGUAS, po/nl.po, xfburn/xfburn-main-window.c:
+ add Dutch translations
+
+2006-08-24 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/pl.po:
+ Update Polish translations
+
+2006-08-21 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/Makefile.am, xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-burn-data-composition-progress-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-copy-cd-progress-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c,
+ xfburn/xfburn-create-iso-progress-dialog.c,
+ xfburn/xfburn-device-box.c, xfburn/xfburn-device-box.h,
+ xfburn/xfburn-device-list.c, xfburn/xfburn-device-list.h,
+ xfburn/xfburn-global.h, xfburn/xfburn-main.c,
+ xfburn/xfburn-preferences-dialog.c, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ add xfburn-device-list.[ch]
+
+2006-08-20 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/gl.po:
+ remove executable property from gl.po
+ * po/ChangeLog, po/LINGUAS, po/gl.po:
+ Add Galician translations
+
+2006-08-19 hydonsingore
+
+ * po/ChangeLog, po/ja.po, po/zh_TW.po:
+ Update traditional Chinese translations.
+
+2006-08-19 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/fr.po:
+ Updated French translations
+
+2006-08-18 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c:
+ deactivate quit confirmation as it's more annoying than usefull
+ at this point (fix bug #2193)
+ * INSTALL:
+ add INSTALL to please sofar's autotools
+ * NEWS, xfburn/xfburn-data-composition.c:
+ Avoid adding non regular files (bug #2179)
+
+2006-08-16 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/pl.po:
+ Updated Polish translations
+
+2006-08-15 piarres
+
+ * po/ChangeLog, po/eu.po:
+ Basque translation update for xfburn and xfdesktop
+
+2006-08-15 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-data-composition.c:
+ - Fix wrong get_speed call in burn iso dialog - Directory are
+ sort before files in data composition
+
+2006-08-12 sas
+
+ * po/hu.po:
+ hu trunk: panel, burn updated
+
+2006-08-12 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translations.
+
+2006-08-11 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, xfburn/xfburn-data-composition.c:
+ Fix segfault when removing a file and one of its parent directory
+ together
+ * NEWS, po/ca.po, po/cs.po, po/de.po, po/el.po, po/eu.po, po/fi.po,
+ po/fr.po, po/he.po, po/hu.po, po/ja.po, po/lt.po, po/pl.po,
+ po/ru.po, po/uk.po, po/xfburn.pot, po/zh_TW.po:
+ update-po
+ * NEWS, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.h,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.h,
+ xfburn/xfburn-composition.h, xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-copy-cd-progress-dialog.c,
+ xfburn/xfburn-copy-cd-progress-dialog.h,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-create-iso-progress-dialog.c,
+ xfburn/xfburn-create-iso-progress-dialog.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-disc-usage.c, xfburn/xfburn-data-disc-usage.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-notebook-tab.h, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-settings.c:
+ Use g_type_class_add_private everywhere
+
+2006-08-10 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-data-composition.c:
+ add copy support in DnD inside a data composition
+ * po/ChangeLog, po/cs.po:
+ updated Czech translations
+
+2006-08-10 piarres
+
+ * po/ChangeLog, po/eu.po:
+ xfburn basque trasnaltion update
+
+2006-08-10 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/POTFILES.in, po/ca.po, po/cs.po, po/de.po, po/el.po, po/eu.po,
+ po/fi.po, po/fr.po, po/he.po, po/hu.po, po/ja.po, po/lt.po,
+ po/pl.po, po/ru.po, po/uk.po, po/xfburn.pot, po/zh_TW.po:
+ update po
+ * NEWS, class diagram.zuml, configure.in.in:
+ * Update NEWS * Update Class Diagram * Bump version
+ * xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-device-box.c,
+ xfburn/xfburn-device-box.h:
+ Add the XfburnDeviceBox class and use it in the burning dialogs
+
+2006-08-09 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ Xfburn Greek translations update
+
+2006-08-09 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-data-composition.c:
+ update parent directory size when adding a subdirectory via the
+ toolbar button (fix bug #2139)
+
+2006-08-08 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/de.po:
+ updated German translations
+
+2006-08-08 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translations.
+
+2006-08-07 piarres
+
+ * po/ChangeLog, po/eu.po:
+ Basque translation update
+
+2006-08-07 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, xfburn/xfburn-data-composition.c:
+ add DnD inside data composition
+
+2006-08-06 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, xfburn/xfburn-data-composition.c:
+ Prevent having two 'New directory' entries in a data composition
+
+2006-08-06 sas
+
+ * po/hu.po:
+ hu trunk: burn updated
+
+2006-08-05 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/POTFILES.in, po/ca.po, po/cs.po, po/de.po, po/el.po, po/eu.po,
+ po/fi.po, po/fr.po, po/he.po, po/hu.po, po/ja.po, po/lt.po,
+ po/pl.po, po/ru.po, po/uk.po, po/xfburn.pot, po/zh_TW.po:
+ update-po
+ * xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-main.c, xfburn/xfburn-settings.c:
+ plug another memleak
+ * xfburn/xfburn-data-composition.c, xfburn/xfburn-main.c,
+ xfburn/xfburn-settings.c, xfburn/xfburn-utils.c:
+ plug some small memleaks
+ * NEWS, class diagram.zuml, xfburn/Makefile.am,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-write-mode-combo-box.c,
+ xfburn/xfburn-write-mode-combo-box.h:
+ Add support of SAO mode (bug #2121)
+
+2006-08-05 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translations.
+
+2006-08-04 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ Greek translations update.
+
+2006-08-04 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, class diagram.zuml, xfburn.desktop.in:
+ * update class diagram * fix xfburn.desktop Categories entry as
+ suggested by Charles A Edwards <eslrahc at bellsouth.net> * update
+ NEWS
+ * xfburn/xfburn-data-composition.c, xfburn/xfburn-main.c:
+ * Add create directory action in data composition * Prevent usage
+ of empty filename in data composition
+
+2006-08-03 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/cs.po:
+ Updated Czech and French translations
+ * xfburn/xfburn-data-composition.c, xfburn/xfburn-file-browser.c:
+ improve add button (fix focus problem with the fs browser)
+ * xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-disc-usage.c,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h:
+ implement the add button in the data composition toolbar
+
+2006-07-31 Jean-François Wauthy <pollux at xfce.org>
+
+ * NEWS, xfburn/NEWS, xfburn/xfburn-burn-image-dialog.c:
+ Prevent cdrecord failure if there is a space in the path to an
+ iso (bug #1198)
+ * xfburn/NEWS, xfburn/xfburn-settings.c:
+ Avoid segfault on exit when ~/.config/xfburn doesn't exist (fix
+ bug #2095)
+ * configure.in.in, po/ChangeLog, po/de.po,
+ xfburn/xfburn-main-window.c:
+ * update German translations * fix German and Polish translator
+ names
+
+2006-07-30 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/hu.po:
+ update-po
+ * Makefile.am, configure.in.in, xfburn/Makefile.am:
+ fix distcheck and bump version
+ * xfburn/xfburn-file-browser.c, xfburn/xfburn-fs-browser.c:
+ fix browsing
+
+2006-07-30 sas
+
+ * po/hu.po:
+ hu trunk: burn & archiver update
+
+2006-07-30 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/POTFILES.in, po/ca.po, po/cs.po, po/de.po, po/el.po, po/eu.po,
+ po/fi.po, po/fr.po, po/he.po, po/hu.po, po/ja.po, po/lt.po,
+ po/pl.po, po/ru.po, po/uk.po, po/xfburn.pot, po/zh_TW.po:
+ update-po
+ * xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-progress-dialog.c,
+ xfburn/xfburn-burn-data-composition-progress-dialog.h,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.c:
+ Compilation burning implemented
+ * xfburn/Makefile.am, xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-disc-usage.c, xfburn/xfburn-data-disc-usage.h,
+ xfburn/xfburn-disc-usage.c, xfburn/xfburn-disc-usage.h:
+ Rename XfburnDiscUsage into XfburnDataDiscUsage
+ * xfburn-toolbars.ui, xfburn.ui,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-composition.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-main-window.c:
+ * deactivate the save/load actions * add volume name support
+ * xfburn/Makefile.am, xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-composition-progress-dialog.c,
+ xfburn/xfburn-burn-composition-progress-dialog.h,
+ xfburn/xfburn-burn-data-composition-dialog.c,
+ xfburn/xfburn-burn-data-composition-dialog.h,
+ xfburn/xfburn-burn-data-composition-progress-dialog.c,
+ xfburn/xfburn-burn-data-composition-progress-dialog.h,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-main.c:
+ * rename XfburnBurnCompositionDialog and
+ XfburnBurnCompositionProgressDialog into
+ XfburnBurnDataCompositionDialog and
+ XfburnBurnDataCompositionProgressDialog (gosh it's long) * the
+ generated filelist is now mkisofs compliant
+
+2006-07-29 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/pl.po:
+ Updated Polish translations
+
+2006-07-24 Jean-François Wauthy <pollux at xfce.org>
+
+ * class diagram.zuml, po/ChangeLog, po/POTFILES.in,
+ xfburn-toolbars.ui, xfburn.ui,
+ xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-main-window.c:
+ * add some composition actions to the GUI * fix wrong filename
+ conflict detection
+
+2006-07-23 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-composition.c, xfburn/xfburn-composition.h,
+ xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-main-window.c:
+ * prevent the user to open the burning dialog if the composition
+ is bigger than the media * rename tab and menu label if the user
+ saves the composition
+
+2006-07-23 sas
+
+ * po/hu.po:
+ hu trunk: burn update
+
+2006-07-23 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-compositions-notebook.c:
+ use GObject data instead of a customized struct in order to store
+ the pointer to the composition
+ * xfburn/Makefile.am, xfburn/xfburn-adding-progress.c,
+ xfburn/xfburn-composition.c,
+ xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-data-composition.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-notebook-tab.c, xfburn/xfburn-notebook-tab.h:
+ * rename some lost 'Compilation' into 'Composition' * add the
+ XfburnNotebookTab widget and use it in XfburnCompositionsNotebook
+ * po/ChangeLog, po/de.po:
+ Updated German translations
+ * po/ChangeLog, po/fr.po:
+ Updated French translations
+ * class diagram.zuml, po/POTFILES.in, po/ca.po, po/cs.po, po/de.po,
+ po/el.po, po/eu.po, po/fi.po, po/fr.po, po/he.po, po/hu.po,
+ po/ja.po, po/lt.po, po/pl.po, po/ru.po, po/uk.po, po/xfburn.pot,
+ po/zh_TW.po, xfburn.ui, xfburn/Makefile.am,
+ xfburn/xfburn-composition.c, xfburn/xfburn-composition.h,
+ xfburn/xfburn-compositions-notebook.c,
+ xfburn/xfburn-compositions-notebook.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-composition.h, xfburn/xfburn-main-window.c:
+ * add tabbed composition * update POTFILES.in
+
+2006-07-21 Jean-François Wauthy <pollux at xfce.org>
+
+ * class diagram.zuml, xfburn.ui, xfburn/Makefile.am,
+ xfburn/xfburn-composition.c, xfburn/xfburn-composition.h,
+ xfburn/xfburn-data-composition.c,
+ xfburn/xfburn-data-composition.h,
+ xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h:
+ * update class diagram (some parts still have to be implemented)
+ * rename XfburnDiscContent into XfburnDataComposition * create
+ the XfburnComposition interface * XfburnDataComposition
+ implements XfburnComposition * some public members of
+ XfburnMainWindow are now private
+
+2006-07-20 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h:
+ XfburnDiscContent handles the burn option dialog on its own
+ * xfburn/Makefile.am, xfburn/xfburn-adding-progress.c,
+ xfburn/xfburn-adding-progress.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h:
+ * avoid using a kind of signal proxy in XfburnDiscContent *
+ prepared a progress bar dialog to show while adding files to the
+ compilation (doesn't work so far so it's disabled)
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-disc-usage.c:
+ improve disc usage management
+
+2006-07-10 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ fix compilation without thunar-vfs
+
+2006-07-07 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-disc-content.c:
+ * fix another crash in thunar_vfs_shutdown (some forgotten
+ unref's) * dialogs now derive XfceTitledDialog instead of using a
+ XfceHeading widget explicitly
+ * configure.in.in, xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.h, xfburn/xfburn-settings.c,
+ xfburn/xfburn-settings.h:
+ * fix thunar_vfs_shutdown crash at exit * settings are now
+ handled by the XfburnSettings class
+
+2006-07-06 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-directory-browser.c:
+ i misinterpreter the basename parameter
+ * xfburn/Makefile.am, xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-disc-content.c, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-main.c:
+ basic Mime-type detection support using ThunarVFS (optional)
+ * xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c:
+ use new XfceHeading in dialogs
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-preferences-dialog.c:
+ new Preferences dialog using ExoIconBar
+
+2006-06-09 jari
+
+ * po/ChangeLog, po/fi.po:
+ Updated Finnish translation.
+
+2006-06-04 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog, po/fr.po:
+ updated French translations by Maximilian Schleiss
+ <maxschleiss at bluewin.ch>
+
+2006-05-31 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ support for saving tree-based composition
+
+2006-05-30 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ GUI support for tree in composition
+
+2006-05-29 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-main-window.c:
+ reduce memory usage using const (patch from Nick Schermer)
+
+2006-05-28 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ basic treeview in disc content (just the gui part)
+ * xfburn/xfburn-disc-content.c:
+ * use static variables for folder and file icon in disc content *
+ use a GtkTreeStore instead of GtkListStore in order to implement
+ tree support in compilation
+
+2006-05-28 jari
+
+ * po/fi.po:
+ Updated Finnish translations.
+
+2006-05-28 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ avoid having two files with the same name in the compilation
+
+2006-05-27 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.in.in, xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.h,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-composition-progress-dialog.c,
+ xfburn/xfburn-burn-composition-progress-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-copy-cd-progress-dialog.c,
+ xfburn/xfburn-copy-cd-progress-dialog.h,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-create-iso-progress-dialog.c,
+ xfburn/xfburn-create-iso-progress-dialog.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.h,
+ xfburn/xfburn-global.h, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-settings.h, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ update copyright info
+ * xfburn/xfburn-disc-content.c:
+ fix crash when removing multiple files from the disc content
+ (#1846)
+ * xfburn/xfburn-fs-browser.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-settings.c:
+ save and restore main window size (fix #1857)
+
+2006-05-26 mantas
+
+ * po/LINGUAS, po/lt.po:
+ Adding Lithuanian language
+
+2006-05-24 jari
+
+ * po/LINGUAS, po/fi.po:
+ New Finnish translation.
+
+2006-05-24 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c:
+ fix compilation with gcc 4.1
+ * xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-preferences-dialog.c:
+ use new XfceFrameBox
+ * ., Makefile.am, autogen.sh, configure.ac, configure.in.in, icons,
+ icons/24x24, icons/24x24/Makefile.am,
+ icons/24x24/stock_xfburn-audio-copy.png,
+ icons/24x24/stock_xfburn-blank-cdrw.png,
+ icons/24x24/stock_xfburn-blank-dvdrw.png,
+ icons/24x24/stock_xfburn-burn-cd.png,
+ icons/24x24/stock_xfburn-cd.png,
+ icons/24x24/stock_xfburn-data-copy.png,
+ icons/24x24/stock_xfburn-import-session.png, icons/Makefile.am,
+ icons/baker-audio-copy.png, icons/baker-blank-cdrw.png,
+ icons/baker-blank-dvdrw.png, icons/baker-burn-cd.png,
+ icons/baker-cd.png, icons/baker-data-copy.png,
+ icons/baker-import-session.png, pixmaps, po, po/LINGUAS,
+ xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main.c,
+ xfburn/xfburn-preferences-dialog.c, xfburn/xfburn-settings.c,
+ xfburn/xfburn-stock.c, xfburn/xfburn-stock.h:
+ * use GtkFrame instead of XfceFrameBox * add stock icons using
+ Terminal's way * use new XfceAboutDialog * add LINGUAS support
+
+2006-05-16 hydonsingore
+
+ * configure.ac, po/ChangeLog, po/zh_TW.po:
+ Tradtional Chinese translation for xfburn newly added.
+
+2006-05-13 paurullan
+
+ * po/ChangeLog, po/ca.po:
+ [i18n] catalan Update various translations
+
+2006-05-13 daichi
+
+ * configure.ac, po/ChangeLog, po/cs.po:
+ Added/Updated Czech translations by Michal Varady
+ <miko.vaji at gmail.com>.
+
+2006-05-09 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c:
+ fix segfault reported by Kamran Khan
+
+2006-05-09 stavrosg
+
+ * po/ChangeLog, po/el.po:
+ Unbreak the translation. Sorry for the noise
+
+2006-05-07 stavrosg
+
+ * configure.ac, po/ChangeLog, po/el.po:
+ Added xfburn Greek translation
+
+2006-05-06 sas
+
+ * po/hu.po:
+ hu trunk: terminal gui & burn fixes
+
+2006-05-03 sas
+
+ * po/hu.po:
+ hu trunk: xfburn updates
+
+2006-05-02 sas
+
+ * configure.ac, po/hu.po:
+ hu trunk: initial hungarian xfburn translation
+
+2006-05-02 daichi
+
+ * po/ChangeLog:
+ Removed timestamps so that a translator isn't bothered: "Then,
+ what time is it now in UTC?"
+ * configure.ac:
+ Added `pl' to XDT_I18N().
+ * po/pl.po:
+ Added/Updated Polish translations by Szymon Kalasz
+ <szymon_maestro at gazeta.pl>.
+
+2006-05-02 Jean-François Wauthy <pollux at xfce.org>
+
+ * Makefile.am:
+ should fix bug #1695 (patch from Jani Monoses)
+
+2006-05-01 daichi
+
+ * po/ru.po:
+ Updated Russian translations by Anthony Ivanoff <a-i at bk.ru>,
+ Maxim Zenin <webmechanics at gmail.com>, Sergey Fedoseev
+ <fedoseev.sergey at gmail.com>.
+ * po/de.po, po/he.po, po/uk.po:
+ Updated.
+
+2006-04-30 moe
+
+ * configure.ac, po/ChangeLog, po/de.po:
+ Add German translations by Enrico Tröger
+ <enrico.troeger at uvena.de> Fixes by Fabian Nowak
+ <timystery at arcor.de> Fixes by Moritz Heiber <moe at xfce.org>
+
+2006-04-29 daichi
+
+ * configure.ac:
+ Added `uk' to XDT_I18N().
+
+2006-04-23 daichi
+
+ * po/ru.po:
+ Updated Russian translations by Sergey Fedoseev
+ <fedoseev.sergey at gmail.com>.
+
+2006-04-21 mvd
+
+ * po/uk.po:
+ 2006-04-21 Maxim Dziumanenko <mvd at mylinux.ua>
+
+ * Updated Ukrainian translation.
+
+2006-04-18 yuvaltanny
+
+ * configure.ac, po/he.po:
+ Hebrew translation for xfburn
+
+2006-04-15 olivier
+
+ * ChangeLog:
+ Update ChangeLog
+
+2006-04-15 daichi
+
+ * po/ca.po:
+ Bump, etc.
+ * po/ru.po:
+ Updated Russian translations by Andrey Fedoseev
+ <andrey.fedoseev at gmail.com>.
+ * configure.ac:
+ Added missing language codes.
+
+2006-04-02 paurullan
+
+ * po/ca.po:
+ [i18n] catalan little of work on catalan translations
+
+2006-03-27 daichi
+
+ * po/ru.po:
+ Added/Updated Russian translations by Andrey Fedoseev
+ <andrey.fedoseev at gmail.com> and Sergey Fedoseev
+ <fedoseev.sergey at gmail.com>.
+
+2006-03-19 paurullan
+
+ * po/ca.po:
+ [i18n] catalan seems a lot of work but they all are fuzzy
+
+2006-03-18 paurullan
+
+ * po/ca.po:
+ [i18n] catalan added null translation and some little tweaks to
+ not-parsing ones
+
+2006-03-18 daichi
+
+ * configure.ac, po/ru.po:
+ Added/Updated Russian translations by Andrey Fedoseev
+ <andrey.fedoseev at gmail.com>, Sergey Fedoseev
+ <fedoseev.sergey at gmail.com>.
+
+2006-01-18 daichi
+
+ * po/ChangeLog:
+ Updated.
+
+2006-01-07 daichi
+
+ * po/eu.po, po/fr.po, po/ja.po:
+ Updated copyright information.
+
+2005-12-20 daichi
+
+ * configure.ac:
+ Added `eu' at the XDT_I18N().
+ * po/eu.po:
+ Fixed errors etc.
+ * po/ChangeLog:
+ Updated.
+
+2005-12-18 Jean-François Wauthy <pollux at xfce.org>
+
+ * Makefile.am:
+ add dist-bz2 and distcheck-bz2 targets in order to build
+ snapshots
+
+2005-12-04 piarres
+
+ * po/ChangeLog, po/eu.po:
+ Xfburn Basque translation
+
+2005-11-28 daichi
+
+ * po/ChangeLog:
+ Updated.
+
+2005-11-22 daichi
+
+ * po/ja.po:
+ Updated Japanese translations.
+
+2005-11-21 daichi
+
+ * po/fr.po, po/ja.po, po/xfburn.pot:
+ Updated.
+ * po/POTFILES.in:
+ Updated POTFILES.in files.
+
+2005-11-05 daichi
+
+ * po/ChangeLog:
+ Deciphering.
+ * po/ChangeLog:
+ Trimmed and updated.
+
+2005-10-30 olivier
+
+ * xfburn/xfburn-disc-content.c:
+ g_object_set() uses a variable list of arguments and must be NULL
+ termianted otherwise unpredictable results may happen (a core
+ dump in my case). This is to fix that bug.
+
+2005-10-30 daichi
+
+ * po/fr.po, po/ja.po, po/xfburn.pot:
+ Updated.
+
+2005-10-16 daichi
+
+ * po/fr.po, po/ja.po, po/xfburn.pot:
+ Updated.
+
+2005-10-11 daichi
+
+ * configure.ac, po/ja.po:
+ Added initial Japanese translations.
+ * po/xfburn.pot:
+ Updated.
+ * po/fr.po:
+ * Modified initial header strings using template by `msginit'.
+
+ * Modified initial comment strings using template by `msginit'.
+ * po/POTFILES.in:
+ Added a missing file.
+
+2005-10-08 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/fr.po, xfburn/xfburn-main-window.c:
+ updated french translations from Etienne Collet
+
+2005-10-07 sofar
+
+ * Makefile.am, configure.ac, xfburn.desktop.in:
+ Adding a xfburn.desktop!
+
+2005-09-07 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/ChangeLog:
+ update ChangeLog
+ * ChangeLog:
+ update ChangeLog
+ * class diagram.zuml, configure.ac, po/fr.po, po/xfburn.pot:
+ update ChangeLog
+
+2005-09-05 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c:
+ can burn compositions
+ * xfburn/Makefile.am, xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.c,
+ xfburn/xfburn-create-iso-from-composition-progress-dialog.h,
+ xfburn/xfburn-global.h:
+ create iso from composition implemented
+ * xfburn/xfburn-progress-dialog.c:
+ closing ProgressDialog cancels current command
+ * xfburn/Makefile.am, xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-copy-cd-progress-dialog.c,
+ xfburn/xfburn-create-iso-progress-dialog.c,
+ xfburn/xfburn-create-iso-progress-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h:
+ copy cd dialog uses new ProgressDialog framework
+
+2005-09-04 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-global.h, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.h:
+ add support for writing ISO with new ProgressDialog framework
+ * ChangeLog, class diagram.zuml, po/ChangeLog,
+ xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h:
+ * blank cd works again using new XfburnProgressDialog framework *
+ update ChangeLog
+
+2005-09-03 Jean-François Wauthy <pollux at xfce.org>
+
+ * class diagram.zuml, po/POTFILES.in, po/fr.po, po/xfburn.pot,
+ xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.c,
+ xfburn/xfburn-blank-cd-progress-dialog.h,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-progress-dialog.c,
+ xfburn/xfburn-burn-composition-progress-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.c,
+ xfburn/xfburn-burn-image-progress-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-copy-cd-progress-dialog.c,
+ xfburn/xfburn-copy-cd-progress-dialog.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.h:
+ creates *ProgressDialog classes deriving XfburnProgressDialog
+
+2005-09-01 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-progress-dialog.c:
+ add support for copying data cd
+
+2005-08-31 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/fr.po, po/xfburn.pot, xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-utils.c, xfburn/xfburn-utils.h:
+ add support for creating iso from a CD
+ * xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-utils.c:
+ ;
+
+2005-08-29 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-global.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-settings.c, xfburn/xfburn-settings.h,
+ xfburn/xfburn-utils.c, xfburn/xfburn-utils.h:
+ damn i forgot to comment the keyword :(
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-global.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h,
+ xfburn/xfburn-settings.c, xfburn/xfburn-settings.h,
+ xfburn/xfburn-utils.c, xfburn/xfburn-utils.h:
+ add $ in each source file
+ * configure.ac, xfburn/xfburn-main-window.c:
+ add revision in about dialog
+
+2005-08-28 Jean-François Wauthy <pollux at xfce.org>
+
+ * configure.ac:
+ keywords
+ * configure.ac:
+ fix property
+ * TODO, configure.ac, po/fr.po, po/xfburn.pot,
+ xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-utils.c, xfburn/xfburn-utils.h:
+ fix memomnics
+
+2005-08-16 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/Makefile.am, xfburn/xfburn-burn-composition-dialog.c,
+ xfburn/xfburn-burn-composition-dialog.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-main-window.c:
+ * implement refresh * add burn composition dialog
+ * xfburn/xfburn-disc-content.c:
+ don't load file that doesn't exist
+ * xfburn.ui, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-main-window.c:
+ add load/save composition
+
+2005-08-15 Jean-François Wauthy <pollux at xfce.org>
+
+ * ChangeLog, po/ChangeLog, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h:
+ update ChangeLog
+
+2005-08-14 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/POTFILES.in, po/fr.po, po/xfburn.pot,
+ xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-usage.c, xfburn/xfburn-disc-usage.h:
+ add disc content popup menu
+ * xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-utils.c:
+ first release won't have a treestore that's all (gtktreeview
+ sucks)
+ * xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-utils.c:
+ disc content is now a treeview accepting DnD
+ * xfburn/xfburn-copy-cd-dialog.c,
+ xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-fs-browser.c:
+ commit before messing with the content treestore
+
+2005-08-13 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-file-browser.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-settings.c, xfburn/xfburn-settings.h:
+ some settings stuff
+ * ., configure.ac, po/fr.po, po/xfburn.pot, xfburn.ui,
+ xfburn/Makefile.am, xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-copy-cd-dialog.c, xfburn/xfburn-copy-cd-dialog.h,
+ xfburn/xfburn-disc-content.c, xfburn/xfburn-disc-content.h,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main.c, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-settings.c, xfburn/xfburn-settings.h,
+ xfburn/xfburn-utils.c:
+ add settings load/save support
+
+2005-08-12 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.h:
+ improve burning dialog
+ * xfburn/xfburn-progress-dialog.c:
+ burn ISO working in no error use case
+
+2005-08-11 Jean-François Wauthy <pollux at xfce.org>
+
+ * TODO, po/fr.po, po/xfburn.pot, xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-progress-dialog.c:
+ can burn iso but without feedback
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h:
+ complete cdrw blanking support
+ * po/POTFILES.in, po/fr.po, po/xfburn.pot:
+ update po
+ * xfburn/xfburn-progress-dialog.c:
+ gtk uses UTF-8 internally not the current charset
+ * xfburn/xfburn-progress-dialog.c:
+ cdrecord is written in ISO-8859-1, so we need to convert to the
+ current locale before inserting it int the textview
+
+2005-08-10 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-progress-dialog.c:
+ improve progress dialog
+ * TODO, po/POTFILES.in, po/fr.po, po/xfburn.pot,
+ xfburn/xfburn-progress-dialog.c:
+ should be able to blank cdrw
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-progress-dialog.c:
+ commit before messing things up
+ * xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-progress-dialog.c, xfburn/xfburn-progress-dialog.h:
+ fix compilation
+
+2005-08-09 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burning-dialog.c, xfburn/xfburn-burning-dialog.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-progress-dialog.c,
+ xfburn/xfburn-progress-dialog.h, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ draft of progress dialog
+
+2005-08-07 Jean-François Wauthy <pollux at xfce.org>
+
+ * po/POTFILES.in, po/fr.po, po/xfburn.pot, xfburn/Makefile.am,
+ xfburn/xfburn-burn-image-dialog.h,
+ xfburn/xfburn-burning-dialog.c, xfburn/xfburn-burning-dialog.h,
+ xfburn/xfburn-main-window.c:
+ add burning dialog
+ * xfburn/Makefile.am, xfburn/xfburn-blank-cd-dialog.c,
+ xfburn/xfburn-burn-image-dialog.c,
+ xfburn/xfburn-burn-image-dialog.h, xfburn/xfburn-main-window.c:
+ add burn image dialog
+ * po/POTFILES.in:
+ add burn image dialog
+ * po/ChangeLog, po/POTFILES.in, xfburn/Makefile.am,
+ xfburn/xfburn-blank-cd-dialog.c, xfburn/xfburn-blank-cd-dialog.h,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-global.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main.c,
+ xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ add blank cdrw dialog
+ * xfburn/xfburn-preferences-dialog.c, xfburn/xfburn-utils.c:
+ add drive capabilities dectection
+ * po/POTFILES.in, po/fr.po, po/xfburn.pot:
+ update po
+
+2005-08-06 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-global.h, xfburn/xfburn-main.c,
+ xfburn/xfburn-preferences-dialog.c, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ probe for cdrom devices
+ * xfburn/Makefile.am, xfburn/xfburn-main.c,
+ xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h, xfburn/xfburn-utils.c:
+ fix icon loading when prefix in set to an unusual location
+ * ChangeLog, po/ChangeLog:
+ more ChangeLog
+ * ChangeLog, po/ChangeLog:
+ ChangeLog script working
+ * ChangeLog, configure.ac, po/ChangeLog, po/fr.po, po/xfburn.pot,
+ xfburn.ui:
+ update Changelogs
+
+2005-08-05 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-main-window.c, xfburn/xfburn-preferences-dialog.c:
+ basic GUI is done, now let's get our hands dirty
+ * xfburn/Makefile.am, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-preferences-dialog.c,
+ xfburn/xfburn-preferences-dialog.h:
+ add preferences dialog
+
+2005-08-04 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h:
+ progress bar
+ * configure.ac, xfburn/Makefile.am,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-disc-usage.c,
+ xfburn/xfburn-disc-usage.h:
+ add disc-usage class
+
+2005-08-03 Jean-François Wauthy <pollux at xfce.org>
+
+ * pixmaps, xfburn-toolbars.ui, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main.c:
+ content toolbar
+ * pixmaps/Makefile, pixmaps/Makefile.in:
+ remove autogenerated files
+ * Makefile.am, Xfburn.ui, configure.ac, pixmaps, pixmaps/Makefile,
+ pixmaps/Makefile.am, pixmaps/Makefile.in,
+ pixmaps/baker-audio-copy.png, pixmaps/baker-blank-cdrw.png,
+ pixmaps/baker-blank-dvdrw.png, pixmaps/baker-burn-cd.png,
+ pixmaps/baker-cd.png, pixmaps/baker-data-copy.png,
+ pixmaps/baker-import-session.png, po/fr.po, po/xfburn.pot,
+ xfburn-toolbars.ui, xfburn.ui, xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-utils.c,
+ xfburn/xfburn-utils.h:
+ add pixmaps
+ * xfburn/xfburn-disc-content.c, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-main.c:
+ messing with ExoToolBars*
+ * xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h:
+ compute and show dir and file sizes
+ * xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c:
+ use liststore instead of treestore for disc content and directory
+ browser
+
+2005-08-02 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-main-window.c:
+ basic DnD between filebrowser and cd content
+ * xfburn/xfburn-file-browser.c:
+ fix filebrowser bug
+
+2005-08-01 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-directory-browser.c, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-file-browser.c:
+ tiny filebrowser working
+ * xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-file-browser.c, xfburn/xfburn-fs-browser.c:
+ more browser stuff
+
+2005-07-31 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/Makefile.am, xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-fs-browser.c:
+ more code
+ * xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.h,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-main-window.h:
+ fs-browser allows browsing :)
+ * po/POTFILES.in, po/fr.po, po/xfburn.pot,
+ xfburn/xfburn-fs-browser.c, xfburn/xfburn-fs-browser.h,
+ xfburn/xfburn-main-window.c:
+ basic directory load (only first level)
+ * configure.ac, xfburn/Makefile.am,
+ xfburn/xfburn-directory-browser.c,
+ xfburn/xfburn-directory-browser.h, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-file-browser.c,
+ xfburn/xfburn-file-browser.h, xfburn/xfburn-fs-browser.c,
+ xfburn/xfburn-fs-browser.h, xfburn/xfburn-main-window.c,
+ xfburn/xfburn-main-window.h, xfburn/xfburn-main.c:
+ add empty class for directory and fs browser
+
+2005-07-30 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/xfburn-file-browser.c, xfburn/xfburn-file-browser.h,
+ xfburn/xfburn-filebrowser.c, xfburn/xfburn-filebrowser.h,
+ xfburn/xfburn-main-window.c, xfburn/xfburn-main-window.h,
+ xfburn/xfburn-mainwindow.c, xfburn/xfburn-mainwindow.h:
+ renaming some files
+ * xfburn/Makefile.am, xfburn/xfburn-disc-content.c,
+ xfburn/xfburn-disc-content.h, xfburn/xfburn-mainwindow.c:
+ add disc content empty class
+ * ., Makefile.am, Xfburn.ui, po/POTFILES.in, po/fr.po,
+ po/xfburn.pot, xfburn/Makefile.am, xfburn/xfburn-filebrowser.c,
+ xfburn/xfburn-filebrowser.h, xfburn/xfburn-main.c,
+ xfburn/xfburn-mainwindow.c, xfburn/xfburn-mainwindow.h:
+ still the GUI
+ * xfburn/Makefile.am, xfburn/xfburn-main.c,
+ xfburn/xfburn-mainwindow.c, xfburn/xfburn-mainwindow.h:
+ basic main window with menubar and about dialog
+ * xfburn/Makefile.am, xfburn/main.c, xfburn/mainwin.c,
+ xfburn/mainwin.h, xfburn/xfburn-main.c,
+ xfburn/xfburn-mainwindow.c, xfburn/xfburn-mainwindow.h:
+ rename files
+
+2005-07-29 Jean-François Wauthy <pollux at xfce.org>
+
+ * xfburn/main.c, xfburn/mainwin.c, xfburn/mainwin.h:
+ rename namespace
+ * configure.ac, xfburn/Makefile.am, xfburn/main.c,
+ xfburn/mainwin.c, xfburn/mainwin.h:
+ add dep on exo
+ * ., COPYING, po, xfburn, xfburn/main.c:
+ update svn:ignore
+ * po/fr.po:
+ fix fr.po
+ * autogen.sh, po/POTFILES.in, po/fr.po, po/xfburn.pot:
+ xdt-autogen works
+ * AUTHORS, ChangeLog, Makefile.am, NEWS, README, configure.ac, po,
+ po/ChangeLog, po/POTFILES.in, xfburn, xfburn/Makefile.am,
+ xfburn/main.c:
+ should work with xdt-autogen
+ * .:
+ base layout
+
Deleted: xfburn/tags/xfburn-0.3.2/NEWS
Copied: xfburn/tags/xfburn-0.3.2/NEWS (from rev 5094, xfburn/trunk/NEWS)
===================================================================
--- xfburn/tags/xfburn-0.3.2/NEWS (rev 0)
+++ xfburn/tags/xfburn-0.3.2/NEWS 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,72 @@
+xfburn 0.3.2 (2008-07-15)
+============-------------
+
+- Also set burn speed when burning an image
+- Fix bug which would complain about missing speed list when blanking
+ after the question from the burn composition dialog
+- Bugfix: wait in main() to let the dialogs run when there is no main
+ window
+- Update many translations
+
+xfburn 0.3.1 (2008-07-10)
+============-------------
+
+- Implemented basic CLI options
+- Actually set speed in burn backend
+
+ WARNING: my dvd test burn failed if a speed was set!! CD was ok though.
+
+ Use "Max" as speed if that is the case for you to get the old behavior,
+ and _please_ report this as a bug! Please include the console output if
+ debug is enabled, or otherwise some info on the burner that was used.
+- Use fifo buffering, default is 4MB, adjustable in the preferences
+- Preserve file attributes
+- Now using threads for adding files, and the adding can get aborted
+- If the burning dialog comes up with a full but erasable disc in the drive,
+ prompt to show the blanking dialog
+
+xfburn 0.3.0
+============
+
+- Use new libisofs API
+- DVD burning
+- Formating and deformating of DVD-RW discs
+- Removed buttons for not yet working functionality
+- Use HAL to update disc status when a disc is inserted / removed
+- Disable "Burn composition" button where there is no files in composition
+
+- Use libburn (libburnia-project.org) instead of cdrecord tools
+- Avoid adding non regular files (bug #2179)
+- Directory are sort before files in data composition
+- Fix segfault when removing a file and one of its parent directory together
+- Try to use media-optical and media-cdrom as themable icon before gtk-cdrom in order to avoid crappy png icon being shown in Preferences dialog
+- Fix icon size in filesystem browser
+- Add icons for actions based on icons from the Tango icontheme
+- Detect and sort supported write speeds (#4012)
+- Add support for writing ISO from a composition using libburn
+- Add support for burning a composition using libburn
+- Use correct cdrom size (bug #2753)
+- Add new icons based on icons from the Tango icontheme
+- List columns are resizable now (bug #2930)
+
+xfburn 0.2.0beta
+================
+
+- Use g_type_class_add_private everywhere
+- Data composition and file browser use ExoTreeView instead of GtkTreeView
+- Add DnD inside data composition
+- Prevent having two 'New directory' entries in a data composition
+- Add support of SAO mode (bug #2121)
+- Add create directory action in data composition
+- Prevent usage of empty filename in data composition
+- Fix xfburn.desktop Categories entry as suggested by Charles A Edwards <eslrahc at bellsouth.net>
+- Implement the add button in the data composition toolbar (bug #2097)
+- Avoid segfault on exit when ~/.config/xfburn doesn't exist (bug #2095)
+- Prevent cdrecord failure if there is a space in the path to an iso (bug #1198)
+
+xfburn 0.1.0alpha
+=================
+
+- First public release
+- Supports cdrw blanking, cd copying, creating iso, composition of files
+
Deleted: xfburn/tags/xfburn-0.3.2/README
Copied: xfburn/tags/xfburn-0.3.2/README (from rev 5094, xfburn/trunk/README)
===================================================================
--- xfburn/tags/xfburn-0.3.2/README (rev 0)
+++ xfburn/tags/xfburn-0.3.2/README 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,61 @@
+==============================================================================
+xfburn
+------
+
+Version 0.3.2, 2008-07-xx
+
+http://www.xfce.org/projects/xfburn/
+
+An easy to use burning software for the xfce desktop environment (but of
+course will work with others). It uses libburn and libisofs as a backend, in
+difference to most other GUI programs at the moment. Visit
+http://www.libburnia-project.org/ for more information about these libraries.
+
+==============================================================================
+Functionality
+-------------
+
+xfburn is still a new program, and does not yet do all common burning related
+tasks.
+
+Currently implemented is:
+ * Create data compositions
+ - Burn to CD or DVD
+ - Create ISO images
+ * Burn ISO images
+ * Blank discs
+ * Format and deformat DVD-RW discs
+
+==============================================================================
+Future Plans
+------------
+
+Missing functionality that we plan to add:
+ * Save and load compositions
+ * Verification
+ * Burn audio CDs
+ * Copy discs (needs backend support)
+ * Automatic checksum creation
+ * Blu-ray support
+ * Plugin support
+
+There is no, and never will be, a timeline for these. Let us know if you think
+something is missing on this list. If you really need something implemented,
+feel free to help us out :-).
+
+==============================================================================
+Bugs & Feedback
+---------------
+
+Any comments are welcome! We aim to make xfburn a very easily usable program.
+So if you think something could be implemented differently, feel free to speak
+up and it will be considered. Please send all feedbacks to xfburn at xfce.org, or
+use the xfce mailing lists. Bugs are best placed in the xfce bugtracker at
+http://bugzilla.xfce.org/
+
+==============================================================================
+License
+-------
+
+This program is released under the GNU GPL version 2 or newer. See COPYING for
+the full text of the license.
Copied: xfburn/tags/xfburn-0.3.2/xfburn (from rev 5094, xfburn/trunk/xfburn)
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am
Copied: xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am (from rev 5093, xfburn/trunk/xfburn/Makefile.am)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/Makefile.am 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,109 @@
+INCLUDES = \
+ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
+ -DEXO_API_SUBJECT_TO_CHANGE \
+ -DEXO_DISABLE_DEPRECATED \
+ -DDATADIR=\"$(datadir)\" \
+ -I$(top_srcdir)
+
+bin_PROGRAMS = \
+ xfburn
+
+xfburn_headers = \
+ xfburn-global.h \
+ xfburn-adding-progress.h \
+ xfburn-blank-dialog.h \
+ xfburn-perform-burn.h \
+ xfburn-burn-data-composition-base-dialog.h \
+ xfburn-burn-data-cd-composition-dialog.h \
+ xfburn-burn-data-dvd-composition-dialog.h \
+ xfburn-burn-image-dialog.h \
+ xfburn-settings.h \
+ xfburn-composition.h \
+ xfburn-compositions-notebook.h \
+ xfburn-copy-cd-dialog.h \
+ xfburn-copy-cd-progress-dialog.h \
+ xfburn-copy-dvd-dialog.h \
+ xfburn-create-iso-progress-dialog.h \
+ xfburn-hal-manager.h \
+ xfburn-device-box.h \
+ xfburn-device-list.h \
+ xfburn-format-dvd-dialog.h \
+ xfburn-progress-dialog.h \
+ xfburn-main-window.h \
+ xfburn-notebook-tab.h \
+ xfburn-file-browser.h \
+ xfburn-welcome-tab.h \
+ xfburn-data-composition.h \
+ xfburn-data-disc-usage.h \
+ xfburn-fs-browser.h \
+ xfburn-directory-browser.h \
+ xfburn-preferences-dialog.h \
+ xfburn-stock.h \
+ xfburn-utils.h \
+ xfburn-main.h
+
+xfburn_SOURCES = \
+ $(xfburn_headers) \
+ xfburn-adding-progress.c \
+ xfburn-blank-dialog.c \
+ xfburn-perform-burn.c \
+ xfburn-burn-data-composition-base-dialog.c \
+ xfburn-burn-data-cd-composition-dialog.c \
+ xfburn-burn-data-dvd-composition-dialog.c \
+ xfburn-burn-image-dialog.c \
+ xfburn-composition.c \
+ xfburn-compositions-notebook.c \
+ xfburn-settings.c \
+ xfburn-copy-dvd-dialog.c \
+ xfburn-hal-manager.c \
+ xfburn-device-box.c \
+ xfburn-device-list.c \
+ xfburn-format-dvd-dialog.c \
+ xfburn-progress-dialog.c \
+ xfburn-main.c \
+ xfburn-main-window.c \
+ xfburn-notebook-tab.c \
+ xfburn-file-browser.c \
+ xfburn-welcome-tab.c \
+ xfburn-data-composition.c \
+ xfburn-data-disc-usage.c \
+ xfburn-fs-browser.c \
+ xfburn-directory-browser.c \
+ xfburn-preferences-dialog.c \
+ xfburn-stock.c \
+ xfburn-utils.c
+
+xfburn_CFLAGS = \
+ $(GTHREAD_CFLAGS) \
+ $(LIBBURN_CFLAGS) \
+ $(LIBISOFS_CFLAGS) \
+ $(LIBXFCEGUI4_CFLAGS) \
+ $(EXO_CFLAGS) \
+ $(THUNAR_VFS_CFLAGS)
+
+xfburn_LDADD = \
+ $(GTHREAD_LIBS) \
+ $(LIBBURN_LIBS) \
+ $(LIBISOFS_LIBS) \
+ $(LIBXFCEGUI4_LIBS) \
+ $(EXO_LIBS) \
+ $(THUNAR_VFS_LIBS)
+
+if HAVE_HAL
+xfburn_CFLAGS += \
+ $(HAL_CFLAGS)
+
+xfburn_LDADD += \
+ $(HAL_LIBS)
+ $(HAL_DBUS_LIBS)
+
+endif
+
+# remove these when they're added to the build; needed
+# for make distcheck (--brian)
+missing_files = \
+ xfburn-copy-cd-dialog.c \
+ xfburn-copy-cd-progress-dialog.c \
+ xfburn-create-iso-progress-dialog.c
+
+EXTRA_DIST = $(missing_files)
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c (from rev 5093, xfburn/trunk/xfburn/xfburn-adding-progress.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,203 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-global.h"
+#include "xfburn-adding-progress.h"
+#include "xfburn-utils.h"
+
+#define XFBURN_ADDING_PROGRESS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_ADDING_PROGRESS, XfburnAddingProgressPrivate))
+
+enum {
+ ADDING_DONE,
+ LAST_SIGNAL,
+};
+
+/* private struct */
+typedef struct
+{
+ GtkWidget *progress_bar;
+ gboolean aborted;
+} XfburnAddingProgressPrivate;
+
+/* prototypes */
+static void xfburn_adding_progress_class_init (XfburnAddingProgressClass *);
+static void xfburn_adding_progress_init (XfburnAddingProgress *);
+static void xfburn_adding_progress_finalize (GObject * object);
+static gboolean cb_delete (GtkWidget *widget, GdkEvent *event, gpointer data);
+
+/* globals */
+static GtkWindowClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL];
+
+/******************************/
+/* XfburnAddingProgress class */
+/******************************/
+
+GtkType
+xfburn_adding_progress_get_type (void)
+{
+ static GtkType adding_progress_type = 0;
+
+ if (!adding_progress_type)
+ {
+ static const GTypeInfo adding_progress_info = {
+ sizeof (XfburnAddingProgressClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_adding_progress_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnAddingProgress),
+ 0,
+ (GInstanceInitFunc) xfburn_adding_progress_init
+ };
+
+ adding_progress_type = g_type_register_static (GTK_TYPE_WINDOW, "XfburnAddingProgress", &adding_progress_info, 0);
+ }
+
+ return adding_progress_type;
+}
+
+static void
+xfburn_adding_progress_class_init (XfburnAddingProgressClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnAddingProgressPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_adding_progress_finalize;
+
+ signals[ADDING_DONE] = g_signal_new ("adding-done", XFBURN_TYPE_ADDING_PROGRESS, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnAddingProgressClass, adding_done),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+}
+
+static void
+xfburn_adding_progress_init (XfburnAddingProgress * win)
+{
+ XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (win);
+ GtkWidget *vbox;
+
+ gtk_window_set_resizable (GTK_WINDOW (win), FALSE);
+
+ gtk_window_set_icon_name (GTK_WINDOW (win), GTK_STOCK_ADD);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (win), TRUE);
+ gtk_window_set_title (GTK_WINDOW (win), _("Adding files to the composition"));
+
+ vbox = gtk_vbox_new (FALSE, 5);
+ gtk_widget_show (vbox);
+ gtk_container_add (GTK_CONTAINER (win), vbox);
+
+ priv->progress_bar = gtk_progress_bar_new ();
+ gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (priv->progress_bar), 0.01);
+ gtk_widget_show (priv->progress_bar);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->progress_bar, TRUE, TRUE, BORDER);
+
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress_bar), 0.5);
+
+ priv->aborted = FALSE;
+ g_signal_connect (G_OBJECT (win), "delete-event", G_CALLBACK (cb_delete), NULL);
+}
+
+static void
+xfburn_adding_progress_finalize (GObject * object)
+{
+ //XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (object);
+
+}
+
+/* internals */
+
+static gboolean
+cb_delete (GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+ XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (widget);
+ priv->aborted = TRUE;
+
+ return TRUE;
+}
+
+/******************/
+/* public methods */
+/******************/
+
+/*
+ * These functions are expected to be called from the gui thread
+ */
+XfburnAddingProgress *
+xfburn_adding_progress_new (void)
+{
+ GtkWidget *obj;
+
+ obj = g_object_new (xfburn_adding_progress_get_type (), NULL);
+
+ gtk_widget_realize (obj);
+
+ return XFBURN_ADDING_PROGRESS (obj);
+}
+
+/*
+ * these functions are expected to be called from the secondary thread
+ */
+void
+xfburn_adding_progress_pulse (XfburnAddingProgress *adding_progress)
+{
+ XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (adding_progress);
+
+ gdk_threads_enter ();
+ //DBG ("pulse");
+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (priv->progress_bar));
+ gdk_threads_leave ();
+}
+
+void
+xfburn_adding_progress_done (XfburnAddingProgress *adding_progress)
+{
+ //XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (adding_progress);
+
+ gdk_threads_enter ();
+ g_signal_emit (G_OBJECT (adding_progress), signals[ADDING_DONE], 0);
+ gdk_threads_leave ();
+}
+
+gboolean
+xfburn_adding_progress_is_aborted (XfburnAddingProgress *adding_progress)
+{
+ XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (adding_progress);
+
+ return priv->aborted;
+}
+
+void xfburn_adding_progress_show (XfburnAddingProgress *adding_progress)
+{
+ XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (adding_progress);
+
+ priv->aborted = FALSE;
+ gtk_widget_show (GTK_WIDGET (adding_progress));
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h (from rev 5093, xfburn/trunk/xfburn/xfburn-adding-progress.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-adding-progress.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,60 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_ADDING_PROGRESS_H__
+#define __XFBURN_ADDING_PROGRESS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "xfburn-data-composition.h"
+
+G_BEGIN_DECLS
+#define XFBURN_TYPE_ADDING_PROGRESS (xfburn_adding_progress_get_type ())
+#define XFBURN_ADDING_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_ADDING_PROGRESS, XfburnAddingProgress))
+#define XFBURN_ADDING_PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_ADDING_PROGRESS, XfburnAddingProgressClass))
+#define XFBURN_IS_ADDING_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_ADDING_PROGRESS))
+#define XFBURN_IS_ADDING_PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_ADDING_PROGRESS))
+#define XFBURN_ADDING_PROGRESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_ADDING_PROGRESS, XfburnAddingProgressClass))
+
+typedef struct
+{
+ GtkWindow window;
+} XfburnAddingProgress;
+
+typedef struct
+{
+ GtkWindowClass parent_class;
+ void (*adding_done) (XfburnAddingProgress *progress, XfburnDataComposition *dc);
+} XfburnAddingProgressClass;
+
+GtkType xfburn_adding_progress_get_type (void);
+
+XfburnAddingProgress *xfburn_adding_progress_new (void);
+void xfburn_adding_progress_pulse (XfburnAddingProgress *adding_progress);
+void xfburn_adding_progress_wait_until_done (XfburnAddingProgress *adding_progress);
+void xfburn_adding_progress_done (XfburnAddingProgress *adding_progress);
+gboolean xfburn_adding_progress_is_aborted (XfburnAddingProgress *adding_progress);
+void xfburn_adding_progress_show (XfburnAddingProgress *adding_progress);
+
+G_END_DECLS
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-blank-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,561 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <libburn.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-progress-dialog.h"
+#include "xfburn-device-box.h"
+#include "xfburn-stock.h"
+#include "xfburn-hal-manager.h"
+#include "xfburn-main.h"
+
+#include "xfburn-blank-dialog.h"
+
+#define XFBURN_BLANK_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_BLANK_DIALOG, XfburnBlankDialogPrivate))
+
+#define XFBURN_BLANK_DIALOG_EJECT_DEFAULT TRUE
+
+enum {
+ PROP_0,
+ PROP_EJECT,
+};
+
+typedef struct
+{
+ GtkWidget *device_box;
+ GtkWidget *combo_type;
+ GtkWidget *button_blank;
+
+ GtkWidget *check_eject;
+ gboolean eject;
+} XfburnBlankDialogPrivate;
+
+/* FIXME: the 128MB comes from cdrskin, but why? Is this really complete? */
+#define XFBURN_FORMAT_COMPLETE_SIZE 128*1024*1024
+
+typedef enum {
+ XFBURN_BLANK_FAST, /* erase w/ fast flag */
+ XFBURN_BLANK_COMPLETE, /* erase, no flag */
+ XFBURN_FORMAT_FAST, /* DVD+RW sequential (0x13) to overwritable (0x14), zero size */
+ XFBURN_FORMAT_COMPLETE, /* DVD+RW sequential (0x13) to overwritable (0x14), 128MB, flag=1*/
+ XFBURN_DEFORMAT_FAST, /* same as fast blank */
+ XFBURN_DEFORMAT_COMPLETE, /* same as complete blank */
+ XFBURN_BLANK_MODE_LAST,
+} XfburnBlankMode;
+
+static char * blank_mode_names[] = {
+ N_("Quick Blank"),
+ N_("Full Blank (slow)"),
+ N_("Quick Format"),
+ N_("Full Format"),
+ N_("Quick Deformat"),
+ N_("Full Deformat (slow)"),
+ };
+
+enum {
+ BLANK_COMBO_NAME_COLUMN,
+ BLANK_COMBO_MODE_COLUMN,
+ BLANK_COMBO_N_COLUMNS,
+};
+
+typedef struct {
+ GtkWidget *dialog_progress;
+ XfburnDevice *device;
+ XfburnBlankMode blank_mode;
+ gboolean eject;
+} ThreadBlankParams;
+
+/* internal prototypes */
+
+static void xfburn_blank_dialog_class_init (XfburnBlankDialogClass * klass);
+static void xfburn_blank_dialog_init (XfburnBlankDialog * sp);
+static void xfburn_blank_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void xfburn_blank_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+
+static gboolean is_valid_blank_mode (XfburnDevice *device, XfburnBlankMode mode);
+static void fill_combo_mode (XfburnBlankDialog *dialog);
+//static GList * get_valid_blank_modes (XfburnDevice *device);
+static XfburnBlankMode get_selected_mode (XfburnBlankDialogPrivate *priv);
+static gboolean thread_blank_perform_blank (ThreadBlankParams * params, struct burn_drive_info *drive_info);
+static void thread_blank (ThreadBlankParams * params);
+static void xfburn_blank_dialog_response_cb (XfburnBlankDialog * dialog, gint response_id, gpointer user_data);
+static void cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBlankDialog * dialog);
+
+static XfceTitledDialogClass *parent_class = NULL;
+
+
+
+GtkType
+xfburn_blank_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnBlankDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_blank_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnBlankDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_blank_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnBlankDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_blank_dialog_class_init (XfburnBlankDialogClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+ object_class->set_property = xfburn_blank_dialog_set_property;
+ object_class->get_property = xfburn_blank_dialog_get_property;
+
+ g_type_class_add_private (klass, sizeof (XfburnBlankDialogPrivate));
+
+ g_object_class_install_property (object_class, PROP_EJECT,
+ g_param_spec_boolean ("eject", _("Eject the disc"),
+ _("Default value for eject checkbox"), XFBURN_BLANK_DIALOG_EJECT_DEFAULT, G_PARAM_READWRITE));
+}
+
+static void
+xfburn_blank_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_EJECT:
+ g_value_set_boolean (value, priv->eject);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_blank_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_EJECT:
+ priv->eject = g_value_get_boolean (value);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), priv->eject);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_blank_dialog_init (XfburnBlankDialog * obj)
+{
+ XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (obj);
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ GdkPixbuf *icon = NULL;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *button;
+
+ GtkListStore *store = NULL;
+ GtkCellRenderer *cell;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Blank CD-RW"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_BLANK_CDRW, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* devices list */
+ priv->device_box = xfburn_device_box_new (SHOW_CDRW_WRITERS | BLANK_MODE);
+ g_signal_connect (G_OBJECT (priv->device_box), "disc-refreshed", G_CALLBACK (cb_disc_refreshed), obj);
+ gtk_widget_show (priv->device_box);
+
+ frame = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* blank mode */
+ store = gtk_list_store_new (BLANK_COMBO_N_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
+ priv->combo_type = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (store);
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_type), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->combo_type), cell, "text", BLANK_COMBO_NAME_COLUMN, NULL);
+ gtk_widget_show (priv->combo_type);
+
+ frame = xfce_create_framebox_with_content (_("Blank mode"), priv->combo_type);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), XFBURN_BLANK_DIALOG_EJECT_DEFAULT);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ button = xfce_create_mixed_button ("xfburn-blank-cdrw", _("_Blank"));
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button);
+ gtk_widget_grab_default (button);
+ priv->button_blank = button;
+
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_blank_dialog_response_cb), obj);
+ fill_combo_mode (obj);
+}
+
+static void fill_combo_mode (XfburnBlankDialog *dialog)
+{
+ XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (dialog);
+ XfburnBlankMode mode = XFBURN_BLANK_FAST;
+ GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_type));
+ int n = 0;
+
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ while (mode < XFBURN_BLANK_MODE_LAST) {
+ if (is_valid_blank_mode (NULL, mode)) {
+ GtkTreeIter iter;
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, BLANK_COMBO_NAME_COLUMN, _(blank_mode_names[mode]), BLANK_COMBO_MODE_COLUMN, mode, -1);
+ n++;
+ }
+ mode++;
+ }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo_type), 0);
+ gtk_widget_set_sensitive (priv->button_blank, n > 0);
+}
+
+static gboolean is_valid_blank_mode (XfburnDevice *device, XfburnBlankMode mode)
+{
+ int profile_no = xfburn_device_list_get_profile_no ();
+ gboolean erasable = xfburn_device_list_disc_is_erasable ();
+ enum burn_disc_status disc_state = xfburn_device_list_get_disc_status ();
+
+ if (profile_no == 0x13) {
+ /* in 0x14 no blanking is needed, we can only deformat */
+ if (mode == XFBURN_DEFORMAT_FAST || mode == XFBURN_DEFORMAT_COMPLETE)
+ return TRUE;
+ else
+ return FALSE;
+ }
+
+ if (profile_no == 0x14 && (mode == XFBURN_FORMAT_FAST || mode == XFBURN_FORMAT_COMPLETE))
+ return TRUE;
+
+ if (erasable && (disc_state != BURN_DISC_BLANK) && (mode == XFBURN_BLANK_FAST || mode == XFBURN_BLANK_COMPLETE))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+static GList * get_valid_blank_modes (XfburnDevice *device)
+{
+ XfburnBlankMode mode = XFBURN_BLANK_FAST;
+ GList *modes = NULL;
+
+ while (mode < XFBURN_BLANK_MODE_LAST) {
+ if (is_valid_blank_mode (device, mode))
+ modes = g_list_append (modes, GINT_TO_POINTER (mode));
+ mode++;
+ }
+
+ return modes;
+}
+*/
+
+static gboolean
+thread_blank_perform_blank (ThreadBlankParams * params, struct burn_drive_info *drive_info)
+{
+ GtkWidget *dialog_progress = params->dialog_progress;
+
+ struct burn_drive *drive;
+ enum burn_disc_status disc_state;
+ struct burn_progress progress;
+
+ int ret;
+ gboolean error = FALSE;
+ int error_code;
+ char msg_text[BURN_MSGS_MESSAGE_LEN];
+ int os_errno;
+ char severity[80];
+ const char *final_status_text;
+ XfburnProgressDialogStatus final_status;
+ gchar *final_message = NULL;
+
+ drive = drive_info->drive;
+
+ while (burn_drive_get_status (drive, NULL) != BURN_DRIVE_IDLE) {
+ usleep (1001);
+ }
+
+ while ( (disc_state = burn_disc_get_status (drive)) == BURN_DISC_UNREADY)
+ usleep (1001);
+
+ switch (disc_state) {
+ case BURN_DISC_BLANK:
+ if (params->blank_mode == XFBURN_BLANK_FAST || params->blank_mode == XFBURN_BLANK_COMPLETE) {
+ /* blanking can only be performed on blank discs, format and deformat are allowed to be blank ones */
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("The inserted disc is already blank"));
+ return FALSE;
+ }
+ case BURN_DISC_FULL:
+ case BURN_DISC_APPENDABLE:
+ /* these ones we can blank */
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Ready"));
+ break;
+ case BURN_DISC_EMPTY:
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("No disc detected in the drive"));
+ return FALSE;
+ default:
+ //xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot recognize drive and media state"));
+ //return FALSE;
+ break;
+ }
+
+ if (!burn_disc_erasable (drive)) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Media is not erasable"));
+ return FALSE;
+ }
+
+ /* set us up to receive fatal errors */
+ ret = burn_msgs_set_severities ("ALL", "NEVER", "libburn");
+
+ if (ret <= 0)
+ g_warning ("Failed to set libburn message severities, burn errors might not get detected!");
+
+ switch (params->blank_mode) {
+ case XFBURN_BLANK_FAST:
+ //DBG ("blank_fast");
+ burn_disc_erase(drive, 1);
+ break;
+ case XFBURN_BLANK_COMPLETE:
+ //DBG ("blank_complete");
+ burn_disc_erase(drive, 0);
+ break;
+ case XFBURN_FORMAT_FAST:
+ //DBG ("format_fast");
+ burn_disc_format(drive, 0, 0);
+ break;
+ case XFBURN_FORMAT_COMPLETE:
+ //DBG ("format_complete");
+ burn_disc_format(drive, XFBURN_FORMAT_COMPLETE_SIZE, 1);
+ break;
+ case XFBURN_DEFORMAT_FAST:
+ //DBG ("deformat_fast");
+ burn_disc_erase(drive, 1);
+ break;
+ case XFBURN_DEFORMAT_COMPLETE:
+ //DBG ("deformat_complete");
+ burn_disc_erase(drive, 0);
+ break;
+ default:
+ g_error ("Invalid blank mode %d, this is a bug.", params->blank_mode);
+ }
+ sleep(1);
+
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Blanking disc..."));
+
+ while ((disc_state = burn_drive_get_status (drive, &progress)) != BURN_DRIVE_IDLE) {
+ //DBG ("disc_state = %d", disc_state);
+ if(progress.sectors>0 && progress.sector>=0) {
+ gdouble percent = 1.0 + ((gdouble) progress.sector+1.0) / ((gdouble) progress.sectors) * 98.0;
+
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), percent / 100.0);
+ }
+ usleep(500000);
+ }
+
+ /* check the libburn message queue for errors */
+ while ((ret = burn_msgs_obtain ("FAILURE", &error_code, msg_text, &os_errno, severity)) == 1) {
+ g_warning ("[%s] %d: %s (%d)", severity, error_code, msg_text, os_errno);
+ error = TRUE;
+ }
+#ifdef DEBUG
+ while ((ret = burn_msgs_obtain ("ALL", &error_code, msg_text, &os_errno, severity)) == 1) {
+ g_warning ("[%s] %d: %s (%d)", severity, error_code, msg_text, os_errno);
+ }
+#endif
+
+ if (ret < 0)
+ g_warning ("Fatal error while trying to retrieve libburn message!");
+
+ if (G_LIKELY (!error)) {
+ final_message = g_strdup_printf (_("Done"));
+ final_status = XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED;
+ } else {
+ final_status_text = _("Failure");
+ final_status = XFBURN_PROGRESS_DIALOG_STATUS_FAILED;
+ final_message = g_strdup_printf ("%s: %s", final_status_text, msg_text);
+ }
+
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), final_status, final_message);
+ g_free (final_message);
+
+#ifdef HAVE_HAL
+ gdk_threads_enter ();
+ DBG ("blanking done!");
+ xfburn_hal_manager_send_volume_changed ();
+ gdk_threads_leave ();
+#endif
+
+ return TRUE;
+}
+
+static void
+thread_blank (ThreadBlankParams * params)
+{
+ struct burn_drive_info *drive_info = NULL;
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ g_free (params);
+ return;
+ }
+
+ if (!xfburn_device_grab (params->device, &drive_info)) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (params->dialog_progress), _("Unable to grab drive"));
+ } else {
+ thread_blank_perform_blank (params, drive_info);
+ burn_drive_release (drive_info->drive, params->eject ? 1 : 0);
+ }
+
+ burn_finish ();
+ g_free (params);
+
+ gdk_threads_enter ();
+ xfburn_hal_manager_send_volume_changed ();
+ gdk_threads_leave ();
+}
+
+static XfburnBlankMode
+get_selected_mode (XfburnBlankDialogPrivate *priv)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ XfburnBlankMode blank_mode;
+ gboolean ret;
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_type));
+ ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->combo_type), &iter);
+ if (ret)
+ gtk_tree_model_get (model, &iter, BLANK_COMBO_MODE_COLUMN, &blank_mode, -1);
+
+ return blank_mode;
+}
+
+static void
+xfburn_blank_dialog_response_cb (XfburnBlankDialog * dialog, gint response_id, gpointer user_data)
+{
+ if (response_id == GTK_RESPONSE_OK) {
+ XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (dialog);
+ XfburnDevice *device;
+
+ GtkWidget *dialog_progress;
+ ThreadBlankParams *params = NULL;
+
+ device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
+
+
+ dialog_progress = xfburn_progress_dialog_new (GTK_WINDOW (dialog));
+ g_object_set (dialog_progress, "animate", TRUE, NULL);
+
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ gtk_widget_show (dialog_progress);
+
+ params = g_new0 (ThreadBlankParams, 1);
+ params->dialog_progress = dialog_progress;
+ params->device = device;
+ params->blank_mode = get_selected_mode (priv);
+ params->eject = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject));
+ g_thread_create ((GThreadFunc) thread_blank, params, FALSE, NULL);
+ } else {
+ xfburn_main_leave_window ();
+ }
+}
+
+static void
+cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBlankDialog * dialog)
+{
+ //XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (dialog);
+
+ fill_combo_mode (dialog);
+}
+
+
+/* public */
+GtkWidget *
+xfburn_blank_dialog_new ()
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_BLANK_DIALOG, NULL));
+ cb_disc_refreshed (NULL, NULL, XFBURN_BLANK_DIALOG (obj));
+
+ xfburn_main_enter_window ();
+
+ return obj;
+}
+
+GtkWidget *
+xfburn_blank_dialog_new_eject (gboolean eject)
+{
+ GtkWidget *obj;
+
+ obj = xfburn_blank_dialog_new ();
+
+ g_object_set (G_OBJECT (obj), "eject", eject, NULL);
+
+ return obj;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-blank-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-blank-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,55 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_BLANK_DIALOG_H__
+#define __XFBURN_BLANK_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include "xfburn-global.h"
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_BLANK_DIALOG (xfburn_blank_dialog_get_type ())
+#define XFBURN_BLANK_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_BLANK_DIALOG, XfburnBlankDialog))
+#define XFBURN_BLANK_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_BLANK_DIALOG, XfburnBlankDialogClass))
+#define XFBURN_IS_BLANK_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_BLANK_DIALOG))
+#define XFBURN_IS_BLANK_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BLANK_DIALOG))
+#define XFBURN_BLANK_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BLANK_DIALOG, XfburnBlankDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnBlankDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnBlankDialogClass;
+
+GtkType xfburn_blank_dialog_get_type ();
+GtkWidget *xfburn_blank_dialog_new ();
+GtkWidget * xfburn_blank_dialog_new_eject (gboolean eject);
+
+G_END_DECLS
+#endif /* XFBURN_BLANK_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-cd-composition-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,120 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <errno.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-stock.h"
+
+#include "xfburn-burn-data-composition-base-dialog.h"
+#include "xfburn-burn-data-cd-composition-dialog.h"
+#include "xfburn-progress-dialog.h"
+
+#define XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG, XfburnBurnDataCdCompositionDialogPrivate))
+
+typedef struct
+{
+ gboolean dummy; /* An empty private struct is not allowed */
+} XfburnBurnDataCdCompositionDialogPrivate;
+
+/* prototypes */
+static void xfburn_burn_data_cd_composition_dialog_class_init (XfburnBurnDataCdCompositionDialogClass * klass);
+static void xfburn_burn_data_cd_composition_dialog_init (XfburnBurnDataCdCompositionDialog * obj);
+static void xfburn_burn_data_cd_composition_dialog_finalize (GObject * object);
+
+/* globals */
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_burn_data_cd_composition_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnBurnDataCdCompositionDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_burn_data_cd_composition_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnBurnDataCdCompositionDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_burn_data_cd_composition_dialog_init,
+ };
+
+ type = g_type_register_static (XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, "XfburnBurnDataCdCompositionDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_burn_data_cd_composition_dialog_class_init (XfburnBurnDataCdCompositionDialogClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (XfburnBurnDataCdCompositionDialogPrivate));
+
+ object_class->finalize = xfburn_burn_data_cd_composition_dialog_finalize;
+}
+
+static void
+xfburn_burn_data_cd_composition_dialog_init (XfburnBurnDataCdCompositionDialog * obj)
+{
+ //XfburnBurnDataCdCompositionDialogPrivate *priv = XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_GET_PRIVATE (obj);
+
+}
+
+static void
+xfburn_burn_data_cd_composition_dialog_finalize (GObject * object)
+{
+ //XfburnBurnDataCdCompositionDialogPrivate *priv = XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_GET_PRIVATE (object);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/* internals */
+/* empty for now */
+
+/* public */
+GtkWidget *
+xfburn_burn_data_cd_composition_dialog_new (IsoImage *image)
+{
+ XfburnBurnDataCdCompositionDialog *obj;
+
+ obj = XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG (g_object_new (XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG, "image", image, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-cd-composition-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-cd-composition-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,57 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_H__
+#define __XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <libisofs.h>
+#include "xfburn-burn-data-composition-base-dialog.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG (xfburn_burn_data_cd_composition_dialog_get_type ())
+#define XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG, XfburnBurnDataCdCompositionDialog))
+#define XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG, XfburnBurnDataCdCompositionDialogClass))
+#define XFBURN_IS_BURN_DATA_CD_COMPOSITION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG))
+#define XFBURN_IS_BURN_DATA_CD_COMPOSITION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG))
+#define XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BURN_DATA_CD_COMPOSITION_DIALOG, XfburnBurnDataCdCompositionDialogClass))
+
+typedef struct
+{
+ XfburnBurnDataCompositionBaseDialog parent;
+} XfburnBurnDataCdCompositionDialog;
+
+typedef struct
+{
+ XfburnBurnDataCompositionBaseDialogClass parent_class;
+} XfburnBurnDataCdCompositionDialogClass;
+
+GtkType xfburn_burn_data_cd_composition_dialog_get_type ();
+
+GtkWidget *xfburn_burn_data_cd_composition_dialog_new (IsoImage *image);
+
+G_END_DECLS
+#endif /* XFBURN_BURN_DATA_CD_COMPOSITION_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,704 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <errno.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-stock.h"
+#include "xfburn-settings.h"
+
+#include "xfburn-device-box.h"
+#include "xfburn-burn-data-composition-base-dialog.h"
+#include "xfburn-progress-dialog.h"
+#include "xfburn-perform-burn.h"
+
+#define XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, XfburnBurnDataCompositionBaseDialogPrivate))
+
+typedef struct
+{
+ IsoImage *image;
+
+ GtkWidget *frame_device;
+ GtkWidget *device_box;
+ GtkWidget *combo_mode;
+
+ GtkWidget *entry;
+ GtkWidget *check_eject;
+ GtkWidget *check_burnfree;
+ GtkWidget *check_only_iso;
+ GtkWidget *hbox_iso;
+ GtkWidget *entry_path_iso;
+ GtkWidget *check_dummy;
+ GtkWidget *button_proceed;
+ /*
+ * Disabled: change button_proceed functionality
+ GtkWidget *label_proceed;
+ GtkWidget *image_proceed;
+ */
+
+ gint response;
+} XfburnBurnDataCompositionBaseDialogPrivate;
+
+enum {
+ PROP_0,
+ PROP_IMAGE
+};
+
+/*
+ * Disabled: change button_proceed functionality
+char *proceed_text[] = {
+ "Burn Composition",
+ " Blank Disc ",
+};
+
+char *proceed_image[] = {
+ "xfburn-burn-cd",
+ "xfburn-blank-cdrw",
+};
+*/
+
+/* prototypes */
+static void xfburn_burn_data_composition_base_dialog_class_init (XfburnBurnDataCompositionBaseDialogClass * klass);
+static GObject * xfburn_burn_data_composition_base_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties);
+static void xfburn_burn_data_composition_base_dialog_finalize (GObject * object);
+
+static void xfburn_burn_data_composition_base_dialog_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec);
+static void xfburn_burn_data_composition_base_dialog_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec);
+
+/*
+ * Disabled: change button_proceed functionality
+GtkWidget * create_proceed_button (XfburnBurnDataCompositionBaseDialog * dialog, const gchar *stock, const gchar *text);
+void update_proceed_button (XfburnBurnDataCompositionBaseDialog * dialog);
+static void cb_proceed_clicked (GtkButton * button, XfburnBurnDataCompositionBaseDialog * dialog);
+*/
+static void cb_check_only_iso_toggled (GtkToggleButton * button, XfburnBurnDataCompositionBaseDialog * dialog);
+static void cb_browse_iso (GtkButton * button, XfburnBurnDataCompositionBaseDialog * dialog);
+static void cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog);
+static void cb_dialog_response (XfburnBurnDataCompositionBaseDialog * dialog, gint response_id,
+ XfburnBurnDataCompositionBaseDialogPrivate * priv);
+
+/* globals */
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_burn_data_composition_base_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnBurnDataCompositionBaseDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_burn_data_composition_base_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnBurnDataCompositionBaseDialog),
+ 0,
+ NULL,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnBurnDataCompositionBaseDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_burn_data_composition_base_dialog_class_init (XfburnBurnDataCompositionBaseDialogClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (XfburnBurnDataCompositionBaseDialogPrivate));
+
+ object_class->constructor = xfburn_burn_data_composition_base_dialog_constructor;
+ object_class->finalize = xfburn_burn_data_composition_base_dialog_finalize;
+ object_class->get_property = xfburn_burn_data_composition_base_dialog_get_property;
+ object_class->set_property = xfburn_burn_data_composition_base_dialog_set_property;
+
+ /* properties */
+ g_object_class_install_property (object_class, PROP_IMAGE,
+ g_param_spec_pointer ("image", "Image", "Image", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+}
+
+static GObject *
+xfburn_burn_data_composition_base_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties)
+{
+ GObject *gobj;
+ XfburnBurnDataCompositionBaseDialog *obj;
+ XfburnBurnDataCompositionBaseDialogPrivate *priv;
+
+ GdkPixbuf *icon = NULL;
+ GtkBox *box;
+ GtkWidget *img;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *align;
+ GtkWidget *button;
+ gchar *default_path;
+ gchar *tmp_dir;
+ const char *comp_name;
+
+ gobj = G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_properties, construct_properties);
+ obj = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG (gobj);
+ priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (obj);
+ box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Burn Composition"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_BURN_CD, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* burning devices list */
+ priv->device_box = xfburn_device_box_new (SHOW_CD_WRITERS | SHOW_CDRW_WRITERS | SHOW_MODE_SELECTION | SHOW_SPEED_SELECTION);
+ g_signal_connect (G_OBJECT (priv->device_box), "disc-refreshed", G_CALLBACK (cb_disc_refreshed), obj);
+ g_signal_connect (G_OBJECT (priv->device_box), "device-changed", G_CALLBACK (cb_disc_refreshed), obj);
+ gtk_widget_show (priv->device_box);
+
+ priv->frame_device = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
+ gtk_widget_show (priv->frame_device);
+ gtk_box_pack_start (box, priv->frame_device, FALSE, FALSE, BORDER);
+
+ /* composition name */
+ comp_name = iso_image_get_volume_id (priv->image);
+ if (strcmp (comp_name, _(DATA_COMPOSITION_DEFAULT_NAME)) == 0) {
+ GtkWidget *label;
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Composition name"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), _("<small>Would you like to change the default composition name?</small>"));
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, BORDER/2);
+
+ priv->entry = gtk_entry_new ();
+ gtk_entry_set_text (GTK_ENTRY (priv->entry), comp_name);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->entry, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->entry);
+ } else {
+ priv->entry = NULL;
+ }
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), TRUE);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ priv->check_dummy = gtk_check_button_new_with_mnemonic (_("_Dummy write"));
+ gtk_widget_show (priv->check_dummy);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_dummy, FALSE, FALSE, BORDER);
+
+ priv->check_burnfree = gtk_check_button_new_with_mnemonic (_("Burn_Free"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_burnfree), TRUE);
+ gtk_widget_show (priv->check_burnfree);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_burnfree, FALSE, FALSE, BORDER);
+
+ /* create ISO ? */
+ priv->check_only_iso = gtk_check_button_new_with_mnemonic (_("Only create _ISO"));
+ gtk_widget_show (priv->check_only_iso);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_only_iso, FALSE, FALSE, BORDER);
+ g_signal_connect (G_OBJECT (priv->check_only_iso), "toggled", G_CALLBACK (cb_check_only_iso_toggled), obj);
+
+ align = gtk_alignment_new (0, 0, 0, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, BORDER * 4, 0);
+ gtk_widget_show (align);
+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
+
+ priv->hbox_iso = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_iso);
+ gtk_container_add (GTK_CONTAINER (align), priv->hbox_iso);
+ gtk_widget_set_sensitive (priv->hbox_iso, FALSE);
+
+ priv->entry_path_iso = gtk_entry_new ();
+ tmp_dir = xfburn_settings_get_string ("temporary-dir", g_get_tmp_dir ());
+ default_path = g_build_filename (tmp_dir, "xfburn.iso", NULL);
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_path_iso), default_path);
+ g_free (default_path);
+ g_free (tmp_dir);
+ gtk_widget_show (priv->entry_path_iso);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), priv->entry_path_iso, FALSE, FALSE, 0);
+
+ img = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_show (img);
+ button = gtk_button_new ();
+ gtk_container_add (GTK_CONTAINER (button), img);
+ gtk_widget_show (button);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), button, FALSE, FALSE, 0);
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_browse_iso), obj);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ priv->button_proceed = button = xfce_create_mixed_button ("xfburn-burn-cd", _("Burn Composition"));
+ /*
+ * Disabled: change button_proceed functionality
+ button = create_proceed_button (obj, "xfburn-burn-cd", "");
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_proceed_clicked), obj);
+ */
+
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ //gtk_box_pack_start (GTK_BOX (GTK_DIALOG(obj)->action_area), button, TRUE, TRUE, 0);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button);
+ gtk_widget_grab_default (button);
+
+ cb_disc_refreshed (priv->device_box, xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), priv);
+
+ return gobj;
+}
+
+static void
+xfburn_burn_data_composition_base_dialog_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_IMAGE:
+ g_value_set_pointer (value, priv->image);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_burn_data_composition_base_dialog_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_IMAGE:
+ priv->image = g_value_get_pointer (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_burn_data_composition_base_dialog_finalize (GObject * object)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (object);
+
+ iso_image_unref (priv->image);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/* internals */
+/*
+ * Disabled: change button_proceed functionality
+GtkWidget *
+create_proceed_button (XfburnBurnDataCompositionBaseDialog * dialog, const gchar *stock, const gchar *text)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
+ GtkWidget *button, *align, *image, *hbox, *label;
+
+ priv->button_proceed = button = gtk_button_new ();
+ priv->label_proceed = label = gtk_label_new_with_mnemonic (text);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+
+ priv->image_proceed = image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
+ hbox = gtk_hbox_new (FALSE, 2);
+
+ align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (button), align);
+ gtk_container_add (GTK_CONTAINER (align), hbox);
+ gtk_widget_show_all (align);
+
+ return button;
+}
+
+void
+update_proceed_button (XfburnBurnDataCompositionBaseDialog * dialog)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
+
+ gtk_label_set_text (GTK_LABEL (priv->label_proceed), _(proceed_text[priv->response]));
+ gtk_image_set_from_stock (GTK_IMAGE (priv->image_proceed), proceed_image[priv->response], GTK_ICON_SIZE_BUTTON);
+}
+*/
+
+static void
+cb_check_only_iso_toggled (GtkToggleButton * button, XfburnBurnDataCompositionBaseDialog * dialog)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
+ gboolean valid_disc;
+
+ gtk_widget_set_sensitive (priv->frame_device, !gtk_toggle_button_get_active (button));
+ xfburn_device_box_set_sensitive (XFBURN_DEVICE_BOX (priv->device_box), !gtk_toggle_button_get_active (button));
+
+ gtk_widget_set_sensitive (priv->hbox_iso, gtk_toggle_button_get_active (button));
+ gtk_widget_set_sensitive (priv->check_eject, !gtk_toggle_button_get_active (button));
+ gtk_widget_set_sensitive (priv->check_burnfree, !gtk_toggle_button_get_active (button));
+ gtk_widget_set_sensitive (priv->check_dummy, !gtk_toggle_button_get_active (button));
+ if (!gtk_toggle_button_get_active (button)) {
+ g_object_get (G_OBJECT (priv->device_box), "valid", &valid_disc, NULL);
+ gtk_widget_set_sensitive (priv->button_proceed, valid_disc);
+ } else {
+ gtk_widget_set_sensitive (priv->button_proceed, TRUE);
+ }
+}
+
+/*
+ * Disabled: change button_proceed functionality
+static void
+cb_proceed_clicked (GtkButton * button, XfburnBurnDataCompositionBaseDialog * dialog)
+{
+}
+*/
+
+static void
+cb_browse_iso (GtkButton * button, XfburnBurnDataCompositionBaseDialog * dialog)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
+
+ xfburn_browse_for_file (GTK_ENTRY (priv->entry_path_iso), GTK_WINDOW (dialog));
+}
+
+static void
+cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog)
+{
+ XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
+ gboolean valid_disc;
+
+ g_object_get (G_OBJECT (priv->device_box), "valid", &valid_disc, NULL);
+
+ /*
+ * Disabled: change button_proceed functionality
+ if (!valid_disc && xfburn_device_list_get_disc_status () == BURN_DISC_FULL && xfburn_device_list_disc_is_erasable ()) {
+ priv->response = XFBURN_BURN_DATA_COMPOSITION_DIALOG_BLANK;
+ valid_disc = TRUE;
+ } else {
+ priv->response = XFBURN_BURN_DATA_COMPOSITION_DIALOG_BURN;
+ }
+ update_proceed_button (dialog);
+ */
+ gtk_widget_set_sensitive (priv->button_proceed, valid_disc);
+}
+
+typedef struct {
+ GtkWidget *dialog_progress;
+ struct burn_source *src;
+ gchar *iso_path;
+} ThreadWriteIsoParams;
+
+static void
+thread_write_iso (ThreadWriteIsoParams * params)
+{
+ GtkWidget *dialog_progress = params->dialog_progress;
+ gint fd;
+ guchar buf[2048];
+ glong size = 0;
+ glong written = 0;
+ guint i = 0;
+
+ fd = open (params->iso_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ if (fd == -1) {
+ /* could not create destination */
+ gchar err[256];
+ gchar *error_msg = NULL;
+
+ strerror_r (errno, err, 256);
+
+ error_msg = g_strdup_printf (_("Could not create destination ISO file: %s"), err);
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), error_msg);
+ g_free (error_msg);
+
+ goto end;
+ }
+
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Writing ISO..."));
+
+ size = (glong) params->src->get_size (params->src);
+ /* FIXME: is size really always 2048? */
+ while (params->src->read_xt (params->src, buf, 2048) == 2048) {
+ if (write (fd, buf, 2048) < 2048) {
+ /* an error occured while writing */
+ gchar err[256];
+ gchar *error_msg = NULL;
+
+ strerror_r (errno, err, 256);
+
+ error_msg = g_strdup_printf (_("An error occured while writing ISO: %s"), err);
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), error_msg);
+ g_free (error_msg);
+ goto cleanup;
+ } else {
+ written += 2048;
+ i++;
+
+ if (i >= 1000) {
+ i = 0;
+ gdouble percent = 0;
+
+ percent = ((gdouble) written / (gdouble) size);
+
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), percent);
+ }
+ }
+ }
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED, _("Done"));
+
+ cleanup:
+ close (fd);
+ end:
+ burn_source_free (params->src);
+ g_free (params->iso_path);
+ g_free (params);
+}
+
+typedef struct {
+ GtkWidget *dialog_progress;
+ XfburnDevice *device;
+ struct burn_source *src;
+ gboolean is_fifo;
+ gint speed;
+ XfburnWriteMode write_mode;
+ gboolean eject;
+ gboolean dummy;
+ gboolean burnfree;
+} ThreadBurnCompositionParams;
+
+static void
+thread_burn_prep_and_burn (ThreadBurnCompositionParams * params, struct burn_drive *drive,
+ struct burn_disc *disc, struct burn_session *session, struct burn_track *track)
+{
+ GtkWidget *dialog_progress = params->dialog_progress;
+
+ struct burn_write_opts * burn_options;
+ gint ret;
+
+ ret = burn_disc_add_session (disc, session, BURN_POS_END);
+ if (ret == 0) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to create disc object"));
+ return;
+ }
+
+ if (burn_track_set_source (track, params->src) != BURN_SOURCE_OK) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot attach source object to track object"));
+ return;
+ }
+
+ burn_session_add_track (session, track, BURN_POS_END);
+
+ burn_options = burn_write_opts_new (drive);
+ burn_write_opts_set_perform_opc (burn_options, 0);
+ burn_write_opts_set_multi (burn_options, 0);
+
+ switch (params->write_mode) {
+ case WRITE_MODE_TAO:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_TAO, BURN_BLOCK_MODE1);
+ break;
+ case WRITE_MODE_SAO:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_SAO, BURN_BLOCK_SAO);
+ break;
+ case WRITE_MODE_RAW16:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW16);
+ break;
+ case WRITE_MODE_RAW96P:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW96P);
+ break;
+ case WRITE_MODE_RAW96R:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW96R);
+ break;
+ default:
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("The write mode is not supported currently"));
+ return;
+ }
+
+ burn_write_opts_set_simulate(burn_options, params->dummy ? 1 : 0);
+ DBG ("Set speed to %d kb/s", params->speed);
+ burn_drive_set_speed (drive, 0, params->speed);
+ burn_write_opts_set_underrun_proof (burn_options, params->burnfree ? 1 : 0);
+
+ xfburn_perform_burn_write (dialog_progress, drive, params->write_mode, burn_options, disc, (params->is_fifo ? params->src : NULL));
+
+ burn_write_opts_free (burn_options);
+}
+
+static void
+thread_burn_composition (ThreadBurnCompositionParams * params)
+{
+ GtkWidget *dialog_progress = params->dialog_progress;
+
+ struct burn_disc *disc;
+ struct burn_session *session;
+ struct burn_track *track;
+
+ struct burn_drive_info *drive_info = NULL;
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ burn_source_free (params->src);
+ g_free (params);
+ return;
+ }
+
+ disc = burn_disc_create ();
+ session = burn_session_create ();
+ track = burn_track_create ();
+
+ if (!xfburn_device_grab (params->device, &drive_info)) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to grab drive"));
+ } else {
+ thread_burn_prep_and_burn (params, drive_info->drive, disc, session, track);
+ burn_drive_release (drive_info->drive, params->eject ? 1 : 0);
+ }
+
+ burn_track_free (track);
+ burn_session_free (session);
+ burn_disc_free (disc);
+ burn_finish ();
+
+ burn_source_free (params->src);
+ g_free (params);
+}
+
+static void
+cb_dialog_response (XfburnBurnDataCompositionBaseDialog * dialog, gint response_id, XfburnBurnDataCompositionBaseDialogPrivate * priv)
+{
+ if (response_id == GTK_RESPONSE_OK) {
+ GtkWidget *dialog_progress;
+
+ struct burn_source * src = NULL;
+ IsoWriteOpts *write_opts;
+
+ /* If the name was the default, update the image volume id and volset id */
+ if (priv->entry != NULL) {
+ const gchar * comp_name = gtk_entry_get_text (GTK_ENTRY (priv->entry));
+ iso_image_set_volume_id (priv->image, comp_name);
+ iso_image_set_volset_id (priv->image, comp_name);
+ }
+
+ /* Sets profile 0 [basic] */
+ iso_write_opts_new (&write_opts, 0);
+
+ iso_write_opts_set_iso_level (write_opts, 2);
+ iso_write_opts_set_rockridge (write_opts, TRUE);
+ iso_write_opts_set_joliet (write_opts, TRUE);
+ iso_write_opts_set_allow_deep_paths (write_opts, TRUE);
+ /* not sure if we want that
+ iso_write_opts_set_omit_version_numbers (write_opts, TRUE);
+ */
+
+ if (iso_image_create_burn_source (priv->image, write_opts, &src) < 0) {
+ /* could not create source */
+ xfce_err (_("Could not create ISO source structure"));
+ return;
+ }
+
+ /* iso_image_create_burn_source copies the data it needs */
+ iso_write_opts_free (write_opts);
+
+ dialog_progress = xfburn_progress_dialog_new (GTK_WINDOW (dialog));
+ gtk_window_set_transient_for (GTK_WINDOW (dialog_progress), gtk_window_get_transient_for (GTK_WINDOW (dialog)));
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ gtk_widget_show (dialog_progress);
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_only_iso))) {
+ ThreadWriteIsoParams *params = NULL;
+
+ /* create a new iso */
+ params = g_new0 (ThreadWriteIsoParams, 1);
+ params->dialog_progress = dialog_progress;
+ params->src = src;
+ params->iso_path = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry_path_iso)));
+ g_thread_create ((GThreadFunc) thread_write_iso, params, FALSE, NULL);
+ }
+ else {
+ ThreadBurnCompositionParams *params = NULL;
+ XfburnDevice *device;
+ gint speed;
+ XfburnWriteMode write_mode;
+ struct burn_source * src_fifo = NULL;
+
+ device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
+ speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box));
+ write_mode = xfburn_device_box_get_mode (XFBURN_DEVICE_BOX (priv->device_box));
+
+ /* FIXME: how much buffer space do we need? Probably should put this into settings */
+ src_fifo = burn_fifo_source_new (src, 2048, xfburn_settings_get_int ("fifo-size", XFBURN_FIFO_DEFAULT_SIZE) / 2, 0);
+ burn_source_free (src);
+
+ /* burn composition */
+ params = g_new0 (ThreadBurnCompositionParams, 1);
+ params->dialog_progress = dialog_progress;
+ params->device = device;
+ params->src = src_fifo;
+ params->is_fifo = TRUE;
+ params->speed = speed;
+ params->write_mode = write_mode;
+ params->eject = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject));
+ params->dummy = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_dummy));
+ params->burnfree = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_burnfree));
+ g_thread_create ((GThreadFunc) thread_burn_composition, params, FALSE, NULL);
+ }
+ }
+}
+
+/* public */
+GtkWidget *
+xfburn_burn_data_composition_base_dialog_new (IsoImage *image)
+{
+ XfburnBurnDataCompositionBaseDialog *obj;
+
+ obj = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG (g_object_new (XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, "image", image, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-composition-base-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,62 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_H__
+#define __XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <libisofs.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG (xfburn_burn_data_composition_base_dialog_get_type ())
+#define XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, XfburnBurnDataCompositionBaseDialog))
+#define XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, XfburnBurnDataCompositionBaseDialogClass))
+#define XFBURN_IS_BURN_DATA_COMPOSITION_BASE_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG))
+#define XFBURN_IS_BURN_DATA_COMPOSITION_BASE_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG))
+#define XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, XfburnBurnDataCompositionBaseDialogClass))
+
+enum {
+ XFBURN_BURN_DATA_COMPOSITION_DIALOG_CANCEL = -1,
+ XFBURN_BURN_DATA_COMPOSITION_DIALOG_BURN,
+ XFBURN_BURN_DATA_COMPOSITION_DIALOG_BLANK,
+};
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnBurnDataCompositionBaseDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnBurnDataCompositionBaseDialogClass;
+
+GtkType xfburn_burn_data_composition_base_dialog_get_type ();
+
+GtkWidget *xfburn_burn_data_composition_base_dialog_new (IsoImage *image);
+
+G_END_DECLS
+#endif /* XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-dvd-composition-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,120 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <errno.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-stock.h"
+
+#include "xfburn-device-box.h"
+#include "xfburn-burn-data-dvd-composition-dialog.h"
+#include "xfburn-progress-dialog.h"
+#include "xfburn-burn-data-composition-base-dialog.h"
+
+#define XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG, XfburnBurnDataDvdCompositionDialogPrivate))
+
+typedef struct
+{
+ gboolean dummy;
+} XfburnBurnDataDvdCompositionDialogPrivate;
+
+/* prototypes */
+static void xfburn_burn_data_dvd_composition_dialog_class_init (XfburnBurnDataDvdCompositionDialogClass * klass);
+static void xfburn_burn_data_dvd_composition_dialog_init (XfburnBurnDataDvdCompositionDialog * obj);
+static void xfburn_burn_data_dvd_composition_dialog_finalize (GObject * object);
+
+/* globals */
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_burn_data_dvd_composition_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnBurnDataDvdCompositionDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_burn_data_dvd_composition_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnBurnDataDvdCompositionDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_burn_data_dvd_composition_dialog_init,
+ };
+
+ type = g_type_register_static (XFBURN_TYPE_BURN_DATA_COMPOSITION_BASE_DIALOG, "XfburnBurnDataDvdCompositionDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_burn_data_dvd_composition_dialog_class_init (XfburnBurnDataDvdCompositionDialogClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (XfburnBurnDataDvdCompositionDialogPrivate));
+
+ object_class->finalize = xfburn_burn_data_dvd_composition_dialog_finalize;
+}
+
+static void
+xfburn_burn_data_dvd_composition_dialog_init (XfburnBurnDataDvdCompositionDialog * obj)
+{
+ //XfburnBurnDataDvdCompositionDialogPrivate *priv = XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_GET_PRIVATE (obj);
+
+}
+
+static void
+xfburn_burn_data_dvd_composition_dialog_finalize (GObject * object)
+{
+ //XfburnBurnDataDvdCompositionDialogPrivate *priv = XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_GET_PRIVATE (object);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/* internals */
+
+/* public */
+GtkWidget *
+xfburn_burn_data_dvd_composition_dialog_new (IsoImage *image)
+{
+ XfburnBurnDataDvdCompositionDialog *obj;
+
+ obj = XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG (g_object_new (XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG, "image", image, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-data-dvd-composition-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-data-dvd-composition-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,57 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2007 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_H__
+#define __XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <libisofs.h>
+#include "xfburn-burn-data-composition-base-dialog.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG (xfburn_burn_data_dvd_composition_dialog_get_type ())
+#define XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG, XfburnBurnDataDvdCompositionDialog))
+#define XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG, XfburnBurnDataDvdCompositionDialogClass))
+#define XFBURN_IS_BURN_DATA_DVD_COMPOSITION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG))
+#define XFBURN_IS_BURN_DATA_DVD_COMPOSITION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG))
+#define XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BURN_DATA_DVD_COMPOSITION_DIALOG, XfburnBurnDataDvdCompositionDialogClass))
+
+typedef struct
+{
+ XfburnBurnDataCompositionBaseDialog parent;
+} XfburnBurnDataDvdCompositionDialog;
+
+typedef struct
+{
+ XfburnBurnDataCompositionBaseDialogClass parent_class;
+} XfburnBurnDataDvdCompositionDialogClass;
+
+GtkType xfburn_burn_data_dvd_composition_dialog_get_type ();
+
+GtkWidget *xfburn_burn_data_dvd_composition_dialog_new (IsoImage *image);
+
+G_END_DECLS
+#endif /* XFBURN_BURN_DATA_DVD_COMPOSITION_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-image-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,581 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (squisher at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <gtk/gtk.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-progress-dialog.h"
+#include "xfburn-device-box.h"
+#include "xfburn-stock.h"
+#include "xfburn-settings.h"
+#include "xfburn-main.h"
+
+#include "xfburn-burn-image-dialog.h"
+#include "xfburn-perform-burn.h"
+
+#define XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_BURN_IMAGE_DIALOG, XfburnBurnImageDialogPrivate))
+
+typedef struct {
+ GtkWidget *dialog_progress;
+ XfburnDevice *device;
+ gchar *iso_path;
+ gint speed;
+ XfburnWriteMode write_mode;
+ gboolean eject;
+ gboolean dummy;
+ gboolean burnfree;
+} ThreadBurnIsoParams;
+
+typedef struct
+{
+ GtkWidget *chooser_image;
+ GtkWidget *image_label;
+
+ GtkWidget *device_box;
+
+ GtkWidget *check_eject;
+ GtkWidget *check_burnfree;
+ GtkWidget *check_dummy;
+
+ GtkWidget *burn_button;
+
+ ThreadBurnIsoParams *params;
+} XfburnBurnImageDialogPrivate;
+
+/* prototypes */
+static void xfburn_burn_image_dialog_class_init (XfburnBurnImageDialogClass * klass);
+static void xfburn_burn_image_dialog_init (XfburnBurnImageDialog * sp);
+
+void burn_image_dialog_error (XfburnBurnImageDialog * dialog, const gchar * msg_error);
+static void cb_device_changed (XfburnDeviceBox *box, XfburnDevice *device, XfburnBurnImageDialog * dialog);
+static void cb_disc_refreshed (XfburnDeviceBox *box, XfburnDevice *device, XfburnBurnImageDialog * dialog);
+static void cb_dialog_response (XfburnBurnImageDialog * dialog, gint response_id, gpointer user_data);
+
+static void update_image_label (GtkFileChooser *chooser, XfburnBurnImageDialog * dialog);
+static void check_burn_button (XfburnBurnImageDialog * dialog);
+static gboolean check_media (XfburnBurnImageDialog * dialog, ThreadBurnIsoParams *params, struct burn_drive *drive, struct burn_write_opts * burn_options);
+static void cb_clicked_ok (GtkButton * button, gpointer user_data);
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_burn_image_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnBurnImageDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_burn_image_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnBurnImageDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_burn_image_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnBurnImageDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_burn_image_dialog_class_init (XfburnBurnImageDialogClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (XfburnBurnImageDialogPrivate));
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_burn_image_dialog_init (XfburnBurnImageDialog * obj)
+{
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (obj);
+
+ GdkPixbuf *icon = NULL;
+ GtkFileFilter *filter;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *button;
+ XfburnDevice *device;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Burn image"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_BURN_CD, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* file */
+ priv->chooser_image = gtk_file_chooser_button_new (_("Image to burn"), GTK_FILE_CHOOSER_ACTION_OPEN);
+ gtk_widget_show (priv->chooser_image);
+
+ filter = gtk_file_filter_new ();
+ gtk_file_filter_set_name (filter, _("All files"));
+ gtk_file_filter_add_pattern (filter, "*");
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER(priv->chooser_image), filter);
+ filter = gtk_file_filter_new ();
+ gtk_file_filter_set_name (filter, _("ISO images"));
+ gtk_file_filter_add_pattern (filter, "*.iso");
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (priv->chooser_image), filter);
+ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (priv->chooser_image), filter);
+
+ frame = xfce_create_framebox_with_content (_("Image to burn"), priv->chooser_image);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* red label for image */
+ priv->image_label = gtk_label_new ("");
+ gtk_widget_show (priv->image_label);
+ gtk_box_pack_start (GTK_BOX (box), priv->image_label, FALSE, FALSE, 0);
+ gtk_label_set_markup (GTK_LABEL(priv->image_label),
+ _("<span weight=\"bold\" foreground=\"darkred\" stretch=\"semiexpanded\">Please select an image to burn!</span>"));
+ g_signal_connect (G_OBJECT (priv->chooser_image), "selection-changed", G_CALLBACK (update_image_label), obj);
+
+ /* devices list */
+ priv->device_box = xfburn_device_box_new (SHOW_CD_WRITERS | SHOW_CDRW_WRITERS | SHOW_DVD_WRITERS | SHOW_MODE_SELECTION | SHOW_SPEED_SELECTION);
+ gtk_widget_show (priv->device_box);
+
+ frame = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), TRUE);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ priv->check_dummy = gtk_check_button_new_with_mnemonic (_("_Dummy write"));
+ gtk_widget_show (priv->check_dummy);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_dummy, FALSE, FALSE, BORDER);
+
+ priv->check_burnfree = gtk_check_button_new_with_mnemonic (_("Burn_Free"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_burnfree), TRUE);
+ gtk_widget_show (priv->check_burnfree);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_burnfree, FALSE, FALSE, BORDER);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ priv->burn_button = xfce_create_mixed_button ("xfburn-burn-cd", _("_Burn image"));
+ gtk_widget_show (priv->burn_button);
+ g_signal_connect (G_OBJECT (priv->burn_button), "clicked", G_CALLBACK (cb_clicked_ok), obj);
+ gtk_container_add (GTK_CONTAINER( GTK_DIALOG(obj)->action_area), priv->burn_button);
+ //gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (priv->burn_button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (priv->burn_button);
+ gtk_widget_grab_default (priv->burn_button);
+
+ g_signal_connect (G_OBJECT (priv->device_box), "device-changed", G_CALLBACK (cb_device_changed), obj);
+ g_signal_connect (G_OBJECT (priv->device_box), "disc-refreshed", G_CALLBACK (cb_disc_refreshed), obj);
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), obj);
+ cb_disc_refreshed (XFBURN_DEVICE_BOX (priv->device_box), xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
+
+ device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
+ if (device)
+ gtk_widget_set_sensitive (priv->check_dummy, device->dummy_write);
+
+}
+
+/*************/
+/* internals */
+/*************/
+static struct burn_write_opts *
+make_burn_options(ThreadBurnIsoParams *params, struct burn_drive *drive) {
+ struct burn_write_opts * burn_options;
+
+ burn_options = burn_write_opts_new (drive);
+ burn_write_opts_set_perform_opc (burn_options, 0);
+ burn_write_opts_set_multi (burn_options, 0);
+
+ switch (params->write_mode) {
+ case WRITE_MODE_TAO:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_TAO, BURN_BLOCK_MODE1);
+ break;
+ case WRITE_MODE_SAO:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_SAO, BURN_BLOCK_SAO);
+ break;
+ /*
+ case WRITE_MODE_RAW16:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW16);
+ break;
+ case WRITE_MODE_RAW96P:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW96P);
+ break;
+ case WRITE_MODE_RAW96R:
+ burn_write_opts_set_write_type (burn_options, BURN_WRITE_RAW, BURN_BLOCK_RAW96R);
+ break;
+ */
+ default:
+ burn_write_opts_free (burn_options);
+ return NULL;
+ }
+
+ burn_write_opts_set_simulate(burn_options, params->dummy ? 1 : 0);
+ burn_write_opts_set_underrun_proof (burn_options, params->burnfree ? 1 : 0);
+
+ return burn_options;
+}
+
+static void
+thread_burn_iso (ThreadBurnIsoParams * params)
+{
+ GtkWidget *dialog_progress = params->dialog_progress;
+
+ struct burn_disc *disc;
+ struct burn_session *session;
+ struct burn_track *track;
+
+ gint fd;
+ struct stat stbuf;
+ off_t fixed_size = 0;
+ struct burn_source *data_src;
+ struct burn_source *fifo_src;
+
+ struct burn_drive *drive;
+ struct burn_drive_info *drive_info = NULL;
+ struct burn_write_opts * burn_options;
+
+ gint ret;
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ g_free (params->iso_path);
+ g_free (params);
+ return;
+ }
+
+ disc = burn_disc_create ();
+ session = burn_session_create ();
+ track = burn_track_create ();
+
+ ret = burn_disc_add_session (disc, session, BURN_POS_END);
+ if (ret == 0) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to create disc object"));
+ goto end;
+ }
+
+ burn_track_define_data (track, 0, 300*1024, 1, BURN_MODE1);
+
+ fd = open (params->iso_path, O_RDONLY);
+ if (fd >= 0)
+ if (fstat (fd, &stbuf) != -1)
+ if( (stbuf.st_mode & S_IFMT) == S_IFREG)
+ fixed_size = stbuf.st_size;
+
+ if (fixed_size == 0) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to determine image size"));
+ goto end;
+ }
+
+ data_src = burn_fd_source_new(fd, -1, fixed_size);
+
+ if (data_src == NULL) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot open image"));
+ goto end;
+ }
+
+ fifo_src = burn_fifo_source_new (data_src, 2048, xfburn_settings_get_int ("fifo-size", XFBURN_FIFO_DEFAULT_SIZE) / 2, 0);
+ burn_source_free (data_src);
+
+ if (burn_track_set_source (track, fifo_src) != BURN_SOURCE_OK) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot attach source object to track object"));
+ goto end;
+ }
+
+ burn_session_add_track (session, track, BURN_POS_END);
+
+ if (!xfburn_device_grab (params->device, &drive_info)) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to grab drive"));
+
+ goto end;
+ }
+
+ drive = drive_info->drive;
+
+ burn_options = make_burn_options (params, drive);
+ if (burn_options == NULL) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Burn mode is not currently implemented"));
+ goto cleanup;
+ }
+
+ DBG ("Set speed to %d kb/s", params->speed);
+ burn_drive_set_speed (drive, 0, params->speed);
+
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Burning image..."));
+ xfburn_perform_burn_write (dialog_progress, drive, params->write_mode, burn_options, disc, fifo_src);
+ burn_source_free (fifo_src);
+ burn_write_opts_free (burn_options);
+
+ cleanup:
+ burn_drive_release (drive, params->eject ? 1 : 0);
+ end:
+ burn_track_free (track);
+ burn_session_free (session);
+ burn_disc_free (disc);
+ burn_finish ();
+
+ g_free (params->iso_path);
+ g_free (params);
+}
+
+/**
+ * Error message wrapper, so the appearance can be customized later
+ **/
+void
+burn_image_dialog_error (XfburnBurnImageDialog * dialog, const gchar * msg_error)
+{
+ xfce_err (msg_error);
+}
+
+static void
+cb_device_changed (XfburnDeviceBox *box, XfburnDevice *device, XfburnBurnImageDialog * dialog)
+{
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
+
+ gtk_widget_set_sensitive (priv->check_dummy, device->dummy_write);
+}
+
+static void
+cb_disc_refreshed (XfburnDeviceBox *box, XfburnDevice *device, XfburnBurnImageDialog * dialog)
+{
+ check_burn_button (dialog);
+}
+
+static void
+cb_dialog_response (XfburnBurnImageDialog * dialog, gint response_id, gpointer user_data)
+{
+
+ if (response_id == GTK_RESPONSE_OK) {
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
+
+ GtkWidget *dialog_progress;
+
+ dialog_progress = xfburn_progress_dialog_new (GTK_WINDOW (dialog));
+ gtk_window_set_transient_for (GTK_WINDOW (dialog_progress), gtk_window_get_transient_for (GTK_WINDOW (dialog)));
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ priv->params->dialog_progress = dialog_progress;
+ gtk_widget_show (dialog_progress);
+
+ g_thread_create ((GThreadFunc) thread_burn_iso, priv->params, FALSE, NULL);
+ } else {
+ xfburn_main_leave_window ();
+ }
+}
+
+static void
+update_image_label (GtkFileChooser *chooser, XfburnBurnImageDialog * dialog)
+{
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
+
+ if (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)) == NULL) {
+ gtk_label_set_markup (GTK_LABEL(priv->image_label),
+ _("<span weight=\"bold\" foreground=\"darkred\" stretch=\"semiexpanded\">Please select an image to burn!</span>"));
+ } else {
+ gtk_label_set_text (GTK_LABEL(priv->image_label), "");
+ check_burn_button (dialog);
+ }
+}
+
+static void
+check_burn_button (XfburnBurnImageDialog * dialog)
+{
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
+ gboolean valid_disc;
+ gchar *filename;
+
+ g_object_get (G_OBJECT (priv->device_box), "valid", &valid_disc, NULL);
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (priv->chooser_image));
+ if (filename != NULL) {
+ gtk_widget_set_sensitive (priv->burn_button, valid_disc);
+ g_free (filename);
+ } else {
+ gtk_widget_set_sensitive (priv->burn_button, FALSE);
+ }
+}
+
+static gboolean
+check_media (XfburnBurnImageDialog * dialog, ThreadBurnIsoParams *params, struct burn_drive *drive, struct burn_write_opts * burn_options)
+{
+ enum burn_disc_status disc_state;
+ struct stat st;
+ int ret;
+
+ while (burn_drive_get_status (drive, NULL) != BURN_DRIVE_IDLE)
+ usleep(100001);
+
+ /* Evaluate drive and media */
+ while ((disc_state = burn_disc_get_status(drive)) == BURN_DISC_UNREADY)
+ usleep(100001);
+ if (disc_state == BURN_DISC_APPENDABLE && params->write_mode != WRITE_MODE_TAO) {
+ burn_image_dialog_error (dialog, _("Cannot append data to multisession disc in this write mode (use TAO instead)"));
+ return FALSE;
+ } else if (disc_state != BURN_DISC_BLANK) {
+ if (disc_state == BURN_DISC_FULL)
+ burn_image_dialog_error (dialog, _("Closed media with data detected. Need blank or appendable media"));
+ else if (disc_state == BURN_DISC_EMPTY)
+ burn_image_dialog_error (dialog, _("No media detected in drive"));
+ else {
+ burn_image_dialog_error (dialog, _("Cannot recognize state of drive and media"));
+ DBG ("disc_state = %d", disc_state);
+ }
+ return FALSE;
+ }
+
+ /* check if the image fits on the inserted media */
+ ret = stat (params->iso_path, &st);
+ if (ret == 0) {
+ off_t disc_size;
+ disc_size = burn_disc_available_space (drive, burn_options);
+ if (st.st_size > disc_size) {
+ burn_image_dialog_error (dialog, _("The selected image does not fit on the inserted disc!"));
+ return FALSE;
+ }
+ } else {
+ burn_image_dialog_error (dialog, _("Failed to get image size!"));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+cb_clicked_ok (GtkButton *button, gpointer user_data)
+{
+ XfburnBurnImageDialog * dialog = (XfburnBurnImageDialog *) user_data;
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
+ FILE *fp;
+ char *iso_path;
+ gboolean checks_passed = FALSE;
+ XfburnDevice *device;
+ gint speed;
+ XfburnWriteMode write_mode;
+ struct burn_write_opts * burn_options;
+
+ ThreadBurnIsoParams *params = NULL;
+ struct burn_drive_info *drive_info = NULL;
+
+ /* check if the image file really exists and can be opened */
+ iso_path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (priv->chooser_image));
+
+ fp = fopen(iso_path, "r");
+ if (fp == NULL) {
+ burn_image_dialog_error (dialog, _("Make sure you selected a valid file and you have the proper permissions to access it."));
+
+ return;
+ }
+ fclose(fp);
+
+ device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
+ speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box));
+ write_mode = xfburn_device_box_get_mode (XFBURN_DEVICE_BOX (priv->device_box));
+
+ params = g_new0 (ThreadBurnIsoParams, 1);
+ params->device = device;
+ params->iso_path = iso_path;
+ params->speed = speed;
+ params->write_mode = write_mode;
+ params->eject = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject));
+ params->dummy = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_dummy));
+ params->burnfree = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_burnfree));
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ return;
+ }
+
+ if (!xfburn_device_grab (device, &drive_info)) {
+ burn_image_dialog_error (dialog, _("Unable to grab drive"));
+
+ g_free (params->iso_path);
+ g_free (params);
+ burn_finish ();
+ return;
+ }
+
+ burn_options = make_burn_options (params, drive_info->drive);
+
+ if (burn_options == NULL)
+ burn_image_dialog_error (dialog, _("The write mode is not currently supported"));
+ else {
+ checks_passed = check_media (dialog, params, drive_info->drive, burn_options);
+
+ burn_write_opts_free (burn_options);
+ }
+
+ burn_drive_release (drive_info->drive, 0);
+ burn_finish ();
+
+ priv->params = params;
+
+ if (checks_passed)
+ gtk_dialog_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ else {
+ g_free (params->iso_path);
+ g_free (params);
+ }
+}
+
+
+/* public */
+GtkWidget *
+xfburn_burn_image_dialog_new ()
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_BURN_IMAGE_DIALOG, NULL));
+
+ xfburn_main_enter_window ();
+
+ return obj;
+}
+
+void xfburn_burn_image_dialog_set_filechooser_name ( GtkWidget * dialog, gchar *name)
+{
+ XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (XFBURN_BURN_IMAGE_DIALOG (dialog));
+
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->chooser_image), name);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-burn-image-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-burn-image-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,58 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_BURN_IMAGE_DIALOG_H__
+#define __XFBURN_BURN_IMAGE_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "xfburn-global.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_BURN_IMAGE_DIALOG (xfburn_burn_image_dialog_get_type ())
+#define XFBURN_BURN_IMAGE_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_BURN_IMAGE_DIALOG, XfburnBurnImageDialog))
+#define XFBURN_BURN_IMAGE_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_BURN_IMAGE_DIALOG, XfburnBurnImageDialogClass))
+#define XFBURN_IS_BURN_IMAGE_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_BURN_IMAGE_DIALOG))
+#define XFBURN_IS_BURN_IMAGE_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BURN_IMAGE_DIALOG))
+#define XFBURN_BURN_IMAGE_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BURN_IMAGE_DIALOG, XfburnBurnImageDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnBurnImageDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnBurnImageDialogClass;
+
+GtkType xfburn_burn_image_dialog_get_type ();
+GtkWidget *xfburn_burn_image_dialog_new ();
+void xfburn_burn_image_dialog_set_filechooser_name (GtkWidget * dialog, gchar *name);
+
+G_END_DECLS
+
+#endif /* XFBURN_BURN_IMAGE_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c (from rev 5093, xfburn/trunk/xfburn/xfburn-composition.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,101 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "xfburn-composition.h"
+
+enum {
+ NAME_CHANGED,
+ LAST_SIGNAL,
+};
+
+/*******************************************/
+/* interface definition and initialization */
+/*******************************************/
+static guint composition_signals[LAST_SIGNAL];
+
+static void
+xfburn_composition_base_init (gpointer g_iface)
+{
+ static gboolean initialized = FALSE;
+
+ if (!initialized) {
+ composition_signals[NAME_CHANGED] = g_signal_new ("name-changed", XFBURN_TYPE_COMPOSITION, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnCompositionInterface, name_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ initialized = TRUE;
+ }
+}
+
+GType
+xfburn_composition_get_type (void)
+{
+ static GType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo info = {
+ sizeof (XfburnCompositionInterface),
+ xfburn_composition_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL /* instance_init */
+ };
+
+ type = g_type_register_static (G_TYPE_INTERFACE, "XfburnComposition", &info, 0);
+ }
+
+ return type;
+}
+
+/**************/
+/* public API */
+/**************/
+
+void
+xfburn_composition_show_custom_controls (XfburnComposition *composition)
+{
+ return XFBURN_COMPOSITION_GET_INTERFACE (composition)->show_custom_controls (composition);
+}
+
+void
+xfburn_composition_hide_custom_controls (XfburnComposition *composition)
+{
+ return XFBURN_COMPOSITION_GET_INTERFACE (composition)->hide_custom_controls (composition);
+}
+
+void
+xfburn_composition_load (XfburnComposition *composition, const gchar *file)
+{
+ return XFBURN_COMPOSITION_GET_INTERFACE (composition)->load (composition, file);
+}
+
+void
+xfburn_composition_save (XfburnComposition *composition)
+{
+ return XFBURN_COMPOSITION_GET_INTERFACE (composition)->save (composition);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h (from rev 5093, xfburn/trunk/xfburn/xfburn-composition.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-composition.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,59 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_COMPOSITION_H__
+#define __XFBURN_COMPOSITION_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_COMPOSITION (xfburn_composition_get_type ())
+#define XFBURN_COMPOSITION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_COMPOSITION, XfburnComposition))
+#define XFBURN_IS_COMPOSITION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_COMPOSITION))
+#define XFBURN_COMPOSITION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), XFBURN_TYPE_COMPOSITION, XfburnCompositionInterface))
+
+typedef struct _XfburnCompositon XfburnComposition; /* dummy object */
+
+typedef struct {
+ GTypeInterface parent;
+
+ void (*show_custom_controls) (XfburnComposition *composition);
+ void (*hide_custom_controls) (XfburnComposition *composition);
+
+ void (*load) (XfburnComposition *composition, const gchar *file);
+ void (*save) (XfburnComposition *composition);
+
+ void (*name_changed) (XfburnComposition *composition, const gchar *name);
+} XfburnCompositionInterface;
+
+GType xfburn_composition_get_type (void);
+
+void xfburn_composition_show_custom_controls (XfburnComposition *composition);
+void xfburn_composition_hide_custom_controls (XfburnComposition *composition);
+
+void xfburn_composition_load (XfburnComposition *composition, const gchar *file);
+void xfburn_composition_save (XfburnComposition *composition);
+
+G_END_DECLS
+#endif /* __XFBURN_COMPOSITION_H__ */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c (from rev 5093, xfburn/trunk/xfburn/xfburn-compositions-notebook.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,253 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-compositions-notebook.h"
+
+#include "xfburn-notebook-tab.h"
+#include "xfburn-welcome-tab.h"
+#include "xfburn-data-composition.h"
+
+#define XFBURN_COMPOSITIONS_NOTEBOOK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, XfburnCompositionsNotebookPrivate))
+
+/* private members */
+typedef struct
+{
+ gpointer gna;
+} XfburnCompositionsNotebookPrivate;
+
+
+/* prototypes */
+static void xfburn_compositions_notebook_class_init (XfburnCompositionsNotebookClass * klass);
+static void xfburn_compositions_notebook_init (XfburnCompositionsNotebook * notebook);
+static void xfburn_compositions_notebook_finalize (GObject * object);
+
+
+/* internals */
+static void cb_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num,
+ XfburnCompositionsNotebookPrivate *priv);
+static void cb_composition_close (XfburnNotebookTab *tab, GtkNotebook *notebook);
+static void cb_composition_name_changed (XfburnComposition *composition, const gchar * name, XfburnCompositionsNotebook *notebook);
+static XfburnComposition * add_composition_with_data (XfburnCompositionsNotebook *notebook, XfburnCompositionType type, XfburnMainWindow *window);
+
+
+/* static member */
+static GtkNotebookClass *parent_class = NULL;
+
+GtkType
+xfburn_compositions_notebook_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnCompositionsNotebookClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_compositions_notebook_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnCompositionsNotebook),
+ 0,
+ (GInstanceInitFunc) xfburn_compositions_notebook_init,
+ };
+
+ type = g_type_register_static (GTK_TYPE_NOTEBOOK, "XfburnCompositionsNotebook", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_compositions_notebook_class_init (XfburnCompositionsNotebookClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnCompositionsNotebookPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+ object_class->finalize = xfburn_compositions_notebook_finalize;
+}
+
+static void
+xfburn_compositions_notebook_finalize (GObject * object)
+{
+}
+
+static void
+cb_move_focus_out (GtkNotebook *notebook, GtkDirectionType *arg1, XfburnCompositionsNotebookPrivate *priv)
+{
+ guint page_num;
+
+ page_num = gtk_notebook_get_current_page (notebook);
+ DBG ("%d", page_num);
+}
+
+static void
+xfburn_compositions_notebook_init (XfburnCompositionsNotebook * notebook)
+{
+ XfburnCompositionsNotebookPrivate *priv = XFBURN_COMPOSITIONS_NOTEBOOK_GET_PRIVATE (notebook);
+
+ g_signal_connect (G_OBJECT (notebook), "switch-page", G_CALLBACK (cb_switch_page), priv);
+ g_signal_connect (G_OBJECT (notebook), "move-focus-out", G_CALLBACK (cb_move_focus_out), priv);
+}
+
+/***********/
+/* actions */
+/***********/
+
+/*************/
+/* internals */
+/*************/
+static void
+cb_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, XfburnCompositionsNotebookPrivate *priv)
+{
+
+}
+
+static void
+cb_composition_close (XfburnNotebookTab *tab, GtkNotebook *notebook)
+{
+ GtkWidget *composition;
+ guint page_num;
+
+ composition = g_object_get_data (G_OBJECT (tab), "composition");
+ page_num = gtk_notebook_page_num (notebook, composition);
+ gtk_notebook_remove_page (notebook, page_num);
+}
+
+static void
+cb_composition_name_changed (XfburnComposition *composition, const gchar * name, XfburnCompositionsNotebook *notebook)
+{
+ guint page_num;
+ GtkWidget *tab, *menu_label;
+
+ page_num = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), GTK_WIDGET (composition));
+
+ tab = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), GTK_WIDGET (composition));
+ xfburn_notebook_tab_set_label (XFBURN_NOTEBOOK_TAB (tab), name);
+ menu_label = gtk_notebook_get_menu_label (GTK_NOTEBOOK (notebook), GTK_WIDGET (composition));
+ gtk_label_set_text (GTK_LABEL (menu_label), name);
+}
+
+static XfburnComposition *
+add_composition_with_data (XfburnCompositionsNotebook *notebook, XfburnCompositionType type, XfburnMainWindow *window)
+{
+ GtkWidget *composition = NULL;
+ gchar *label_text = NULL;
+ static guint i = 0;
+
+ switch (type) {
+ case XFBURN_WELCOME_TAB:
+ composition = xfburn_welcome_tab_new (window, notebook);
+ label_text = g_strdup (_("Welcome"));
+ break;
+ case XFBURN_DATA_COMPOSITION:
+ composition = xfburn_data_composition_new ();
+ label_text = g_strdup_printf ("%s %d", _("Data composition"), ++i);
+ break;
+ case XFBURN_AUDIO_COMPOSITION:
+ DBG ("don't hurry ... it'll be implemented later");
+ break;
+ }
+
+ if (composition) {
+ GtkWidget *tab = NULL;
+ GtkWidget *menu_label = NULL;
+
+ guint page_num;
+
+ tab = xfburn_notebook_tab_new (label_text);
+ gtk_widget_show (tab);
+
+ menu_label = gtk_label_new (label_text);
+ gtk_widget_show (menu_label);
+
+ gtk_widget_show (composition);
+ page_num = gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook), composition, tab, menu_label);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), page_num);
+
+ gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), composition, 1);
+
+ g_object_set_data (G_OBJECT (tab), "composition", composition);
+ if (type != XFBURN_WELCOME_TAB)
+ g_signal_connect (G_OBJECT (tab), "button-close-clicked", G_CALLBACK (cb_composition_close), notebook);
+
+ g_signal_connect (G_OBJECT (composition), "name-changed", G_CALLBACK (cb_composition_name_changed), notebook);
+ }
+
+ g_free (label_text);
+
+ return XFBURN_COMPOSITION (composition);
+}
+
+/**********/
+/* public */
+/**********/
+GtkWidget *
+xfburn_compositions_notebook_new ()
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, "scrollable", TRUE, "enable-popup", TRUE, NULL));
+
+ return obj;
+}
+
+XfburnComposition *
+xfburn_compositions_notebook_add_composition (XfburnCompositionsNotebook *notebook, XfburnCompositionType type)
+{
+ g_assert (type != XFBURN_WELCOME_TAB);
+
+ return add_composition_with_data (notebook, type, NULL);
+}
+
+XfburnWelcomeTab *
+xfburn_compositions_notebook_add_welcome_tab (XfburnCompositionsNotebook *notebook, XfburnMainWindow *window)
+{
+ return XFBURN_WELCOME_TAB (add_composition_with_data (notebook, XFBURN_WELCOME_TAB, window));
+}
+
+void
+xfburn_compositions_notebook_close_composition (XfburnCompositionsNotebook *notebook)
+{
+ gint page_num;
+
+ page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
+ gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page_num);
+}
+
+void
+xfburn_compositions_notebook_save_composition (XfburnCompositionsNotebook *notebook)
+{
+ XfburnComposition *composition;
+ guint page_num;
+
+ page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
+ composition = XFBURN_COMPOSITION (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num));
+
+ xfburn_composition_save (composition);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h (from rev 5093, xfburn/trunk/xfburn/xfburn-compositions-notebook.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-compositions-notebook.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,65 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_COMPOSITIONS_NOTEBOOK_H__
+#define __XFBURN_COMPOSITIONS_NOTEBOOK_H__
+
+#include <gtk/gtk.h>
+
+#include "xfburn-main-window.h"
+#include "xfburn-welcome-tab.h"
+#include "xfburn-composition.h"
+
+G_BEGIN_DECLS
+#define XFBURN_TYPE_COMPOSITIONS_NOTEBOOK (xfburn_compositions_notebook_get_type ())
+#define XFBURN_COMPOSITIONS_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, XfburnCompositionsNotebook))
+#define XFBURN_COMPOSITIONS_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, XfburnCompositionsNotebookClass))
+#define XFBURN_IS_COMPOSITIONS_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK))
+#define XFBURN_IS_COMPOSITIONS_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK))
+#define XFBURN_COMPOSITIONS_NOTEBOOK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, XfburnCompositionsNotebookClass))
+
+typedef struct
+{
+ GtkNotebook parent;
+} XfburnCompositionsNotebook;
+
+typedef struct
+{
+ GtkNotebookClass parent_class;
+} XfburnCompositionsNotebookClass;
+
+typedef enum
+{
+ XFBURN_WELCOME_TAB,
+ XFBURN_DATA_COMPOSITION,
+ XFBURN_AUDIO_COMPOSITION,
+} XfburnCompositionType;
+
+GtkType xfburn_compositions_notebook_get_type ();
+
+GtkWidget *xfburn_compositions_notebook_new ();
+
+XfburnComposition *xfburn_compositions_notebook_add_composition (XfburnCompositionsNotebook *notebook, XfburnCompositionType type);
+XfburnWelcomeTab *xfburn_compositions_notebook_add_welcome_tab (XfburnCompositionsNotebook *notebook, XfburnMainWindow *window);
+void xfburn_compositions_notebook_close_composition (XfburnCompositionsNotebook *notebook);
+
+void xfburn_compositions_notebook_load_composition (XfburnCompositionsNotebook *notebook, const gchar *file);
+void xfburn_compositions_notebook_save_composition (XfburnCompositionsNotebook *notebook);
+
+#endif /* XFBURN_COMPOSITIONS_NOTEBOOK_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-cd-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,310 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-copy-cd-progress-dialog.h"
+#include "xfburn-create-iso-progress-dialog.h"
+#include "xfburn-device-box.h"
+#include "xfburn-stock.h"
+
+#include "xfburn-copy-cd-dialog.h"
+
+#define XFBURN_COPY_CD_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_COPY_CD_DIALOG, XfburnCopyCdDialogPrivate))
+
+typedef struct
+{
+ GtkWidget *device_box_src;
+ GtkWidget *frame_burn;
+ GtkWidget *device_box_dest;
+
+ GtkWidget *check_eject;
+ GtkWidget *check_onthefly;
+ GtkWidget *check_only_iso;
+ GtkWidget *hbox_iso;
+ GtkWidget *entry_path_iso;
+ GtkWidget *check_dummy;
+} XfburnCopyCdDialogPrivate;
+
+/* prototypes */
+static void xfburn_copy_cd_dialog_class_init (XfburnCopyCdDialogClass * klass);
+static void xfburn_copy_cd_dialog_init (XfburnCopyCdDialog * sp);
+
+static void cb_device_changed (XfburnDeviceBox *box, const gchar *device_name, XfburnCopyCdDialogPrivate *priv);
+static void cb_check_only_iso_toggled (GtkToggleButton * button, XfburnCopyCdDialog * dialog);
+static void cb_browse_iso (GtkButton * button, XfburnCopyCdDialog * dialog);
+static void cb_dialog_response (XfburnCopyCdDialog * dialog, gint response_id, XfburnCopyCdDialogPrivate * priv);
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_copy_cd_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnCopyCdDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_copy_cd_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnCopyCdDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_copy_cd_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnCopyCdDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_copy_cd_dialog_class_init (XfburnCopyCdDialogClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (XfburnCopyCdDialogPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_copy_cd_dialog_init (XfburnCopyCdDialog * obj)
+{
+ XfburnCopyCdDialogPrivate *priv = XFBURN_COPY_CD_DIALOG_GET_PRIVATE (obj);
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ GtkWidget *img;
+ GdkPixbuf *icon = NULL;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *align;
+ GtkWidget *button;
+ gchar *default_path, *tmp_dir;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Copy data CD"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_DATA_COPY, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* reader devices list */
+ priv->device_box_src = xfburn_device_box_new (FALSE, FALSE);
+ gtk_widget_show (priv->device_box_src);
+
+ frame = xfce_create_framebox_with_content (_("CD Reader device"), priv->device_box_src);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* burning devices list */
+ priv->device_box_dest = xfburn_device_box_new (TRUE, TRUE);
+ gtk_widget_show (priv->device_box_dest);
+
+ priv->frame_burn = xfce_create_framebox_with_content (_("Burning device"), priv->device_box_dest);
+ gtk_widget_show (priv->frame_burn);
+ gtk_box_pack_start (box, priv->frame_burn, FALSE, FALSE, BORDER);
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), TRUE);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ priv->check_dummy = gtk_check_button_new_with_mnemonic (_("_Dummy write"));
+ gtk_widget_show (priv->check_dummy);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_dummy, FALSE, FALSE, BORDER);
+
+ priv->check_onthefly = gtk_check_button_new_with_mnemonic (_("On the _fly"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_onthefly), TRUE);
+ gtk_widget_show (priv->check_onthefly);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_onthefly, FALSE, FALSE, BORDER);
+
+ priv->check_only_iso = gtk_check_button_new_with_mnemonic (_("Only create _ISO"));
+ gtk_widget_show (priv->check_only_iso);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_only_iso, FALSE, FALSE, BORDER);
+ g_signal_connect (G_OBJECT (priv->check_only_iso), "toggled", G_CALLBACK (cb_check_only_iso_toggled), obj);
+
+ align = gtk_alignment_new (0, 0, 0, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, BORDER * 4, 0);
+ gtk_widget_show (align);
+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
+ priv->hbox_iso = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_iso);
+ gtk_container_add (GTK_CONTAINER (align), priv->hbox_iso);
+ gtk_widget_set_sensitive (priv->hbox_iso, FALSE);
+
+ priv->entry_path_iso = gtk_entry_new ();
+ gtk_widget_show (priv->entry_path_iso);
+ tmp_dir = xfburn_settings_get_string ("temporary-dir", "/tmp");
+ default_path = g_build_filename (tmp_dir, "xfburn.iso", NULL);
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_path_iso), default_path);
+ g_free (default_path);
+ g_free (tmp_dir);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), priv->entry_path_iso, FALSE, FALSE, 0);
+
+ img = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_show (img);
+ button = gtk_button_new ();
+ gtk_container_add (GTK_CONTAINER (button), img);
+ gtk_widget_show (button);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), button, FALSE, FALSE, 0);
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_browse_iso), obj);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ button = xfce_create_mixed_button ("xfburn-data-copy", _("_Copy CD"));
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button);
+ gtk_widget_grab_default (button);
+
+ g_signal_connect (G_OBJECT (priv->device_box_src), "device-changed", G_CALLBACK (cb_device_changed), priv);
+ g_signal_connect (G_OBJECT (priv->device_box_dest), "device-changed", G_CALLBACK (cb_device_changed), priv);
+
+ /* check if the selected devices are the same */
+ cb_device_changed (XFBURN_DEVICE_BOX (priv->device_box_dest), NULL, priv);
+
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), priv);
+}
+
+/* internals */
+static void
+cb_check_only_iso_toggled (GtkToggleButton * button, XfburnCopyCdDialog * dialog)
+{
+ XfburnCopyCdDialogPrivate *priv = XFBURN_COPY_CD_DIALOG_GET_PRIVATE (dialog);
+ gboolean sensitive = gtk_toggle_button_get_active (button);
+
+ gtk_widget_set_sensitive (priv->hbox_iso, sensitive);
+
+ gtk_widget_set_sensitive (priv->frame_burn, !sensitive);
+
+ gtk_widget_set_sensitive (priv->check_eject, !sensitive);
+ gtk_widget_set_sensitive (priv->check_dummy, !sensitive);
+ gtk_widget_set_sensitive (priv->check_onthefly, !sensitive);
+}
+
+static void
+cb_device_changed (XfburnDeviceBox *box, const gchar *device_name, XfburnCopyCdDialogPrivate *priv)
+{
+ gchar *source_device_name = NULL, *dest_device_name = NULL;
+
+ source_device_name = xfburn_device_box_get_selected (XFBURN_DEVICE_BOX (priv->device_box_src));
+ dest_device_name = xfburn_device_box_get_selected (XFBURN_DEVICE_BOX (priv->device_box_dest));
+
+ if (source_device_name && dest_device_name && !strcmp (source_device_name, dest_device_name)) {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_onthefly), FALSE);
+ gtk_widget_set_sensitive (priv->check_onthefly, FALSE);
+ } else
+ gtk_widget_set_sensitive (priv->check_onthefly, TRUE);
+
+ g_free (source_device_name);
+ g_free (dest_device_name);
+}
+
+static void
+cb_browse_iso (GtkButton * button, XfburnCopyCdDialog * dialog)
+{
+ XfburnCopyCdDialogPrivate *priv = XFBURN_COPY_CD_DIALOG_GET_PRIVATE (dialog);
+
+ xfburn_browse_for_file (GTK_ENTRY (priv->entry_path_iso), GTK_WINDOW (dialog));
+}
+
+static void
+cb_dialog_response (XfburnCopyCdDialog * dialog, gint response_id, XfburnCopyCdDialogPrivate * priv)
+{
+ if (response_id == GTK_RESPONSE_OK) {
+ gchar *command;
+ XfburnDevice *device_burn;
+ XfburnDevice *device_read;
+ GtkWidget *dialog_progress = NULL;
+
+ device_read = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box_src));
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_only_iso))) {
+ command = g_strconcat ("readcd dev=", device_read->node_path, " f=",
+ gtk_entry_get_text (GTK_ENTRY (priv->entry_path_iso)), NULL);
+
+ dialog_progress = xfburn_create_iso_progress_dialog_new ();
+ } else {
+ gchar *speed;
+ gchar *source_device = NULL;
+
+ device_burn = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box_dest));
+ speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box_dest));
+
+ if (device_burn != device_read)
+ source_device = g_strconcat (" --source-device ", device_read->node_path, NULL);
+ else
+ source_device = g_strdup ("");
+
+ command = g_strconcat ("cdrdao copy -n -v 2", source_device,
+ " --device ", device_burn->node_path, " --speed ", speed,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject)) ? " --eject" : "",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_dummy)) ? " --simulate" : "",
+ device_burn != device_read && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_onthefly)) ? " --on-the-fly" : "",
+ " --datafile /tmp/xfburn.bin", NULL);
+ g_free (source_device);
+ g_free (speed);
+
+ dialog_progress = xfburn_copy_cd_progress_dialog_new ();
+ }
+
+ gtk_window_set_transient_for (GTK_WINDOW (dialog_progress), gtk_window_get_transient_for (GTK_WINDOW (dialog)));
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ g_object_set_data (G_OBJECT (dialog_progress), "command", command);
+ gtk_dialog_run (GTK_DIALOG (dialog_progress));
+
+ g_free (command);
+ }
+}
+
+/* public */
+GtkWidget *
+xfburn_copy_cd_dialog_new ()
+{
+ XfburnCopyCdDialog *obj;
+
+ obj = XFBURN_COPY_CD_DIALOG (g_object_new (XFBURN_TYPE_COPY_CD_DIALOG, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-cd-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,56 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_COPY_CD_DIALOG_H__
+#define __XFBURN_COPY_CD_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include <libxfcegui4/libxfcegui4.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_COPY_CD_DIALOG (xfburn_copy_cd_dialog_get_type ())
+#define XFBURN_COPY_CD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_COPY_CD_DIALOG, XfburnCopyCdDialog))
+#define XFBURN_COPY_CD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_COPY_CD_DIALOG, XfburnCopyCdDialogClass))
+#define XFBURN_IS_COPY_CD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_COPY_CD_DIALOG))
+#define XFBURN_IS_COPY_CD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_COPY_CD_DIALOG))
+#define XFBURN_COPY_CD_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_COPY_CD_DIALOG, XfburnCopyCdDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnCopyCdDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnCopyCdDialogClass;
+
+GtkType xfburn_copy_cd_dialog_get_type ();
+
+GtkWidget *xfburn_copy_cd_dialog_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_COPY_CD_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-cd-progress-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,159 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-global.h"
+#include "xfburn-progress-dialog.h"
+
+#include "xfburn-copy-cd-progress-dialog.h"
+
+static void xfburn_copy_cd_progress_dialog_class_init (XfburnCopyCdProgressDialogClass * klass);
+static void xfburn_copy_cd_progress_dialog_init (XfburnCopyCdProgressDialog * sp);
+
+static void cb_new_output (XfburnCopyCdProgressDialog * dialog, const gchar * output, gpointer data);
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfburnProgressDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_copy_cd_progress_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnCopyCdProgressDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_copy_cd_progress_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnCopyCdProgressDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_copy_cd_progress_dialog_init,
+ };
+
+ type = g_type_register_static (XFBURN_TYPE_PROGRESS_DIALOG, "XfburnCopyCdProgressDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_copy_cd_progress_dialog_class_init (XfburnCopyCdProgressDialogClass * klass)
+{
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_copy_cd_progress_dialog_init (XfburnCopyCdProgressDialog * obj)
+{
+ g_signal_connect_after (G_OBJECT (obj), "output", G_CALLBACK (cb_new_output), NULL);
+}
+
+/* */
+/* internals */
+/* */
+static void
+cb_new_output (XfburnCopyCdProgressDialog * dialog, const gchar * output, gpointer data)
+{
+ static gint readcd_end = -1;
+
+ if (strstr (output, CDRDAO_DONE)) {
+ xfburn_progress_dialog_set_status (XFBURN_PROGRESS_DIALOG (dialog), XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED);
+ }
+ else if (strstr (output, CDRDAO_FLUSHING)) {
+ xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), _("Flushing cache..."));
+ }
+ else if (strstr (output, CDRDAO_LENGTH)) {
+ gint min, sec, cent;
+
+ sscanf (output, "%*s %d:%d:%d", &min, &sec, ¢);
+ readcd_end = cent + 100 * sec + 60 * 100 * min;
+ }
+ else if (strstr (output, CDRDAO_INSERT) || strstr (output, CDRDAO_INSERT_AGAIN)) {
+ GtkWidget *dialog_confirm;
+
+ dialog_confirm = gtk_message_dialog_new (GTK_WINDOW (dialog), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO, GTK_BUTTONS_OK, _("Please insert a recordable medium."));
+ gtk_dialog_run (GTK_DIALOG (dialog_confirm));
+ gtk_widget_destroy (dialog_confirm);
+ xfburn_progress_dialog_write_input (XFBURN_PROGRESS_DIALOG (dialog), "\n");
+ }
+ else {
+ gint done, total, buffer1, buffer2;
+ gint min, sec, cent;
+ gdouble fraction;
+
+ if (sscanf (output, "Wrote %d %*s %d %*s %*s %d%% %d%%", &done, &total, &buffer1, &buffer2) == 4) {
+ gchar *command;
+
+ command = g_object_get_data (G_OBJECT (dialog), "command");
+ if (strstr (command, "on-the-fly")) {
+ fraction = ((gdouble) done) / total;
+ }
+ else {
+ fraction = ((gdouble) done) / total;
+ fraction = 0.5 + (fraction / 2);
+ }
+
+ xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), _("Writing CD..."));
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog), fraction);
+ xfburn_progress_dialog_set_fifo_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog), ((gdouble) buffer1) / 100);
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog), ((gdouble) buffer2) / 100);
+ }
+ else if (sscanf (output, "%d:%d:%d", &min, &sec, ¢) == 3) {
+ gint readcd_done = -1;
+
+ readcd_done = cent + 100 * sec + 60 * 100 * min;
+
+ fraction = ((gdouble) readcd_done) / readcd_end;
+ fraction = fraction / 2;
+
+ xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), _("Reading CD..."));
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog), fraction);
+ }
+ }
+}
+
+/* */
+/* public */
+/* */
+
+GtkWidget *
+xfburn_copy_cd_progress_dialog_new ()
+{
+ XfburnCopyCdProgressDialog *obj;
+
+ obj = XFBURN_COPY_CD_PROGRESS_DIALOG (g_object_new (XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG,
+ "title", _("Copy data CD"), NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-cd-progress-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-cd-progress-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,54 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_COPY_CD_PROGRESS_DIALOG_H__
+#define __XFBURN_COPY_CD_PROGRESS_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include "xfburn-progress-dialog.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG (xfburn_copy_cd_progress_dialog_get_type ())
+#define XFBURN_COPY_CD_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG, XfburnCopyCdProgressDialog))
+#define XFBURN_COPY_CD_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG, XfburnCopyCdProgressDialogClass))
+#define XFBURN_IS_COPY_CD_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG))
+#define XFBURN_IS_COPY_CD_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG))
+#define XFBURN_COPY_CD_PROGRESS_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_COPY_CD_PROGRESS_DIALOG, XfburnCopyCdProgressDialogClass))
+
+typedef struct {
+ XfburnProgressDialog parent;
+} XfburnCopyCdProgressDialog;
+
+typedef struct {
+ XfburnProgressDialogClass parent_class;
+ /* Add Signal Functions Here */
+} XfburnCopyCdProgressDialogClass;
+
+GtkType xfburn_copy_cd_progress_dialog_get_type ();
+GtkWidget *xfburn_copy_cd_progress_dialog_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_COPY_CD_PROGRESS_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-dvd-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,309 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-copy-cd-progress-dialog.h"
+#include "xfburn-create-iso-progress-dialog.h"
+#include "xfburn-device-box.h"
+#include "xfburn-stock.h"
+
+#include "xfburn-copy-dvd-dialog.h"
+
+#define XFBURN_COPY_DVD_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_COPY_DVD_DIALOG, XfburnCopyDvdDialogPrivate))
+
+typedef struct
+{
+ GtkWidget *device_box_src;
+ GtkWidget *frame_burn;
+ GtkWidget *device_box_dest;
+
+ GtkWidget *check_eject;
+ GtkWidget *check_onthefly;
+ GtkWidget *check_only_iso;
+ GtkWidget *hbox_iso;
+ GtkWidget *entry_path_iso;
+ GtkWidget *check_dummy;
+} XfburnCopyDvdDialogPrivate;
+
+/* prototypes */
+static void xfburn_copy_dvd_dialog_class_init (XfburnCopyDvdDialogClass * klass);
+static void xfburn_copy_dvd_dialog_init (XfburnCopyDvdDialog * sp);
+
+static void cb_device_changed (XfburnDeviceBox *box, const gchar *device_name, XfburnCopyDvdDialogPrivate *priv);
+static void cb_check_only_iso_toggled (GtkToggleButton * button, XfburnCopyDvdDialog * dialog);
+static void cb_browse_iso (GtkButton * button, XfburnCopyDvdDialog * dialog);
+static void cb_dialog_response (XfburnCopyDvdDialog * dialog, gint response_id, XfburnCopyDvdDialogPrivate * priv);
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_copy_dvd_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnCopyDvdDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_copy_dvd_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnCopyDvdDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_copy_dvd_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnCopyDvdDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_copy_dvd_dialog_class_init (XfburnCopyDvdDialogClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (XfburnCopyDvdDialogPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_copy_dvd_dialog_init (XfburnCopyDvdDialog * obj)
+{
+ XfburnCopyDvdDialogPrivate *priv = XFBURN_COPY_DVD_DIALOG_GET_PRIVATE (obj);
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ GtkWidget *img;
+ GdkPixbuf *icon = NULL;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *align;
+ GtkWidget *button;
+ gchar *default_path, *tmp_dir;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Copy data DVD"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_DATA_COPY, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* reader devices list */
+ priv->device_box_src = xfburn_device_box_new (SHOW_DVD_READERS);
+ gtk_widget_show (priv->device_box_src);
+
+ frame = xfce_create_framebox_with_content (_("DVD Reader device"), priv->device_box_src);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* burning devices list */
+ priv->device_box_dest = xfburn_device_box_new (SHOW_DVD_WRITERS | SHOW_SPEED_SELECTION);
+ gtk_widget_show (priv->device_box_dest);
+
+ priv->frame_burn = xfce_create_framebox_with_content (_("Burning device"), priv->device_box_dest);
+ gtk_widget_show (priv->frame_burn);
+ gtk_box_pack_start (box, priv->frame_burn, FALSE, FALSE, BORDER);
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), TRUE);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ priv->check_dummy = gtk_check_button_new_with_mnemonic (_("_Dummy write"));
+ gtk_widget_show (priv->check_dummy);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_dummy, FALSE, FALSE, BORDER);
+
+ priv->check_onthefly = gtk_check_button_new_with_mnemonic (_("On the _fly"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_onthefly), TRUE);
+ gtk_widget_show (priv->check_onthefly);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_onthefly, FALSE, FALSE, BORDER);
+
+ priv->check_only_iso = gtk_check_button_new_with_mnemonic (_("Only create _ISO"));
+ gtk_widget_show (priv->check_only_iso);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_only_iso, FALSE, FALSE, BORDER);
+ g_signal_connect (G_OBJECT (priv->check_only_iso), "toggled", G_CALLBACK (cb_check_only_iso_toggled), obj);
+
+ align = gtk_alignment_new (0, 0, 0, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, BORDER * 4, 0);
+ gtk_widget_show (align);
+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
+ priv->hbox_iso = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_iso);
+ gtk_container_add (GTK_CONTAINER (align), priv->hbox_iso);
+ gtk_widget_set_sensitive (priv->hbox_iso, FALSE);
+
+ priv->entry_path_iso = gtk_entry_new ();
+ gtk_widget_show (priv->entry_path_iso);
+ tmp_dir = xfburn_settings_get_string ("temporary-dir", "/tmp");
+ default_path = g_build_filename (tmp_dir, "xfburn.iso", NULL);
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_path_iso), default_path);
+ g_free (default_path);
+ g_free (tmp_dir);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), priv->entry_path_iso, FALSE, FALSE, 0);
+
+ img = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_show (img);
+ button = gtk_button_new ();
+ gtk_container_add (GTK_CONTAINER (button), img);
+ gtk_widget_show (button);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_iso), button, FALSE, FALSE, 0);
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_browse_iso), obj);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ button = xfce_create_mixed_button ("xfburn-data-copy", _("_Copy DVD"));
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button);
+ gtk_widget_grab_default (button);
+
+ g_signal_connect (G_OBJECT (priv->device_box_src), "device-changed", G_CALLBACK (cb_device_changed), priv);
+ g_signal_connect (G_OBJECT (priv->device_box_dest), "device-changed", G_CALLBACK (cb_device_changed), priv);
+
+ /* check if the selected devices are the same */
+ cb_device_changed (XFBURN_DEVICE_BOX (priv->device_box_dest), NULL, priv);
+
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), priv);
+}
+
+/* internals */
+static void
+cb_check_only_iso_toggled (GtkToggleButton * button, XfburnCopyDvdDialog * dialog)
+{
+ XfburnCopyDvdDialogPrivate *priv = XFBURN_COPY_DVD_DIALOG_GET_PRIVATE (dialog);
+ gboolean sensitive = gtk_toggle_button_get_active (button);
+
+ gtk_widget_set_sensitive (priv->hbox_iso, sensitive);
+
+ gtk_widget_set_sensitive (priv->frame_burn, !sensitive);
+
+ gtk_widget_set_sensitive (priv->check_eject, !sensitive);
+ gtk_widget_set_sensitive (priv->check_dummy, !sensitive);
+ gtk_widget_set_sensitive (priv->check_onthefly, !sensitive);
+}
+
+static void
+cb_device_changed (XfburnDeviceBox *box, const gchar *device_name, XfburnCopyDvdDialogPrivate *priv)
+{
+ gchar *source_device_name = NULL, *dest_device_name = NULL;
+
+ source_device_name = xfburn_device_box_get_selected (XFBURN_DEVICE_BOX (priv->device_box_src));
+ dest_device_name = xfburn_device_box_get_selected (XFBURN_DEVICE_BOX (priv->device_box_dest));
+
+ if (source_device_name && dest_device_name && !strcmp (source_device_name, dest_device_name)) {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_onthefly), FALSE);
+ gtk_widget_set_sensitive (priv->check_onthefly, FALSE);
+ } else
+ gtk_widget_set_sensitive (priv->check_onthefly, TRUE);
+
+ g_free (source_device_name);
+ g_free (dest_device_name);
+}
+
+static void
+cb_browse_iso (GtkButton * button, XfburnCopyDvdDialog * dialog)
+{
+ XfburnCopyDvdDialogPrivate *priv = XFBURN_COPY_DVD_DIALOG_GET_PRIVATE (dialog);
+
+ xfburn_browse_for_file (GTK_ENTRY (priv->entry_path_iso), GTK_WINDOW (dialog));
+}
+
+static void
+cb_dialog_response (XfburnCopyDvdDialog * dialog, gint response_id, XfburnCopyDvdDialogPrivate * priv)
+{
+ if (response_id == GTK_RESPONSE_OK) {
+ gchar *command;
+ XfburnDevice *device_burn;
+ XfburnDevice *device_read;
+ GtkWidget *dialog_progress = NULL;
+
+ device_read = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box_src));
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_only_iso))) {
+ command = g_strconcat ("readcd dev=", device_read->node_path, " f=",
+ gtk_entry_get_text (GTK_ENTRY (priv->entry_path_iso)), NULL);
+
+ // dialog_progress = xfburn_create_iso_progress_dialog_new ();
+ } else {
+ gint speed;
+ gchar *source_device = NULL;
+
+ device_burn = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box_dest));
+ speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box_dest));
+
+ if (device_burn != device_read)
+ source_device = g_strconcat (" --source-device ", device_read->node_path, NULL);
+ else
+ source_device = g_strdup ("");
+
+ command = g_strconcat ("cdrdao copy -n -v 2", source_device,
+ " --device ", device_burn->node_path, " --speed ", speed,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject)) ? " --eject" : "",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_dummy)) ? " --simulate" : "",
+ device_burn != device_read && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_onthefly)) ? " --on-the-fly" : "",
+ " --datafile /tmp/xfburn.bin", NULL);
+ g_free (source_device);
+
+ // dialog_progress = xfburn_copy_cd_progress_dialog_new ();
+ }
+
+ gtk_window_set_transient_for (GTK_WINDOW (dialog_progress), gtk_window_get_transient_for (GTK_WINDOW (dialog)));
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ g_object_set_data (G_OBJECT (dialog_progress), "command", command);
+ gtk_dialog_run (GTK_DIALOG (dialog_progress));
+
+ g_free (command);
+ }
+}
+
+/* public */
+GtkWidget *
+xfburn_copy_dvd_dialog_new ()
+{
+ XfburnCopyDvdDialog *obj;
+
+ obj = XFBURN_COPY_DVD_DIALOG (g_object_new (XFBURN_TYPE_COPY_DVD_DIALOG, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-copy-dvd-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-copy-dvd-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,56 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_COPY_DVD_DIALOG_H__
+#define __XFBURN_COPY_DVD_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include <libxfcegui4/libxfcegui4.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_COPY_DVD_DIALOG (xfburn_copy_dvd_dialog_get_type ())
+#define XFBURN_COPY_DVD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_COPY_DVD_DIALOG, XfburnCopyDvdDialog))
+#define XFBURN_COPY_DVD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_COPY_DVD_DIALOG, XfburnCopyDvdDialogClass))
+#define XFBURN_IS_COPY_DVD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_COPY_DVD_DIALOG))
+#define XFBURN_IS_COPY_DVD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_COPY_DVD_DIALOG))
+#define XFBURN_COPY_DVD_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_COPY_DVD_DIALOG, XfburnCopyDvdDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnCopyDvdDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnCopyDvdDialogClass;
+
+GtkType xfburn_copy_dvd_dialog_get_type ();
+
+GtkWidget *xfburn_copy_dvd_dialog_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_COPY_DVD_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-create-iso-progress-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,120 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-global.h"
+#include "xfburn-progress-dialog.h"
+
+#include "xfburn-create-iso-progress-dialog.h"
+
+static void xfburn_create_iso_progress_dialog_class_init (XfburnCreateIsoProgressDialogClass * klass);
+static void xfburn_create_iso_progress_dialog_init (XfburnCreateIsoProgressDialog * sp);
+
+static void cb_new_output (XfburnCreateIsoProgressDialog * dialog, const gchar * output, gpointer data);
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfburnProgressDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_create_iso_progress_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnCreateIsoProgressDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_create_iso_progress_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnCreateIsoProgressDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_create_iso_progress_dialog_init,
+ };
+
+ type = g_type_register_static (XFBURN_TYPE_PROGRESS_DIALOG, "XfburnCreateIsoProgressDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_create_iso_progress_dialog_class_init (XfburnCreateIsoProgressDialogClass * klass)
+{
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_create_iso_progress_dialog_init (XfburnCreateIsoProgressDialog * obj)
+{
+ g_signal_connect_after (G_OBJECT (obj), "output", G_CALLBACK (cb_new_output), NULL);
+}
+
+/* */
+/* internals */
+/* */
+static void
+cb_new_output (XfburnCreateIsoProgressDialog * dialog, const gchar * output, gpointer data)
+{
+ static gint readcd_end = -1;
+
+ if (strstr (output, READCD_DONE)) {
+ xfburn_progress_dialog_set_status (XFBURN_PROGRESS_DIALOG (dialog), XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED);
+ }
+ else if (strstr (output, READCD_PROGRESS)) {
+ gint readcd_done = -1;
+ gdouble fraction;
+
+ sscanf (output, "%*s %d", &readcd_done);
+ fraction = ((gdouble) readcd_done) / readcd_end;
+
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog), fraction);
+ }
+ else if (strstr (output, READCD_CAPACITY)) {
+ xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), _("Reading CD..."));
+ sscanf (output, "%*s %d", &readcd_end);
+ }
+}
+
+/* */
+/* public */
+/* */
+
+GtkWidget *
+xfburn_create_iso_progress_dialog_new ()
+{
+ XfburnCreateIsoProgressDialog *obj;
+
+ obj = XFBURN_CREATE_ISO_PROGRESS_DIALOG (g_object_new (XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG,
+ "show-buffers", FALSE, "title", _("Create ISO from CD"), NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-create-iso-progress-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-create-iso-progress-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,56 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_CREATE_ISO_PROGRESS_DIALOG_H__
+#define __XFBURN_CREATE_ISO_PROGRESS_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include "xfburn-progress-dialog.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG (xfburn_create_iso_progress_dialog_get_type ())
+#define XFBURN_CREATE_ISO_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG, XfburnCreateIsoProgressDialog))
+#define XFBURN_CREATE_ISO_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG, XfburnCreateIsoProgressDialogClass))
+#define XFBURN_IS_CREATE_ISO_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG))
+#define XFBURN_IS_CREATE_ISO_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG))
+#define XFBURN_CREATE_ISO_PROGRESS_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_CREATE_ISO_PROGRESS_DIALOG, XfburnCreateIsoProgressDialogClass))
+
+typedef struct
+{
+ XfburnProgressDialog parent;
+} XfburnCreateIsoProgressDialog;
+
+typedef struct
+{
+ XfburnProgressDialogClass parent_class;
+ /* Add Signal Functions Here */
+} XfburnCreateIsoProgressDialogClass;
+
+GtkType xfburn_create_iso_progress_dialog_get_type ();
+GtkWidget *xfburn_create_iso_progress_dialog_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_CREATE_ISO_PROGRESS_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c (from rev 5093, xfburn/trunk/xfburn/xfburn-data-composition.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,2042 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#ifdef HAVE_THUNAR_VFS
+#include <thunar-vfs/thunar-vfs.h>
+#endif
+
+#include <exo/exo.h>
+
+#include <libisofs.h>
+
+#include "xfburn-data-composition.h"
+#include "xfburn-global.h"
+
+#include "xfburn-adding-progress.h"
+#include "xfburn-composition.h"
+#include "xfburn-burn-data-cd-composition-dialog.h"
+#include "xfburn-burn-data-dvd-composition-dialog.h"
+#include "xfburn-data-disc-usage.h"
+#include "xfburn-main-window.h"
+#include "xfburn-utils.h"
+
+#define XFBURN_DATA_COMPOSITION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_DATA_COMPOSITION, XfburnDataCompositionPrivate))
+
+enum
+{
+ DATA_COMPOSITION_COLUMN_ICON,
+ DATA_COMPOSITION_COLUMN_CONTENT,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE,
+ DATA_COMPOSITION_COLUMN_SIZE,
+ DATA_COMPOSITION_COLUMN_PATH,
+ DATA_COMPOSITION_COLUMN_TYPE,
+ DATA_COMPOSITION_N_COLUMNS
+};
+
+typedef enum
+{
+ DATA_COMPOSITION_TYPE_FILE,
+ DATA_COMPOSITION_TYPE_DIRECTORY
+} DataCompositionEntryType;
+
+
+/* thread parameters */
+typedef struct {
+ char **filenames;
+ int filec;
+ XfburnDataComposition *dc;
+} ThreadAddFilesCLIParams;
+
+typedef struct {
+ XfburnDataComposition *dc;
+ GtkTreeModel *model;
+ GtkTreeIter iter_where_insert;
+ DataCompositionEntryType type;
+} ThreadAddFilesActionParams;
+
+typedef struct {
+ XfburnDataComposition *composition;
+ DataCompositionEntryType type;
+ GtkWidget *widget;
+ GtkTreeViewDropPosition position;
+ GtkTreeIter iter_dummy;
+} ThreadAddFilesDragParams;
+
+/* prototypes */
+static void xfburn_data_composition_class_init (XfburnDataCompositionClass *);
+static void composition_interface_init (XfburnCompositionInterface *composition, gpointer iface_data);
+static void xfburn_data_composition_init (XfburnDataComposition *dc);
+static void xfburn_data_composition_finalize (GObject * object);
+
+static void show_custom_controls (XfburnComposition *composition);
+static void hide_custom_controls (XfburnComposition *composition);
+static void load_from_file (XfburnComposition *composition, const gchar *file);
+static void save_to_file (XfburnComposition *composition);
+
+static gint directory_tree_sortfunc (GtkTreeModel * model, GtkTreeIter * a, GtkTreeIter * b, gpointer user_data);
+
+static void action_create_directory (GtkAction *, XfburnDataComposition *);
+static void action_clear (GtkAction *, XfburnDataComposition *);
+static void action_remove_selection (GtkAction *, XfburnDataComposition *);
+static void action_rename_selection (GtkAction *, XfburnDataComposition *);
+static void action_add_selected_files (GtkAction *, XfburnDataComposition *);
+
+static gboolean cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, XfburnDataComposition * dc);
+static void cb_treeview_row_activated (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column, XfburnDataComposition * composition);
+static void cb_selection_changed (GtkTreeSelection *selection, XfburnDataComposition * dc);
+static void cb_begin_burn (XfburnDataDiscUsage * du, XfburnDataComposition * dc);
+static void cb_cell_file_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext, XfburnDataComposition * dc);
+
+static void cb_content_drag_data_rcv (GtkWidget *, GdkDragContext *, guint, guint, GtkSelectionData *, guint, guint,
+ XfburnDataComposition *);
+static void cb_content_drag_data_get (GtkWidget * widget, GdkDragContext * dc, GtkSelectionData * data, guint info,
+ guint time, XfburnDataComposition * content);
+static void cb_adding_done (XfburnAddingProgress *progress, XfburnDataComposition *dc);
+
+/* thread entry points */
+static void thread_add_files_cli (ThreadAddFilesCLIParams *params);
+static void thread_add_files_action (ThreadAddFilesActionParams *params);
+static void thread_add_files_drag (ThreadAddFilesDragParams *params);
+
+/* thread helpers */
+static gboolean thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
+ GtkTreeModel * model, const gchar * path, GtkTreeIter * iter,
+ GtkTreeIter * insertion, GtkTreeViewDropPosition position);
+static gboolean thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model, const gchar * path,
+ GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position);
+static IsoImage * generate_iso_image (XfburnDataComposition * dc);
+
+typedef struct
+{
+ gchar *filename;
+ gboolean modified;
+
+ guint n_new_directory;
+
+ GSList *full_paths_to_add;
+ gchar *selected_files;
+ GtkTreePath *path_where_insert;
+
+ GdkDragContext * dc;
+ gboolean success;
+ gboolean del;
+ guint32 time;
+
+ void *thread_params;
+
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
+
+ GtkWidget *toolbar;
+ GtkWidget *entry_volume_name;
+ GtkWidget *content;
+ GtkWidget *disc_usage;
+ GtkWidget *progress;
+
+} XfburnDataCompositionPrivate;
+
+/* globals */
+static GtkHPanedClass *parent_class = NULL;
+static guint instances = 0;
+
+static const GtkActionEntry action_entries[] = {
+ {"add-file", GTK_STOCK_ADD, N_("Add"), NULL, N_("Add the selected file(s) to the composition"),
+ G_CALLBACK (action_add_selected_files),},
+ {"create-dir", GTK_STOCK_NEW, N_("Create directory"), NULL, N_("Add a new directory to the composition"),
+ G_CALLBACK (action_create_directory),},
+ {"remove-file", GTK_STOCK_REMOVE, N_("Remove"), NULL, N_("Remove the selected file(s) from the composition"),
+ G_CALLBACK (action_remove_selection),},
+ {"clear", GTK_STOCK_CLEAR, N_("Clear"), NULL, N_("Clear the content of the composition"),
+ G_CALLBACK (action_clear),},
+ {"import-session", "xfburn-import-session", N_("Import"), NULL, N_("Import existing session"),},
+ {"rename-file", GTK_STOCK_EDIT, N_("Rename"), NULL, N_("Rename the selected file"),
+ G_CALLBACK (action_rename_selection),},
+};
+
+static const gchar *toolbar_actions[] = {
+ "add-file",
+ "remove-file",
+ "create-dir",
+ "clear",
+ "import-session",
+};
+
+static GdkPixbuf *icon_directory = NULL, *icon_file = NULL;
+
+/***************************/
+/* XfburnDataComposition class */
+/***************************/
+GtkType
+xfburn_data_composition_get_type (void)
+{
+ static GtkType data_composition_type = 0;
+
+ if (!data_composition_type) {
+ static const GTypeInfo data_composition_info = {
+ sizeof (XfburnDataCompositionClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_data_composition_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnDataComposition),
+ 0,
+ (GInstanceInitFunc) xfburn_data_composition_init
+ };
+
+ static const GInterfaceInfo composition_info = {
+ (GInterfaceInitFunc) composition_interface_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ data_composition_type = g_type_register_static (GTK_TYPE_VBOX, "XfburnDataComposition", &data_composition_info, 0);
+
+ g_type_add_interface_static (data_composition_type, XFBURN_TYPE_COMPOSITION, &composition_info);
+ }
+
+ return data_composition_type;
+}
+
+static void
+xfburn_data_composition_class_init (XfburnDataCompositionClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnDataCompositionPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_data_composition_finalize;
+}
+
+static void
+composition_interface_init (XfburnCompositionInterface *composition, gpointer iface_data)
+{
+ composition->show_custom_controls = show_custom_controls;
+ composition->hide_custom_controls = hide_custom_controls;
+ composition->load = load_from_file;
+ composition->save = save_to_file;
+}
+
+static void
+xfburn_data_composition_init (XfburnDataComposition * composition)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+
+ gint x, y;
+ ExoToolbarsModel *model_toolbar;
+ gint toolbar_position;
+ GtkWidget *hbox_toolbar;
+ GtkWidget *hbox, *label;
+ GtkWidget *scrolled_window;
+ GtkTreeStore *model;
+ GtkTreeViewColumn *column_file;
+ GtkCellRenderer *cell_icon, *cell_file;
+ GtkTreeSelection *selection;
+ GtkAction *action = NULL;
+ GdkScreen *screen;
+ GtkIconTheme *icon_theme;
+
+ const gchar ui_string[] = "<ui> <popup name=\"popup-menu\">"
+ "<menuitem action=\"create-dir\"/>" "<separator/>"
+ "<menuitem action=\"rename-file\"/>" "<menuitem action=\"remove-file\"/>" "</popup></ui>";
+
+ GtkTargetEntry gte_src[] = { {"XFBURN_TREE_PATHS", GTK_TARGET_SAME_WIDGET, DATA_COMPOSITION_DND_TARGET_INSIDE} };
+ GtkTargetEntry gte_dest[] = { {"XFBURN_TREE_PATHS", GTK_TARGET_SAME_WIDGET, DATA_COMPOSITION_DND_TARGET_INSIDE},
+ {"text/plain", 0, DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN}
+ };
+
+ priv->full_paths_to_add = NULL;
+
+ instances++;
+
+ /* initialize static members */
+ screen = gtk_widget_get_screen (GTK_WIDGET (composition));
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+ if (!icon_directory)
+ icon_directory = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", x, 0, NULL);
+ if (!icon_file)
+ icon_file = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-regular", x, 0, NULL);
+
+ /* create ui manager */
+ priv->action_group = gtk_action_group_new ("xfburn-data-composition");
+ gtk_action_group_set_translation_domain (priv->action_group, GETTEXT_PACKAGE);
+ gtk_action_group_add_actions (priv->action_group, action_entries, G_N_ELEMENTS (action_entries),
+ GTK_WIDGET (composition));
+
+ priv->ui_manager = gtk_ui_manager_new ();
+ gtk_ui_manager_insert_action_group (priv->ui_manager, priv->action_group, 0);
+
+ gtk_ui_manager_add_ui_from_string (priv->ui_manager, ui_string, -1, NULL);
+
+ hbox_toolbar = gtk_hbox_new (FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (composition), hbox_toolbar, FALSE, TRUE, 0);
+ gtk_widget_show (hbox_toolbar);
+
+ /* toolbar */
+ model_toolbar = exo_toolbars_model_new ();
+ exo_toolbars_model_set_actions (model_toolbar, (gchar **) toolbar_actions, G_N_ELEMENTS (toolbar_actions));
+ toolbar_position = exo_toolbars_model_add_toolbar (model_toolbar, -1, "content-toolbar");
+ exo_toolbars_model_set_style (model_toolbar, GTK_TOOLBAR_BOTH, toolbar_position);
+
+ exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "add-file", EXO_TOOLBARS_ITEM_TYPE);
+ exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "create-dir", EXO_TOOLBARS_ITEM_TYPE);
+ exo_toolbars_model_add_separator (model_toolbar, toolbar_position, -1);
+ exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "remove-file", EXO_TOOLBARS_ITEM_TYPE);
+ exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "clear", EXO_TOOLBARS_ITEM_TYPE);
+ //exo_toolbars_model_add_separator (model_toolbar, toolbar_position, -1);
+ //exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "import-session", EXO_TOOLBARS_ITEM_TYPE);
+
+ priv->toolbar = exo_toolbars_view_new_with_model (priv->ui_manager, model_toolbar);
+ gtk_box_pack_start (GTK_BOX (hbox_toolbar), priv->toolbar, TRUE, TRUE, 0);
+ gtk_widget_show (priv->toolbar);
+
+
+ /* volume name */
+ hbox = gtk_hbox_new (FALSE, 5);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
+ gtk_box_pack_start (GTK_BOX (hbox_toolbar), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+ label = gtk_label_new (_("Volume name :"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+ gtk_widget_show (label);
+
+ priv->entry_volume_name = gtk_entry_new ();
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_volume_name), _(DATA_COMPOSITION_DEFAULT_NAME));
+ gtk_box_pack_start (GTK_BOX (hbox), priv->entry_volume_name, FALSE, FALSE, 0);
+ gtk_widget_show (priv->entry_volume_name);
+
+ /* content treeview */
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
+ gtk_widget_show (scrolled_window);
+ gtk_box_pack_start (GTK_BOX (composition), scrolled_window, TRUE, TRUE, 0);
+
+ priv->content = exo_tree_view_new ();
+ model = gtk_tree_store_new (DATA_COMPOSITION_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_UINT64, G_TYPE_STRING, G_TYPE_UINT);
+
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), DATA_COMPOSITION_COLUMN_CONTENT,
+ directory_tree_sortfunc, NULL, NULL);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), DATA_COMPOSITION_COLUMN_CONTENT, GTK_SORT_ASCENDING);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (priv->content), GTK_TREE_MODEL (model));
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->content), TRUE);
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+ gtk_widget_show (priv->content);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), priv->content);
+
+ column_file = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (column_file, _("Contents"));
+
+ cell_icon = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (column_file, cell_icon, FALSE);
+ gtk_tree_view_column_set_attributes (column_file, cell_icon, "pixbuf", DATA_COMPOSITION_COLUMN_ICON, NULL);
+ g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);
+
+ cell_file = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (column_file, cell_file, TRUE);
+ gtk_tree_view_column_set_attributes (column_file, cell_file, "text", DATA_COMPOSITION_COLUMN_CONTENT, NULL);
+ g_signal_connect (G_OBJECT (cell_file), "edited", G_CALLBACK (cb_cell_file_edited), composition);
+ g_object_set (G_OBJECT (cell_file), "editable", TRUE, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (priv->content), column_file);
+
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->content), -1, _("Size"),
+ gtk_cell_renderer_text_new (), "text", DATA_COMPOSITION_COLUMN_HUMANSIZE,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->content), -1, _("Local Path"),
+ gtk_cell_renderer_text_new (), "text", DATA_COMPOSITION_COLUMN_PATH, NULL);
+
+ /* Contents column */
+ gtk_tree_view_column_set_resizable (gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 0), 1);
+ gtk_tree_view_column_set_min_width (gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 0), 200);
+ /* Size (HUMANSIZE) column */
+ gtk_tree_view_column_set_resizable (gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 1), 1);
+ gtk_tree_view_column_set_min_width (gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 1), 60);
+ /* Local Path (PATH) column */
+ gtk_tree_view_column_set_resizable (gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 2), 1);
+
+
+ g_signal_connect (G_OBJECT (priv->content), "row-activated", G_CALLBACK (cb_treeview_row_activated), composition);
+ g_signal_connect (G_OBJECT (priv->content), "button-press-event",
+ G_CALLBACK (cb_treeview_button_pressed), composition);
+ g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_selection_changed), composition);
+
+ /* adding progress window */
+ priv->progress = GTK_WIDGET (xfburn_adding_progress_new ());
+ g_signal_connect (G_OBJECT (priv->progress), "adding-done", G_CALLBACK (cb_adding_done), composition);
+ gtk_window_set_transient_for (GTK_WINDOW (priv->progress), GTK_WINDOW (xfburn_main_window_get_instance ()));
+ /* FIXME: progress should have a busy cursor */
+
+ /* disc usage */
+ priv->disc_usage = xfburn_data_disc_usage_new ();
+ gtk_box_pack_start (GTK_BOX (composition), priv->disc_usage, FALSE, FALSE, 5);
+ gtk_widget_show (priv->disc_usage);
+ g_signal_connect (G_OBJECT (priv->disc_usage), "begin-burn", G_CALLBACK (cb_begin_burn), composition);
+
+ /* set up DnD */
+ gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (priv->content), GDK_BUTTON1_MASK, gte_src,
+ G_N_ELEMENTS (gte_src), GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ g_signal_connect (G_OBJECT (priv->content), "drag-data-get", G_CALLBACK (cb_content_drag_data_get),
+ composition);
+ gtk_tree_view_enable_model_drag_dest (GTK_TREE_VIEW (priv->content), gte_dest, G_N_ELEMENTS (gte_dest),
+ GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ g_signal_connect (G_OBJECT (priv->content), "drag-data-received", G_CALLBACK (cb_content_drag_data_rcv),
+ composition);
+
+ action = gtk_action_group_get_action (priv->action_group, "remove-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), FALSE);
+}
+
+static void
+xfburn_data_composition_finalize (GObject * object)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (object);
+
+ g_free (priv->filename);
+
+ /* free static members */
+ instances--;
+ if (instances == 0) {
+ if (icon_directory) {
+ g_object_unref (icon_directory);
+ icon_directory = NULL;
+ }
+ if (icon_file) {
+ g_object_unref (icon_file);
+ icon_file = NULL;
+ }
+ }
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/*************/
+/* internals */
+/*************/
+static void
+show_custom_controls (XfburnComposition *composition)
+{
+ DBG ("show");
+}
+
+static void
+hide_custom_controls (XfburnComposition *composition)
+{
+ DBG ("hide");
+}
+
+static void
+cb_begin_burn (XfburnDataDiscUsage * du, XfburnDataComposition * dc)
+{
+ XfburnMainWindow *mainwin = xfburn_main_window_get_instance ();
+ GtkWidget *dialog = NULL;
+ IsoImage *image = NULL;
+
+ if (!iso_init()) {
+ g_critical ("Could not initialize libisofs!");
+ return;
+ }
+
+ image = generate_iso_image (XFBURN_DATA_COMPOSITION (dc));
+
+ switch (xfburn_data_disc_usage_get_disc_type (du)) {
+ case CD_DISC:
+ dialog = xfburn_burn_data_cd_composition_dialog_new (image);
+ break;
+ case DVD_DISC:
+ dialog = xfburn_burn_data_dvd_composition_dialog_new (image);
+ break;
+ }
+
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (mainwin));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+cb_treeview_row_activated (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column,
+ XfburnDataComposition * composition)
+{
+ gtk_tree_view_expand_row (treeview, path, FALSE);
+}
+
+static void
+cb_selection_changed (GtkTreeSelection *selection, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ gint n_selected_rows;
+ GtkAction *action = NULL;
+
+
+ n_selected_rows = gtk_tree_selection_count_selected_rows (selection);
+ if (n_selected_rows == 0) {
+ action = gtk_action_group_get_action (priv->action_group, "add-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ action = gtk_action_group_get_action (priv->action_group, "create-dir");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ action = gtk_action_group_get_action (priv->action_group, "remove-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), FALSE);
+ } else if (n_selected_rows == 1) {
+ action = gtk_action_group_get_action (priv->action_group, "add-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ action = gtk_action_group_get_action (priv->action_group, "create-dir");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ action = gtk_action_group_get_action (priv->action_group, "remove-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ } else {
+ action = gtk_action_group_get_action (priv->action_group, "add-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), FALSE);
+ action = gtk_action_group_get_action (priv->action_group, "create-dir");
+ gtk_action_set_sensitive (GTK_ACTION (action), FALSE);
+ action = gtk_action_group_get_action (priv->action_group, "remove-file");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ }
+}
+
+static gboolean
+cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ if ((event->button == 1) && (event->type == GDK_BUTTON_PRESS)) {
+ GtkTreePath *path;
+
+ if (gtk_tree_view_get_path_at_pos (treeview, event->x, event->y, &path, NULL, NULL, NULL)) {
+ gtk_tree_path_free (path);
+ } else {
+ GtkTreeSelection *selection;
+
+ selection = gtk_tree_view_get_selection (treeview);
+ gtk_tree_selection_unselect_all (selection);
+ }
+
+ return FALSE;
+ }
+
+ if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) {
+ GtkTreeSelection *selection;
+ GtkTreePath *path;
+ GtkWidget *menu_popup;
+ GtkWidget *menuitem_remove;
+ GtkWidget *menuitem_rename;
+
+ selection = gtk_tree_view_get_selection (treeview);
+
+ if (gtk_tree_view_get_path_at_pos (treeview, event->x, event->y, &path, NULL, NULL, NULL)) {
+ gtk_tree_selection_unselect_all (selection);
+ gtk_tree_selection_select_path (selection, path);
+ gtk_tree_path_free (path);
+ }
+
+ menu_popup = gtk_ui_manager_get_widget (priv->ui_manager, "/popup-menu");
+ menuitem_remove = gtk_ui_manager_get_widget (priv->ui_manager, "/popup-menu/remove-file");
+ menuitem_rename = gtk_ui_manager_get_widget (priv->ui_manager, "/popup-menu/rename-file");
+
+ if (gtk_tree_selection_count_selected_rows (selection) >= 1)
+ gtk_widget_set_sensitive (menuitem_remove, TRUE);
+ else
+ gtk_widget_set_sensitive (menuitem_remove, FALSE);
+ if (gtk_tree_selection_count_selected_rows (selection) == 1)
+ gtk_widget_set_sensitive (menuitem_rename, TRUE);
+ else
+ gtk_widget_set_sensitive (menuitem_rename, FALSE);
+
+ gtk_menu_popup (GTK_MENU (menu_popup), NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time ());
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gint
+directory_tree_sortfunc (GtkTreeModel * model, GtkTreeIter * a, GtkTreeIter * b, gpointer user_data)
+{
+ /* adapted from gnomebaker */
+ gchar *aname, *bname;
+ DataCompositionEntryType atype = -1, btype = -1;
+ gint result = 0;
+
+ gtk_tree_model_get (model, a, DATA_COMPOSITION_COLUMN_CONTENT, &aname, DATA_COMPOSITION_COLUMN_TYPE, &atype, -1);
+ gtk_tree_model_get (model, b, DATA_COMPOSITION_COLUMN_CONTENT, &bname, DATA_COMPOSITION_COLUMN_TYPE, &btype, -1);
+
+ if ( (atype == DATA_COMPOSITION_TYPE_DIRECTORY) && (btype != DATA_COMPOSITION_TYPE_DIRECTORY) )
+ result = -1;
+ else if ( (atype != DATA_COMPOSITION_TYPE_DIRECTORY) && (btype == DATA_COMPOSITION_TYPE_DIRECTORY) )
+ result = 1;
+ else
+ result = g_ascii_strcasecmp (aname, bname);
+
+ g_free (aname);
+ g_free (bname);
+
+ return result;
+}
+
+static gboolean
+file_exists_on_same_level (GtkTreeModel * model, GtkTreePath * path, gboolean skip_path, const gchar *filename)
+{
+ GtkTreePath *current_path = NULL;
+ GtkTreeIter current_iter;
+
+ current_path = gtk_tree_path_copy (path);
+ for (;gtk_tree_path_prev (current_path););
+
+ if (gtk_tree_model_get_iter (model, ¤t_iter, current_path)) {
+ do {
+ gchar *current_filename = NULL;
+
+ if (skip_path && gtk_tree_path_compare (path, current_path) == 0) {
+ gtk_tree_path_next (current_path);
+ continue;
+ }
+
+ gtk_tree_model_get (model, ¤t_iter, DATA_COMPOSITION_COLUMN_CONTENT, ¤t_filename, -1);
+ if (strcmp (current_filename, filename) == 0) {
+ g_free (current_filename);
+ gtk_tree_path_free (current_path);
+ return TRUE;
+ }
+
+ g_free (current_filename);
+ gtk_tree_path_next (current_path);
+ } while (gtk_tree_model_iter_next (model, ¤t_iter));
+ }
+
+ gtk_tree_path_free (current_path);
+ return FALSE;
+}
+
+static void
+cb_cell_file_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreePath *real_path;
+
+ if (strlen (newtext) == 0) {
+ xfce_err (_("You must give a name to the file"));
+ return;
+ }
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ real_path = gtk_tree_path_new_from_string (path);
+
+ if (gtk_tree_model_get_iter (model, &iter, real_path)) {
+ if (file_exists_on_same_level (model, real_path, TRUE, newtext)) {
+ xfce_err (_("A file with the same name is already present in the composition"));
+ }
+ else {
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter, DATA_COMPOSITION_COLUMN_CONTENT, newtext, -1);
+ }
+ }
+
+ gtk_tree_path_free (real_path);
+}
+
+static void
+cb_adding_done (XfburnAddingProgress *progress, XfburnDataComposition *dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ gtk_widget_hide (priv->progress);
+
+ if (priv->selected_files) {
+ g_free (priv->selected_files);
+ priv->selected_files = NULL;
+ }
+
+ if (priv->path_where_insert) {
+ gtk_tree_path_free (priv->path_where_insert);
+ priv->path_where_insert = NULL;
+ }
+
+ if (priv->full_paths_to_add) {
+ g_slist_foreach (priv->full_paths_to_add, (GFunc) g_free, NULL);
+ g_slist_free (priv->full_paths_to_add);
+ priv->full_paths_to_add = NULL;
+ }
+
+ g_free (priv->thread_params);
+ xfburn_default_cursor (priv->content);
+}
+
+static void
+action_rename_selection (GtkAction * action, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GList *list;
+ GtkTreePath *path;
+ GtkTreeViewColumn *column;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
+ list = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ path = (GtkTreePath *) list->data;
+ column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), DATA_COMPOSITION_COLUMN_CONTENT - 1);
+ /* -1 because of COLUMN_ICON */
+
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
+
+ gtk_tree_path_free (path);
+ g_list_free (list);
+}
+
+static void
+action_create_directory (GtkAction * action, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ GList *selected_paths = NULL;
+ GtkTreePath *path_where_insert = NULL;
+ GtkTreeIter iter_where_insert, iter_directory;
+ DataCompositionEntryType type = -1;
+ gchar *humansize = NULL;
+
+ GtkTreePath *inserted_path = NULL;
+ gchar *directory_text = NULL;
+
+ GtkTreeViewColumn *column;
+ GtkTreePath *path = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
+ selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ if (selected_paths) {
+ path_where_insert = (GtkTreePath *) (selected_paths->data);
+
+ gtk_tree_model_get_iter (model, &iter_where_insert, path_where_insert);
+ gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
+ }
+
+ if (type == DATA_COMPOSITION_TYPE_DIRECTORY) {
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, &iter_where_insert);
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_where_insert, FALSE);
+ } else if (type == DATA_COMPOSITION_TYPE_FILE) {
+ GtkTreeIter parent;
+
+ if (gtk_tree_model_iter_parent (model, &parent, &iter_where_insert))
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, &parent);
+ else
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, NULL);
+ } else {
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, NULL);
+ }
+
+ humansize = xfburn_humanreadable_filesize (4);
+
+ inserted_path = gtk_tree_model_get_path (model, &iter_directory);
+ if (file_exists_on_same_level (model, inserted_path, TRUE, _("New directory")))
+ directory_text = g_strdup_printf ("%s %d", _("New directory"), ++(priv->n_new_directory));
+ else
+ directory_text = g_strdup (_("New directory"));
+ gtk_tree_path_free (inserted_path);
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_directory,
+ DATA_COMPOSITION_COLUMN_ICON, icon_directory,
+ DATA_COMPOSITION_COLUMN_CONTENT, directory_text,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, (guint64) 4,
+ DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_DIRECTORY, -1);
+ g_free (directory_text);
+ g_free (humansize);
+
+ xfburn_data_disc_usage_add_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), 4);
+
+ gtk_widget_realize (priv->content);
+
+ /* put the cell renderer in edition mode */
+ column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), DATA_COMPOSITION_COLUMN_CONTENT - 1);
+ /* -1 because of COLUMN_ICON */
+ path = gtk_tree_model_get_path (model, &iter_directory);
+
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
+ gtk_tree_path_free (path);
+}
+
+static void
+remove_row_reference (GtkTreeRowReference *reference, XfburnDataCompositionPrivate *priv)
+{
+ GtkTreePath *path = NULL;
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ path = gtk_tree_row_reference_get_path (reference);
+ if (path) {
+ GtkTreeIter iter;
+
+ if (gtk_tree_model_get_iter (model, &iter, path)) {
+ GtkTreeIter parent, iter_temp;
+ guint64 size = 0;
+
+ gtk_tree_model_get (model, &iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
+ xfburn_data_disc_usage_sub_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), size);
+
+ iter_temp = iter;
+ while (gtk_tree_model_iter_parent (model, &parent, &iter_temp)) {
+ guint64 old_size;
+ gchar *humansize = NULL;
+
+ /* updates parent directories size */
+ gtk_tree_model_get (model, &parent, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
+
+ humansize = xfburn_humanreadable_filesize (old_size - size);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
+
+ iter_temp = parent;
+
+ g_free (humansize);
+ }
+
+ gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
+ }
+
+ gtk_tree_path_free (path);
+ }
+
+ gtk_tree_row_reference_free (reference);
+}
+
+static void
+action_remove_selection (GtkAction * action, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GList *list_paths = NULL, *el;
+ GList *references = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
+ list_paths = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ el = list_paths;
+ while (el) {
+ GtkTreePath *path = NULL;
+ GtkTreeRowReference *reference = NULL;
+
+ path = (GtkTreePath *) el->data;
+ reference = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
+
+ if (reference)
+ references = g_list_prepend (references, reference);
+
+ el = g_list_next (el);
+ }
+ g_list_free (list_paths);
+
+ g_list_foreach (references, (GFunc) remove_row_reference, priv);
+ g_list_free (references);
+}
+
+
+static void
+action_add_selected_files (GtkAction *action, XfburnDataComposition *dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ XfburnFileBrowser *browser = xfburn_main_window_get_file_browser (xfburn_main_window_get_instance ());
+
+ gchar *selected_files = NULL;
+
+ xfburn_busy_cursor (priv->content);
+ selected_files = xfburn_file_browser_get_selection (browser);
+
+ if (selected_files) {
+ GtkTreeSelection *selection;
+ GList *selected_paths = NULL;
+ ThreadAddFilesActionParams *params;
+
+ xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
+
+ params = g_new (ThreadAddFilesActionParams, 1);
+ params->dc = dc;
+ params->type = -1;
+ priv->path_where_insert = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
+ selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
+ params->model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ if (selected_paths) {
+ priv->path_where_insert = (GtkTreePath *) (selected_paths->data);
+
+ gtk_tree_model_get_iter (params->model, ¶ms->iter_where_insert, priv->path_where_insert);
+ gtk_tree_model_get (params->model, ¶ms->iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, ¶ms->type, -1);
+ }
+
+ priv->selected_files = selected_files;
+
+ priv->thread_params = params;
+ g_thread_create ((GThreadFunc) thread_add_files_action, params, FALSE, NULL);
+
+ g_list_foreach (selected_paths, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free (selected_paths);
+ }
+}
+
+static void
+action_clear (GtkAction * action, XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ gtk_tree_store_clear (GTK_TREE_STORE (model));
+
+ gtk_entry_set_text (GTK_ENTRY (priv->entry_volume_name), _(DATA_COMPOSITION_DEFAULT_NAME));
+
+ xfburn_data_disc_usage_set_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), 0);
+}
+
+static void
+cb_content_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
+ GtkSelectionData * data, guint info, guint time, XfburnDataComposition * content)
+{
+ if (info == DATA_COMPOSITION_DND_TARGET_INSIDE) {
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
+ GtkTreeModel *model;
+ GList *selected_rows = NULL, *row = NULL;
+ GList *references = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
+
+ row = selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ while (row) {
+ GtkTreeRowReference *reference = NULL;
+ GtkTreePath *temp;
+
+ temp = (GtkTreePath *) row->data;
+ reference = gtk_tree_row_reference_new (model, temp);
+ gtk_tree_path_free (temp);
+
+ references = g_list_prepend (references, reference);
+
+ row = g_list_next (row);
+ }
+
+ g_list_free (selected_rows);
+
+ gtk_selection_data_set (data, gdk_atom_intern ("XFBURN_TREE_PATHS", FALSE), 8, (const guchar *) &references,
+ sizeof (GList **));
+ }
+}
+
+static void
+set_modified (XfburnDataCompositionPrivate *priv)
+{
+ if (!(priv->modified)) {
+ XfburnMainWindow *mainwin;
+ GtkUIManager *ui_manager;
+ GtkActionGroup *action_group;
+
+ mainwin = xfburn_main_window_get_instance ();
+ ui_manager = xfburn_main_window_get_ui_manager (mainwin);
+
+ action_group = (GtkActionGroup *) gtk_ui_manager_get_action_groups (ui_manager)->data;
+
+ /*
+ action = gtk_action_group_get_action (action_group, "save-composition");
+ gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
+ */
+ priv->modified = TRUE;
+ }
+}
+
+static gboolean
+thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
+ GtkTreeModel * model, const gchar * path,
+ GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ struct stat s;
+
+ if ((stat (path, &s) == 0)) {
+ gchar *basename = NULL;
+ gchar *humansize = NULL;
+ GtkTreeIter *parent = NULL;
+ GtkTreePath *tree_path = NULL;
+
+ if (!S_ISDIR (s.st_mode) && !S_ISREG (s.st_mode)) {
+ return FALSE;
+ }
+
+ basename = g_path_get_basename (path);
+ if ( (strlen (basename) > 1) && (basename[0] == '.') ) {
+ /* FIXME: is this really what we want? */
+ /* don't add hidden files/directories */
+
+ g_free (basename);
+ return FALSE;
+ }
+ g_free (basename);
+
+ xfburn_adding_progress_pulse (XFBURN_ADDING_PROGRESS (priv->progress));
+
+ /* find parent */
+ switch (position){
+ case GTK_TREE_VIEW_DROP_BEFORE:
+ case GTK_TREE_VIEW_DROP_AFTER:
+ if (insertion) {
+ GtkTreeIter iter_parent;
+
+ gdk_threads_enter ();
+ if (gtk_tree_model_iter_parent (model, &iter_parent, insertion)) {
+ parent = g_new0 (GtkTreeIter, 1);
+ memcpy (parent, &iter_parent, sizeof (GtkTreeIter));
+ }
+ gdk_threads_leave ();
+ }
+ break;
+ case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
+ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
+ parent = g_new0 (GtkTreeIter, 1);
+ memcpy (parent, insertion, sizeof (GtkTreeIter));
+ break;
+ }
+
+ /* check if the filename is valid */
+ gdk_threads_enter ();
+ if (parent) {
+ tree_path = gtk_tree_model_get_path (model, parent);
+ gtk_tree_path_down (tree_path);
+ } else {
+ tree_path = gtk_tree_path_new_first ();
+ }
+ gdk_threads_leave ();
+
+ gdk_threads_enter ();
+ if (file_exists_on_same_level (model, tree_path, FALSE, name)) {
+ xfce_err (_("A file with the same name is already present in the composition"));
+
+ gtk_tree_path_free (tree_path);
+ gdk_threads_leave ();
+ g_free (parent);
+ return FALSE;
+ }
+ gtk_tree_path_free (tree_path);
+ gdk_threads_leave ();
+
+ /* new directory */
+ if (S_ISDIR (s.st_mode)) {
+ GDir *dir = NULL;
+ GError *error = NULL;
+ const gchar *filename = NULL;
+ guint64 total_size = 4;
+
+ dir = g_dir_open (path, 0, &error);
+ if (!dir) {
+ g_warning ("unable to open directory : %s", error->message);
+
+ g_error_free (error);
+ g_free (parent);
+
+ return FALSE;
+ }
+
+ gdk_threads_enter ();
+ gtk_tree_store_append (GTK_TREE_STORE (model), iter, parent);
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ DATA_COMPOSITION_COLUMN_ICON, icon_directory,
+ DATA_COMPOSITION_COLUMN_CONTENT, name,
+ DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_DIRECTORY,
+ DATA_COMPOSITION_COLUMN_SIZE, (guint64) 4, -1);
+ xfburn_data_disc_usage_add_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), (guint64) 4);
+ gdk_threads_leave ();
+
+ while ((filename = g_dir_read_name (dir))) {
+ GtkTreeIter new_iter;
+ gchar *new_path = NULL;
+
+ new_path = g_build_filename (path, filename, NULL);
+ if (new_path) {
+ guint64 size;
+
+ if (thread_add_file_to_list (dc, model, new_path, &new_iter, iter, GTK_TREE_VIEW_DROP_INTO_OR_AFTER)) {
+ gdk_threads_enter ();
+ gtk_tree_model_get (model, &new_iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
+ gdk_threads_leave ();
+ total_size += size;
+ }
+
+ g_free (new_path);
+ }
+ }
+
+ humansize = xfburn_humanreadable_filesize (total_size);
+ gdk_threads_enter ();
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize, DATA_COMPOSITION_COLUMN_SIZE, total_size, -1);
+ gdk_threads_leave ();
+
+ g_dir_close (dir);
+ }
+ /* new file */
+ else if (S_ISREG (s.st_mode)) {
+#ifdef HAVE_THUNAR_VFS
+ GdkScreen *screen;
+ GtkIconTheme *icon_theme;
+ ThunarVfsMimeDatabase *mime_database = NULL;
+ ThunarVfsMimeInfo *mime_info = NULL;
+ const gchar *mime_icon_name = NULL;
+ GdkPixbuf *mime_icon = NULL;
+ gint x,y;
+
+ gdk_threads_enter ();
+ screen = gtk_widget_get_screen (GTK_WIDGET (dc));
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+ mime_database = thunar_vfs_mime_database_get_default ();
+ mime_info = thunar_vfs_mime_database_get_info_for_file (mime_database, path, NULL);
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+ mime_icon_name = thunar_vfs_mime_info_lookup_icon_name (mime_info, icon_theme);
+ mime_icon = gtk_icon_theme_load_icon (icon_theme, mime_icon_name, x, 0, NULL);
+#endif
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), iter, parent);
+
+ humansize = xfburn_humanreadable_filesize (s.st_size);
+
+#ifdef HAVE_THUNAR_VFS
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ DATA_COMPOSITION_COLUMN_ICON, (G_IS_OBJECT (mime_icon) ? mime_icon : icon_file),
+ DATA_COMPOSITION_COLUMN_CONTENT, name,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size, DATA_COMPOSITION_COLUMN_PATH, path,
+ DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_FILE, -1);
+#else
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ DATA_COMPOSITION_COLUMN_ICON, icon_file,
+ DATA_COMPOSITION_COLUMN_CONTENT, name,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size, DATA_COMPOSITION_COLUMN_PATH, path,
+ DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_FILE, -1);
+#endif
+
+ xfburn_data_disc_usage_add_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), s.st_size);
+#ifdef HAVE_THUNAR_VFS
+ if (G_LIKELY (G_IS_OBJECT (mime_icon)))
+ g_object_unref (mime_icon);
+ thunar_vfs_mime_info_unref (mime_info);
+ g_object_unref (mime_database);
+ gdk_threads_leave ();
+#endif
+ }
+ g_free (humansize);
+ g_free (parent);
+
+ set_modified (priv);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* thread entry point */
+static void
+thread_add_files_cli (ThreadAddFilesCLIParams *params)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (params->dc);
+ GtkTreeIter iter;
+
+ GtkTreeModel *model;
+ int i;
+ gchar *full_path = NULL;
+
+ gdk_threads_enter ();
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ gdk_threads_leave ();
+
+ for (i=0; i<params->filec; i++) {
+ full_path = g_build_filename (params->filenames[i], NULL);
+ g_message ("Adding %s to the data composition... (might take a while)", full_path);
+ thread_add_file_to_list (params->dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ g_free (full_path);
+ }
+ xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
+}
+
+static gboolean
+show_add_home_question_dialog ()
+{
+ gboolean ok = TRUE;
+
+ gdk_threads_enter ();
+ DBG ("Adding home directory");
+ ok = xfburn_ask_yes_no (GTK_MESSAGE_WARNING, ((const gchar *) _("Adding home directory")),
+ _("You are about to add your home directory to the composition. " \
+ "This is likely to take a very long time, and also to be too big to fit on one disc.\n\n" \
+ "Are you sure you want to proceed?")
+ );
+
+ gdk_threads_leave ();
+
+ return ok;
+}
+
+/* thread entry point */
+static void
+thread_add_files_action (ThreadAddFilesActionParams *params)
+{
+ XfburnDataComposition *dc = params->dc;
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ GtkTreeModel *model = params->model;
+ GtkTreeIter iter_where_insert = params->iter_where_insert;
+ GtkTreePath *path_where_insert = priv->path_where_insert;
+ const gchar * file = NULL;
+
+
+ file = strtok (priv->selected_files, "\n");
+ while (file) {
+ GtkTreeIter iter;
+ gchar *full_path = NULL;
+
+ if (g_str_has_prefix (file, "file://"))
+ full_path = g_build_filename (&file[7], NULL);
+ else if (g_str_has_prefix (file, "file:"))
+ full_path = g_build_filename (&file[5], NULL);
+ else
+ full_path = g_build_filename (file, NULL);
+
+ if (full_path[strlen (full_path) - 1] == '\r')
+ full_path[strlen (full_path) - 1] = '\0';
+
+ if (strcmp (full_path, g_getenv ("HOME")) == 0) {
+ if (!show_add_home_question_dialog ()) {
+ g_free (full_path);
+ break;
+ }
+ }
+
+ /* add files to the disc content */
+ if (params->type == DATA_COMPOSITION_TYPE_DIRECTORY) {
+ guint64 old_size, size;
+ gchar *humansize = NULL;
+
+ thread_add_file_to_list (dc, model, full_path, &iter, &iter_where_insert, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ gdk_threads_enter ();
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_where_insert, FALSE);
+
+ /* update parent directory size */
+ gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
+ gtk_tree_model_get (model, &iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
+ gdk_threads_leave ();
+
+ humansize = xfburn_humanreadable_filesize (old_size + size);
+
+ gdk_threads_enter ();
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_where_insert,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, old_size + size, -1);
+ gdk_threads_leave ();
+
+ g_free (humansize);
+ } else if (params->type == DATA_COMPOSITION_TYPE_FILE) {
+ GtkTreeIter parent;
+ gboolean has_parent;
+
+ gdk_threads_enter ();
+ has_parent = gtk_tree_model_iter_parent (model, &parent, &iter_where_insert);
+ gdk_threads_leave ();
+
+ if (has_parent)
+ thread_add_file_to_list (dc, model, full_path, &iter, &parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ else
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ } else {
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ }
+
+ g_free (full_path);
+
+ file = strtok (NULL, "\n");
+ }
+ xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
+}
+
+static gboolean
+thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model,
+ const gchar * path, GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ struct stat s;
+ gboolean ret = FALSE;
+
+ if (xfburn_adding_progress_is_aborted (XFBURN_ADDING_PROGRESS (priv->progress))) {
+ DBG ("Adding aborted");
+ xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
+ /* FIXME: does this properly release the resources allocated in this thread? */
+ g_thread_exit (NULL);
+ }
+
+ if ((stat (path, &s) == 0)) {
+ gchar *basename = NULL;
+
+ basename = g_path_get_basename (path);
+
+ ret = thread_add_file_to_list_with_name (basename, dc, model, path, iter, insertion, position);
+
+ g_free (basename);
+ }
+
+ return ret;
+}
+
+static gboolean
+copy_entry_to (XfburnDataComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, GtkTreeViewDropPosition position)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ gboolean ret = FALSE;
+
+ GtkTreeModel *model;
+ GtkTreeIter iter_new;
+
+ GdkPixbuf *icon = NULL;
+ gchar *name = NULL;
+ gchar *humansize = NULL;
+ guint64 size = 0;
+ gchar *path = NULL;
+ DataCompositionEntryType type;
+
+ GtkTreePath *path_level = NULL;
+
+ guint n_children = 0;
+ guint i;
+ GtkTreePath *path_src = NULL;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ gtk_tree_model_get (model, src, DATA_COMPOSITION_COLUMN_ICON, &icon, DATA_COMPOSITION_COLUMN_CONTENT, &name,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, &humansize, DATA_COMPOSITION_COLUMN_SIZE, &size,
+ DATA_COMPOSITION_COLUMN_PATH, &path, DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
+
+ switch (position) {
+ case GTK_TREE_VIEW_DROP_BEFORE:
+ case GTK_TREE_VIEW_DROP_AFTER:
+ gtk_tree_store_insert_before (GTK_TREE_STORE (model), &iter_new, NULL, dest);
+ break;
+ case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
+ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
+ if (dest) {
+ path_level = gtk_tree_model_get_path (model, dest);
+ gtk_tree_path_down (path_level);
+ } else {
+ path_level = gtk_tree_path_new_first ();
+ }
+
+ if (file_exists_on_same_level (model, path_level, FALSE, name)) {
+ xfce_warn (_("A file named \"%s\" already exists in this directory, the file hasn't been added"), name);
+ goto cleanup;
+ }
+
+ gtk_tree_path_free (path_level);
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_new, dest);
+ break;
+ }
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_new, DATA_COMPOSITION_COLUMN_ICON, icon,
+ DATA_COMPOSITION_COLUMN_CONTENT, name, DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, size, DATA_COMPOSITION_COLUMN_PATH, path,
+ DATA_COMPOSITION_COLUMN_TYPE, type, -1);
+
+ /* copy children */
+ n_children = gtk_tree_model_iter_n_children (model, src);
+
+ for (i = 0; i < n_children; i++) {
+ GtkTreeIter iter_child;
+
+ if (gtk_tree_model_iter_nth_child (model, &iter_child, src, i))
+ copy_entry_to (dc, &iter_child, &iter_new, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ }
+
+ path_src = gtk_tree_model_get_path (model, src);
+ if (n_children > 0 && gtk_tree_view_row_expanded (GTK_TREE_VIEW (priv->content), path_src)) {
+ GtkTreePath *path_new = NULL;
+
+ path_new = gtk_tree_model_get_path (model, &iter_new);
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_new, FALSE);
+
+ gtk_tree_path_free (path_new);
+ }
+ gtk_tree_path_free (path_src);
+
+ ret = TRUE;
+
+cleanup:
+ if (G_LIKELY (G_IS_OBJECT (icon)))
+ g_object_unref (icon);
+ g_free (name);
+ g_free (humansize);
+ g_free (path);
+
+ return ret;
+}
+
+static void
+cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guint y, GtkSelectionData * sd,
+ guint info, guint t, XfburnDataComposition * composition)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+
+ GtkTreeModel *model;
+ GtkTreePath *path_where_insert = NULL;
+ GtkTreeViewDropPosition position;
+ GtkTreeIter iter_where_insert;
+
+ g_return_if_fail (sd);
+ g_return_if_fail (sd->data);
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+
+ gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path_where_insert, &position);
+
+ xfburn_busy_cursor (priv->content);
+
+ /* move a selection inside of the composition window */
+ if (sd->target == gdk_atom_intern ("XFBURN_TREE_PATHS", FALSE)) {
+ GList *row = NULL, *selected_rows = NULL;
+ GtkTreeIter *iter = NULL;
+ DataCompositionEntryType type_dest = -1;
+
+ xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
+
+ row = selected_rows = *((GList **) sd->data);
+
+ if (path_where_insert) {
+ gtk_tree_model_get_iter (model, &iter_where_insert, path_where_insert);
+ iter = &iter_where_insert;
+
+ gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, &type_dest, -1);
+
+ if (type_dest == DATA_COMPOSITION_TYPE_FILE) {
+ if (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
+ position = GTK_TREE_VIEW_DROP_AFTER;
+ else if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
+ position = GTK_TREE_VIEW_DROP_BEFORE;
+ }
+ } else {
+ position = GTK_TREE_VIEW_DROP_INTO_OR_AFTER;
+ }
+
+ /* copy selection */
+ while (row) {
+ GtkTreePath *path_src = NULL;
+ GtkTreeIter iter_src;
+ GtkTreeRowReference *reference = NULL;
+ DataCompositionEntryType type;
+ guint64 size = 0;
+
+ reference = (GtkTreeRowReference *) row->data;
+
+ path_src = gtk_tree_row_reference_get_path (reference);
+ if (!path_src) {
+ gtk_tree_row_reference_free (reference);
+
+ row = g_list_next (row);
+ continue;
+ }
+
+ if (path_where_insert && (position == GTK_TREE_VIEW_DROP_AFTER || position == GTK_TREE_VIEW_DROP_BEFORE)
+ && (gtk_tree_path_get_depth (path_where_insert) == gtk_tree_path_get_depth (path_src))) {
+ gtk_tree_path_free (path_src);
+ gtk_tree_row_reference_free (reference);
+
+ row = g_list_next (row);
+ continue;
+ }
+
+ if (path_where_insert && type == DATA_COMPOSITION_TYPE_DIRECTORY
+ && gtk_tree_path_is_descendant (path_where_insert, path_src)) {
+
+ gtk_tree_path_free (path_src);
+ gtk_tree_path_free (path_where_insert);
+ gtk_tree_row_reference_free (reference);
+
+ gtk_drag_finish (dc, FALSE, FALSE, t);
+ return;
+ }
+
+ gtk_tree_model_get_iter (model, &iter_src, path_src);
+ gtk_tree_model_get (model, &iter_src, DATA_COMPOSITION_COLUMN_TYPE, &type,
+ DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
+
+ /* copy entry */
+ if (copy_entry_to (composition, &iter_src, iter, position)) {
+ GtkTreePath *path_parent = gtk_tree_path_copy (path_src);
+
+ /* update new parent size */
+ if (iter && (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER
+ || position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)) {
+ guint64 old_size = 0;
+ gchar *parent_humansize = NULL;
+
+ gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
+
+ parent_humansize = xfburn_humanreadable_filesize (old_size + size);
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter, DATA_COMPOSITION_COLUMN_HUMANSIZE, parent_humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, old_size + size, -1);
+
+ g_free (parent_humansize);
+ }
+
+ if (dc->action == GDK_ACTION_MOVE) {
+ /* remove source entry */
+ if (gtk_tree_path_up (path_parent) && path_where_insert &&
+ !gtk_tree_path_is_descendant (path_where_insert, path_parent)) {
+ /* update parent size and humansize */
+ GtkTreeIter iter_parent;
+ guint64 old_size;
+ gchar *parent_humansize = NULL;
+
+ gtk_tree_model_iter_parent (model, &iter_parent, &iter_src);
+ gtk_tree_model_get (model, &iter_parent, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
+
+ parent_humansize = xfburn_humanreadable_filesize (old_size - size);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_parent,
+ DATA_COMPOSITION_COLUMN_HUMANSIZE, parent_humansize,
+ DATA_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
+ g_free (parent_humansize);
+ }
+
+ gtk_tree_store_remove (GTK_TREE_STORE (model), &iter_src);
+ } else {
+ xfburn_data_disc_usage_add_size (XFBURN_DATA_DISC_USAGE (priv->disc_usage), size);
+ }
+
+ gtk_tree_path_free (path_parent);
+ }
+
+ gtk_tree_path_free (path_src);
+ gtk_tree_row_reference_free (reference);
+
+ row = g_list_next (row);
+ }
+
+ g_list_free (selected_rows);
+ gtk_drag_finish (dc, TRUE, FALSE, t);
+
+ if (path_where_insert)
+ gtk_tree_path_free (path_where_insert);
+ gtk_widget_hide (priv->progress);
+ xfburn_default_cursor (priv->content);
+ }
+ /* drag from the file selector */
+ else if (sd->target == gdk_atom_intern ("text/plain", FALSE)) {
+ ThreadAddFilesDragParams *params;
+ const gchar *file = NULL;
+
+ xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
+
+ file = strtok ((gchar *) sd->data, "\n");
+ while (file) {
+ gchar *full_path;
+
+ if (g_str_has_prefix (file, "file://"))
+ full_path = g_build_filename (&file[7], NULL);
+ else if (g_str_has_prefix ((gchar *) sd->data, "file:"))
+ full_path = g_build_filename (&file[5], NULL);
+ else
+ full_path = g_build_filename (file, NULL);
+
+ if (full_path[strlen (full_path) - 1] == '\r')
+ full_path[strlen (full_path) - 1] = '\0';
+
+ /* remember path to add it later in another thread */
+ priv->full_paths_to_add = g_slist_append (priv->full_paths_to_add, full_path);
+
+ file = strtok (NULL, "\n");
+ }
+
+ priv->full_paths_to_add = g_slist_reverse (priv->full_paths_to_add);
+
+ params = g_new (ThreadAddFilesDragParams, 1);
+ params->composition = composition;
+ params->position = position;
+ params->widget = widget;
+
+ /* append a dummy row so that gtk doesn't freak out */
+ gtk_tree_store_append (GTK_TREE_STORE (model), ¶ms->iter_dummy, NULL);
+
+ priv->thread_params = params;
+ g_thread_create ((GThreadFunc) thread_add_files_drag, params, FALSE, NULL);
+
+ gtk_drag_finish (dc, TRUE, FALSE, t);
+ } else {
+ g_warning ("Trying to receive an unsupported drag target, this should not happen.");
+ gtk_drag_finish (dc, FALSE, FALSE, t);
+ xfburn_default_cursor (priv->content);
+ }
+}
+
+/* thread entry point */
+static void
+thread_add_files_drag (ThreadAddFilesDragParams *params)
+{
+ XfburnDataComposition *composition = params->composition;
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+
+ GtkTreeViewDropPosition position = params->position;
+ GtkWidget *widget = params->widget;
+
+ GtkTreeModel *model;
+ GtkTreeIter iter_where_insert;
+ GSList *files = priv->full_paths_to_add;
+
+ gdk_threads_enter ();
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+
+ /* remove the dummy row again */
+ gtk_tree_store_remove (GTK_TREE_STORE (model), ¶ms->iter_dummy);
+ gdk_threads_leave ();
+
+ for (; files; files = g_slist_next (files)) {
+ gchar *full_path = (gchar *) files->data;
+ GtkTreeIter iter;
+
+ if (priv->path_where_insert) {
+ gdk_threads_enter ();
+ gtk_tree_model_get_iter (model, &iter_where_insert, priv->path_where_insert);
+ gdk_threads_leave ();
+
+ if (thread_add_file_to_list (composition, model, full_path, &iter, &iter_where_insert, position)) {
+ if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
+ || position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
+ gdk_threads_enter ();
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), priv->path_where_insert, FALSE);
+ gdk_threads_leave ();
+ }
+
+ } else {
+ thread_add_file_to_list (composition, model, full_path, &iter, NULL, position);
+ }
+ }
+ xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
+}
+
+static void
+fill_image_with_composition (GtkTreeModel *model, IsoImage *image, IsoDir * parent, GtkTreeIter *iter)
+{
+ do {
+ DataCompositionEntryType type;
+ gchar *name = NULL;
+ gchar *src = NULL;
+ IsoNode *node = NULL;
+ IsoDir *dir = NULL;
+ int r;
+
+ gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_TYPE, &type,
+ DATA_COMPOSITION_COLUMN_CONTENT, &name, DATA_COMPOSITION_COLUMN_PATH, &src, -1);
+
+ if (type == DATA_COMPOSITION_TYPE_DIRECTORY)
+ r = iso_tree_add_new_dir (parent, name, &dir);
+ else
+ r = iso_tree_add_node (image, parent, src, &node);
+
+ if (r < 0) {
+ if (r == ISO_NULL_POINTER)
+ g_error ("Failed adding %s as a node to the image: null pointer!", src);
+ else if (r == ISO_NODE_NAME_NOT_UNIQUE)
+ g_error ("Failed adding %s as a node to the image: node name not unique!", src);
+ /* else if (r == ISO_MEM_ERROR)
+ g_error ("Failed adding %s as a node to the image: memory error!", src); */
+ else
+ g_error ("Failed adding %s as a node to the image: code %d!", src, r);
+ }
+
+ /* FIXME: do we need to call iso_node_ref on node? Probably not... */
+ if (type != DATA_COMPOSITION_TYPE_DIRECTORY)
+ iso_node_set_name (node, name);
+
+ g_free (name);
+ g_free (src);
+
+ if (type == DATA_COMPOSITION_TYPE_DIRECTORY && gtk_tree_model_iter_has_child (model, iter)) {
+ GtkTreeIter child;
+
+ /* FIXME: this should not cause a sigfault...
+ if (iso_node_get_type(node) != LIBISO_DIR)
+ g_error ("Expected %s to be a directory, but it isn't...\n", src);
+ */
+
+ gtk_tree_model_iter_children (model, &child, iter);
+ fill_image_with_composition (model, image, dir, &child);
+ }
+ } while (gtk_tree_model_iter_next (model, iter));
+}
+
+static IsoImage *
+generate_iso_image (XfburnDataComposition * dc)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ IsoImage *image = NULL;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ iso_image_new (gtk_entry_get_text (GTK_ENTRY (priv->entry_volume_name)), &image);
+ iso_image_set_application_id (image, "Xfburn");
+ iso_image_set_data_preparer_id (image, "Xfburn");
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ if (gtk_tree_model_get_iter_first (model, &iter)) {
+ fill_image_with_composition (model, image, iso_image_get_root (image), &iter);
+ }
+
+ return image;
+}
+
+/****************/
+/* loading code */
+/****************/
+typedef struct
+{
+ gboolean started;
+ XfburnDataComposition *dc;
+ GQueue *queue_iter;
+} LoadParserStruct;
+
+static gint
+_find_attribute (const gchar ** attribute_names, const gchar * attr)
+{
+ gint i;
+
+ for (i = 0; attribute_names[i]; i++) {
+ if (!strcmp (attribute_names[i], attr))
+ return i;
+ }
+
+ return -1;
+}
+
+static void
+load_composition_start (GMarkupParseContext * context, const gchar * element_name,
+ const gchar ** attribute_names, const gchar ** attribute_values,
+ gpointer data, GError ** error)
+{
+ LoadParserStruct * parserinfo = (LoadParserStruct *) data;
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (parserinfo->dc);
+
+
+ if (!(parserinfo->started) && !strcmp (element_name, "xfburn-composition"))
+ parserinfo->started = TRUE;
+ else if (!(parserinfo->started))
+ return;
+
+ if (!strcmp (element_name, "file")) {
+ int i, j;
+
+ if ((i = _find_attribute (attribute_names, "name")) != -1 &&
+ (j = _find_attribute (attribute_names, "source")) != -1) {
+ //GtkTreeIter iter;
+ GtkTreeIter *parent;
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ parent = g_queue_peek_head (parserinfo->queue_iter);
+
+ g_error ("This method needs to get fixed, and does not work right now!");
+ /*
+ add_file_to_list_with_name (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter,
+ parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ */
+ }
+ } else if (!strcmp (element_name, "directory")) {
+ int i, j;
+
+ if ((i = _find_attribute (attribute_names, "name")) != -1 &&
+ (j = _find_attribute (attribute_names, "source")) != -1) {
+ //GtkTreeIter iter;
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ //add_directory_to_list (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter, parent);
+ }
+ }
+}
+
+static void
+load_composition_end (GMarkupParseContext * context, const gchar * element_name, gpointer user_data, GError ** error)
+{
+ LoadParserStruct *parserinfo = (LoadParserStruct *) user_data;
+
+ if (!parserinfo->started)
+ return;
+
+ if (!strcmp (element_name, "xfburn-composition"))
+ parserinfo->started = FALSE;
+
+ if (!strcmp (element_name, "directory"))
+ parserinfo->queue_iter = g_queue_pop_head (parserinfo->queue_iter);
+}
+
+static void
+load_from_file (XfburnComposition * composition, const gchar * filename)
+{
+ gchar *file_contents = NULL;
+ GMarkupParseContext *gpcontext = NULL;
+ struct stat st;
+ LoadParserStruct parserinfo;
+ GMarkupParser gmparser = {
+ load_composition_start, load_composition_end, NULL, NULL, NULL
+ };
+ GError *err = NULL;
+#ifdef HAVE_MMAP
+ gint fd = -1;
+ void *maddr = NULL;
+#endif
+ g_return_if_fail (filename != NULL);
+ if (stat (filename, &st) < 0) {
+ g_warning ("Unable to open %s", filename);
+ goto cleanup;
+ }
+
+#ifdef HAVE_MMAP
+ fd = open (filename, O_RDONLY, 0);
+ if (fd < 0)
+ goto cleanup;
+ maddr = mmap (NULL, st.st_size, PROT_READ, MAP_FILE | MAP_SHARED, fd, 0);
+ if (maddr)
+ file_contents = maddr;
+#endif
+ if (!file_contents && !g_file_get_contents (filename, &file_contents, NULL, &err)) {
+ if (err) {
+ g_warning ("Unable to read file '%s' (%d): %s", filename, err->code, err->message);
+ g_error_free (err);
+ }
+ goto cleanup;
+ }
+
+ parserinfo.started = FALSE;
+ parserinfo.dc = XFBURN_DATA_COMPOSITION (composition);
+ parserinfo.queue_iter = g_queue_new ();
+ gpcontext = g_markup_parse_context_new (&gmparser, 0, &parserinfo, NULL);
+ if (!g_markup_parse_context_parse (gpcontext, file_contents, st.st_size, &err)) {
+ g_warning ("Error parsing composition (%d): %s", err->code, err->message);
+ g_error_free (err);
+ goto cleanup;
+ }
+
+ if (g_markup_parse_context_end_parse (gpcontext, NULL)) {
+ DBG ("parsed");
+ }
+
+ g_queue_free (parserinfo.queue_iter);
+
+cleanup:
+ if (gpcontext)
+ g_markup_parse_context_free (gpcontext);
+#ifdef HAVE_MMAP
+ if (maddr) {
+ munmap (maddr, st.st_size);
+ file_contents = NULL;
+ }
+ if (fd > -1)
+ close (fd);
+#endif
+ if (file_contents)
+ g_free (file_contents);
+}
+
+
+/***************/
+/* saving code */
+/***************/
+typedef struct
+{
+ FILE *file_content;
+ gint last_depth;
+} CompositionSaveInfo;
+
+static gboolean
+foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, CompositionSaveInfo *info)
+{
+ gchar *space = NULL;
+ gint i;
+ gchar *name = NULL;
+ gchar *source_path = NULL;
+ DataCompositionEntryType type;
+
+ space = g_strnfill (gtk_tree_path_get_depth (path), '\t');
+
+ for (i = info->last_depth; i > gtk_tree_path_get_depth (path); i--) {
+ gchar *space2 = NULL;
+
+ space2 = g_strnfill (i - 1, '\t');
+ fprintf (info->file_content, "%s</directory>\n", space2);
+
+ g_free (space2);
+ }
+
+ gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_CONTENT, &name,
+ DATA_COMPOSITION_COLUMN_PATH, &source_path,
+ DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
+
+ fprintf (info->file_content, "%s", space);
+ switch (type) {
+ case DATA_COMPOSITION_TYPE_FILE:
+ fprintf (info->file_content, "<file name=\"%s\" source=\"%s\" />\n", name, source_path);
+ break;
+ case DATA_COMPOSITION_TYPE_DIRECTORY:
+ fprintf (info->file_content, "<directory name=\"%s\" source=\"%s\"", name, source_path);
+
+ if (gtk_tree_model_iter_has_child (model, iter))
+ fprintf (info->file_content, ">\n");
+ else
+ fprintf (info->file_content, "/>\n");
+
+ break;
+ }
+
+
+ info->last_depth = gtk_tree_path_get_depth (path);
+
+ g_free (space);
+ g_free (name);
+ g_free (source_path);
+
+ return FALSE;
+}
+
+static void
+save_to_file (XfburnComposition * composition)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+ FILE *file_content;
+ GtkTreeModel *model;
+ CompositionSaveInfo info = {};
+ gint i;
+
+ if (!(priv->filename)) {
+ priv->filename = g_strdup ("/tmp/gna");
+
+ g_signal_emit_by_name (G_OBJECT (composition), "name-changed", priv->filename);
+ }
+
+ file_content = fopen (priv->filename, "w+");
+ fprintf (file_content, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
+ fprintf (file_content, "<xfburn-composition version=\"0.1\">\n");
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+ info.file_content = file_content;
+ info.last_depth = 0;
+ gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) foreach_save, &info);
+
+ for (i = info.last_depth; i > 1; i--) {
+ gchar *space2 = NULL;
+
+ space2 = g_strnfill (i - 1, '\t');
+ fprintf (info.file_content, "%s</directory>\n", space2);
+
+ g_free (space2);
+ }
+
+ fprintf (file_content, "</xfburn-composition>\n");
+ fclose (file_content);
+}
+
+/******************/
+/* public methods */
+/******************/
+GtkWidget *
+xfburn_data_composition_new (void)
+{
+ return g_object_new (xfburn_data_composition_get_type (), NULL);
+}
+
+void
+xfburn_data_composition_add_files (XfburnDataComposition *dc, int filec, char **filenames)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+ ThreadAddFilesCLIParams *params;
+
+ if (filec > 0) {
+ params = g_new (ThreadAddFilesCLIParams, 1);
+
+ params->filenames = filenames;
+ params->filec = filec;
+ params->dc = dc;
+
+ xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
+ xfburn_busy_cursor (priv->content);
+
+ priv->thread_params = params;
+ g_thread_create ((GThreadFunc) thread_add_files_cli, params, FALSE, NULL);
+ }
+}
+
+void
+xfburn_data_composition_hide_toolbar (XfburnDataComposition * composition)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+
+ gtk_widget_hide (priv->toolbar);
+}
+
+void
+xfburn_data_composition_show_toolbar (XfburnDataComposition * composition)
+{
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
+
+ gtk_widget_show (priv->toolbar);
+}
+
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h (from rev 5093, xfburn/trunk/xfburn/xfburn-data-composition.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-composition.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,63 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_DATA_COMPOSITION_H__
+#define __XFBURN_DATA_COMPOSITION_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_DATA_COMPOSITION (xfburn_data_composition_get_type ())
+#define XFBURN_DATA_COMPOSITION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_DATA_COMPOSITION, XfburnDataComposition))
+#define XFBURN_DATA_COMPOSITION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_DATA_COMPOSITION, XfburnDataCompositionClass))
+#define XFBURN_IS_DATA_COMPOSITION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_DATA_COMPOSITION))
+#define XFBURN_IS_DATA_COMPOSITION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_DATA_COMPOSITION))
+#define XFBURN_DATA_COMPOSITION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_DATA_COMPOSITION, XfburnDataCompositionClass))
+
+typedef struct
+{
+ GtkVBox vbox;
+} XfburnDataComposition;
+
+typedef struct
+{
+ GtkVBoxClass parent_class;
+} XfburnDataCompositionClass;
+
+enum
+{
+ DATA_COMPOSITION_DND_TARGET_INSIDE,
+ DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN,
+};
+
+GtkType xfburn_data_composition_get_type (void);
+
+GtkWidget *xfburn_data_composition_new (void);
+void xfburn_data_composition_add_files (XfburnDataComposition *content, int filec, char **filenames);
+void xfburn_data_composition_hide_toolbar (XfburnDataComposition *content);
+void xfburn_data_composition_show_toolbar (XfburnDataComposition *content);
+
+
+G_END_DECLS
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c (from rev 5093, xfburn/trunk/xfburn/xfburn-data-disc-usage.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,248 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "xfburn-data-disc-usage.h"
+#include "xfburn-global.h"
+#include "xfburn-settings.h"
+#include "xfburn-utils.h"
+#include "xfburn-stock.h"
+#include "xfburn-main-window.h"
+
+/* prototypes */
+static void xfburn_data_disc_usage_class_init (XfburnDataDiscUsageClass *);
+static void xfburn_data_disc_usage_init (XfburnDataDiscUsage *);
+
+static void cb_button_clicked (GtkButton *, XfburnDataDiscUsage *);
+static void cb_combo_changed (GtkComboBox *, XfburnDataDiscUsage *);
+
+/* globals */
+static GtkHBoxClass *parent_class = NULL;
+
+#define DEFAULT_DISK_SIZE_LABEL 2
+#define LAST_CD_LABEL 4
+#define NUM_LABELS 7
+
+struct
+{
+ guint64 size;
+ gchar *label;
+} datadisksizes[] = {
+ {
+ 200 *1024 * 1024, "200MB CD"},
+ {
+ 681984000, "650MB CD"},
+ {
+ 737280000, "700MB CD"},
+ {
+ 829440000, "800MB CD"},
+ {
+ 912384000, "900MB CD"},
+ {
+ G_GINT64_CONSTANT(0x1182a0000), "4.7GB DVD"}, /* 4 700 372 992 */
+ {
+ G_GINT64_CONSTANT(0x1fd3e0000), "8.5GB DVD"}, /* 8 543 666 176 */
+};
+
+enum
+{
+ BEGIN_BURN,
+ LAST_SIGNAL,
+};
+
+static guint signals[LAST_SIGNAL];
+
+/*******************************/
+/* XfburnDataComposition class */
+/*******************************/
+GtkType
+xfburn_data_disc_usage_get_type (void)
+{
+ static GtkType disc_usage_type = 0;
+
+ if (!disc_usage_type) {
+ static const GTypeInfo disc_usage_info = {
+ sizeof (XfburnDataDiscUsageClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_data_disc_usage_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnDataDiscUsage),
+ 0,
+ (GInstanceInitFunc) xfburn_data_disc_usage_init
+ };
+
+ disc_usage_type = g_type_register_static (GTK_TYPE_HBOX, "XfburnDataDiscUsage", &disc_usage_info, 0);
+ }
+
+ return disc_usage_type;
+}
+
+static void
+xfburn_data_disc_usage_class_init (XfburnDataDiscUsageClass * klass)
+{
+ GObjectClass *gobject_class;
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ gobject_class = G_OBJECT_CLASS (klass);
+
+ signals[BEGIN_BURN] = g_signal_new ("begin-burn", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnDataDiscUsageClass, begin_burn),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+}
+
+static void
+xfburn_data_disc_usage_init (XfburnDataDiscUsage * disc_usage)
+{
+ int i;
+
+ disc_usage->size = 0;
+
+ disc_usage->progress_bar = gtk_progress_bar_new ();
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (disc_usage->progress_bar), "0 B");
+ gtk_box_pack_start (GTK_BOX (disc_usage), disc_usage->progress_bar, TRUE, TRUE, BORDER);
+ gtk_widget_show (disc_usage->progress_bar);
+
+ disc_usage->combo = gtk_combo_box_new_text ();
+ for (i = 0; i < G_N_ELEMENTS (datadisksizes); i++)
+ gtk_combo_box_append_text (GTK_COMBO_BOX (disc_usage->combo), datadisksizes[i].label);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (disc_usage->combo), DEFAULT_DISK_SIZE_LABEL);
+ gtk_box_pack_start (GTK_BOX (disc_usage), disc_usage->combo, FALSE, FALSE, BORDER);
+ gtk_widget_show (disc_usage->combo);
+
+ disc_usage->button = xfce_create_mixed_button (XFBURN_STOCK_BURN_CD, _("Burn composition"));
+ gtk_box_pack_start (GTK_BOX (disc_usage), disc_usage->button, FALSE, FALSE, BORDER);
+ gtk_widget_set_sensitive (disc_usage->button, FALSE);
+ gtk_widget_show (disc_usage->button);
+ g_signal_connect (G_OBJECT (disc_usage->button), "clicked", G_CALLBACK (cb_button_clicked), disc_usage);
+
+ g_signal_connect (G_OBJECT (disc_usage->combo), "changed", G_CALLBACK (cb_combo_changed), disc_usage);
+ /* Disabling burn composition doesn't work when this is enabled */
+ /*gtk_widget_set_sensitive (disc_usage->button, xfburn_main_window_support_cdr (xfburn_main_window_get_instance ()));*/
+}
+
+/* internals */
+static void
+xfburn_data_disc_usage_update_size (XfburnDataDiscUsage * disc_usage, gboolean manual)
+{
+ gfloat fraction;
+ gchar *size;
+ int i;
+
+ fraction = disc_usage->size / datadisksizes[gtk_combo_box_get_active (GTK_COMBO_BOX (disc_usage->combo))].size;
+ if (fraction > 1.0)
+ fraction = 1.0;
+ if (fraction < 0.0)
+ fraction = 0.0;
+
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (disc_usage->progress_bar), fraction > 1.0 ? 1.0 : fraction);
+
+ if (xfburn_settings_get_boolean ("human-readable-units", TRUE))
+ size = xfburn_humanreadable_filesize ((guint64) disc_usage->size);
+ else
+ size = g_strdup_printf ("%.0lf B", disc_usage->size);
+
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (disc_usage->progress_bar), size);
+
+ if (!manual) {
+ i = 0;
+ while (i < NUM_LABELS && disc_usage->size > datadisksizes[i].size) {
+ i++;
+ }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (disc_usage->combo), (i<NUM_LABELS ? i: i-1));
+ }
+
+ if (disc_usage->size == 0 ||
+ disc_usage->size > datadisksizes[gtk_combo_box_get_active (GTK_COMBO_BOX (disc_usage->combo))].size)
+ gtk_widget_set_sensitive (disc_usage->button, FALSE);
+ else
+ gtk_widget_set_sensitive (disc_usage->button, TRUE);
+
+
+ g_free (size);
+}
+
+static void
+cb_button_clicked (GtkButton *button, XfburnDataDiscUsage *du)
+{
+ if (du->size <= datadisksizes[gtk_combo_box_get_active (GTK_COMBO_BOX (du->combo))].size) {
+ g_signal_emit (G_OBJECT (du), signals[BEGIN_BURN], 0);
+ } else {
+ xfce_err (_("You are trying to burn more data than the disk can contain !"));
+ }
+}
+
+static void
+cb_combo_changed (GtkComboBox * combo, XfburnDataDiscUsage * usage)
+{
+ xfburn_data_disc_usage_update_size (usage, TRUE);
+}
+
+/* public methods */
+gdouble
+xfburn_data_disc_usage_get_size (XfburnDataDiscUsage * disc_usage)
+{
+ return disc_usage->size;
+}
+
+void
+xfburn_data_disc_usage_set_size (XfburnDataDiscUsage * disc_usage, gdouble size)
+{
+ disc_usage->size = size;
+ xfburn_data_disc_usage_update_size (disc_usage, FALSE);
+}
+
+void
+xfburn_data_disc_usage_add_size (XfburnDataDiscUsage * disc_usage, gdouble size)
+{
+ disc_usage->size = disc_usage->size + size;
+ xfburn_data_disc_usage_update_size (disc_usage, FALSE);
+}
+
+void
+xfburn_data_disc_usage_sub_size (XfburnDataDiscUsage * disc_usage, gdouble size)
+{
+ disc_usage->size = disc_usage->size - size;
+ xfburn_data_disc_usage_update_size (disc_usage, FALSE);
+}
+
+XfburnDataDiscType
+xfburn_data_disc_usage_get_disc_type (XfburnDataDiscUsage * disc_usage)
+{
+ if (gtk_combo_box_get_active (GTK_COMBO_BOX (disc_usage->combo)) > LAST_CD_LABEL)
+ return DVD_DISC;
+ else
+ return CD_DISC;
+}
+
+GtkWidget *
+xfburn_data_disc_usage_new (void)
+{
+ return g_object_new (xfburn_data_disc_usage_get_type (), NULL);
+}
+
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h (from rev 5093, xfburn/trunk/xfburn/xfburn-data-disc-usage.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-data-disc-usage.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,74 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_DATA_DISC_USAGE_H__
+#define __XFBURN_DATA_DISC_USAGE_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_DATA_DISC_USAGE (xfburn_data_disc_usage_get_type ())
+#define XFBURN_DATA_DISC_USAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_DATA_DISC_USAGE, XfburnDataDiscUsage))
+#define XFBURN_DATA_DISC_USAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_DATA_DISC_USAGE, XfburnDataDiscUsageClass))
+#define XFBURN_IS_DATA_DISC_USAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_DATA_DISC_USAGE))
+#define XFBURN_IS_DATA_DISC_USAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_DATA_DISC_USAGE))
+#define XFBURN_DATA_DISC_USAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_DATA_DISC_USAGE, XfburnDataDiscUsageClass))
+
+typedef struct
+{
+ GtkVBox hbox;
+
+ GtkWidget *progress_bar;
+ GtkWidget *combo;
+ GtkWidget *button;
+
+ gdouble size;
+} XfburnDataDiscUsage;
+
+typedef struct
+{
+ GtkHBoxClass parent_class;
+
+ void (*begin_burn) (XfburnDataDiscUsage *du);
+} XfburnDataDiscUsageClass;
+
+typedef enum
+{
+ CD_DISC,
+ DVD_DISC,
+} XfburnDataDiscType;
+
+GtkType xfburn_data_disc_usage_get_type (void);
+GtkWidget *xfburn_data_disc_usage_new (void);
+
+gdouble xfburn_data_disc_usage_get_size (XfburnDataDiscUsage *);
+void xfburn_data_disc_usage_set_size (XfburnDataDiscUsage *, gdouble);
+void xfburn_data_disc_usage_add_size (XfburnDataDiscUsage *, gdouble);
+void xfburn_data_disc_usage_sub_size (XfburnDataDiscUsage *, gdouble);
+
+XfburnDataDiscType xfburn_data_disc_usage_get_disc_type (XfburnDataDiscUsage *);
+
+G_END_DECLS
+
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c (from rev 5093, xfburn/trunk/xfburn/xfburn-device-box.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,929 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#ifdef HAVE_THUNAR_VFS
+#include <thunar-vfs/thunar-vfs.h>
+#endif
+
+#include "xfburn-device-list.h"
+#include "xfburn-device-box.h"
+#include "xfburn-hal-manager.h"
+#include "xfburn-settings.h"
+#include "xfburn-utils.h"
+#include "xfburn-blank-dialog.h"
+
+#define XFBURN_DEVICE_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_DEVICE_BOX, XfburnDeviceBoxPrivate))
+
+enum {
+ DEVICE_CHANGED,
+ DISC_REFRESHED,
+ LAST_SIGNAL,
+};
+
+enum {
+ PROP_0,
+ PROP_SHOW_WRITERS_ONLY,
+ PROP_SHOW_SPEED_SELECTION,
+ PROP_SHOW_MODE_SELECTION,
+ PROP_DISC_STATUS,
+ PROP_VALID,
+ PROP_BLANK_MODE,
+};
+
+enum {
+ DEVICE_NAME_COLUMN,
+ DEVICE_POINTER_COLUMN,
+ DEVICE_N_COLUMNS,
+};
+
+enum {
+ SPEED_TEXT_COLUMN,
+ SPEED_VALUE_COLUMN,
+ SPEED_N_COLUMNS,
+};
+
+enum {
+ MODE_TEXT_COLUMN,
+ MODE_VALUE_COLUMN,
+ MODE_N_COLUMNS,
+};
+
+/* private struct */
+typedef struct
+{
+ gboolean show_writers_only;
+ gboolean show_speed_selection;
+ gboolean show_mode_selection;
+ gboolean valid_disc;
+ gboolean blank_mode;
+
+ GtkWidget *combo_device;
+
+ GtkWidget *hbox_refresh;
+ GtkWidget *disc_label;
+
+ GtkWidget *hbox_speed_selection;
+ GtkWidget *combo_speed;
+
+ GtkWidget *status_label;
+ gchar *status_text;
+
+ GtkWidget *hbox_mode_selection;
+ GtkWidget *combo_mode;
+
+ gboolean have_asked_for_blanking;
+#ifdef HAVE_THUNAR_VFS
+ ThunarVfsVolumeManager *thunar_volman;
+#endif
+
+#ifdef HAVE_HAL
+ gulong volume_changed_handlerid;
+#endif
+} XfburnDeviceBoxPrivate;
+
+/* prototypes */
+static void xfburn_device_box_class_init (XfburnDeviceBoxClass *);
+static void xfburn_device_box_init (XfburnDeviceBox *);
+static void xfburn_device_box_finalize (GObject * object);
+static void xfburn_device_box_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void xfburn_device_box_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+
+static guint ask_for_blanking (XfburnDeviceBoxPrivate *priv);
+static void status_label_update (XfburnDeviceBoxPrivate *priv);
+static void update_status_label_visibility ();
+static XfburnDevice * get_selected_device (XfburnDeviceBoxPrivate *priv);
+static void cb_speed_refresh_clicked (GtkButton *button, XfburnDeviceBox *box);
+static gboolean check_disc_validity (XfburnDeviceBoxPrivate *priv);
+static void cb_combo_device_changed (GtkComboBox *combo, XfburnDeviceBox *box);
+#ifdef HAVE_HAL
+static void cb_volumes_changed (XfburnHalManager *halman, XfburnDeviceBox *box);
+#endif
+
+/* globals */
+static GtkVBoxClass *parent_class = NULL;
+
+/*************************/
+/* XfburnDeviceBox class */
+/*************************/
+static guint signals[LAST_SIGNAL];
+
+GtkType
+xfburn_device_box_get_type (void)
+{
+ static GtkType device_box_type = 0;
+
+ if (!device_box_type)
+ {
+ static const GTypeInfo device_box_info = {
+ sizeof (XfburnDeviceBoxClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_device_box_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnDeviceBox),
+ 0,
+ (GInstanceInitFunc) xfburn_device_box_init
+ };
+
+ device_box_type = g_type_register_static (GTK_TYPE_VBOX, "XfburnDeviceBox", &device_box_info, 0);
+ }
+
+ return device_box_type;
+}
+
+static void
+xfburn_device_box_class_init (XfburnDeviceBoxClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnDeviceBoxPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_device_box_finalize;
+ object_class->set_property = xfburn_device_box_set_property;
+ object_class->get_property = xfburn_device_box_get_property;
+
+ signals[DEVICE_CHANGED] = g_signal_new ("device-changed", XFBURN_TYPE_DEVICE_BOX, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnDeviceBoxClass, device_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+ signals[DISC_REFRESHED] = g_signal_new ("disc-refreshed", XFBURN_TYPE_DEVICE_BOX, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnDeviceBoxClass, disc_refreshed),
+ NULL, NULL, g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
+
+ g_object_class_install_property (object_class, PROP_SHOW_WRITERS_ONLY,
+ g_param_spec_boolean ("show-writers-only", _("Show writers only"),
+ _("Show writers only"), FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_SPEED_SELECTION,
+ g_param_spec_boolean ("show-speed-selection", _("Show speed selection"),
+ _("Show speed selection combo"),
+ FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_MODE_SELECTION,
+ g_param_spec_boolean ("show-mode-selection", _("Show mode selection"),
+ _("Show mode selection combo"),
+ FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_DISC_STATUS,
+ g_param_spec_int ("disc-status", _("Disc status"),
+ _("The status of the disc in the drive"),
+ 0, BURN_DISC_UNSUITABLE, 0, G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_VALID,
+ g_param_spec_boolean ("valid", _("Is it a valid combination"),
+ _("Is the combination of hardware and disc valid to burn the composition?"),
+ FALSE, G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_BLANK_MODE,
+ g_param_spec_boolean ("blank-mode", _("Blank mode"),
+ _("The blank mode shows different disc status messages than regular mode"),
+ FALSE, G_PARAM_READWRITE));
+}
+
+static void
+xfburn_device_box_init (XfburnDeviceBox * box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ GtkWidget *label, *img, *button;
+ GList *device = NULL;
+ GtkListStore *store = NULL;
+ GtkCellRenderer *cell;
+ //GtkWidget *hbox;
+ gboolean have_device;
+
+ /* devices */
+ store = gtk_list_store_new (DEVICE_N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
+ priv->combo_device = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (store);
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_device), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->combo_device), cell, "text", DEVICE_NAME_COLUMN, NULL);
+ gtk_widget_show (priv->combo_device);
+ gtk_box_pack_start (GTK_BOX (box), priv->combo_device, FALSE, FALSE, BORDER);
+
+ device = xfburn_device_list_get_list ();
+ have_device = (device != NULL);
+
+ while (device) {
+ XfburnDevice *device_data = (XfburnDevice *) device->data;
+ GtkTreeIter iter;
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter, DEVICE_NAME_COLUMN, device_data->name, DEVICE_POINTER_COLUMN, device_data, -1);
+
+ device = g_list_next (device);
+ }
+ gtk_widget_set_sensitive (priv->combo_device, have_device);
+
+ /*
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox);
+ gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, BORDER);
+ */
+
+ /* disc label */
+ priv->hbox_refresh = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_refresh);
+ gtk_box_pack_start (GTK_BOX (box), priv->hbox_refresh, TRUE, TRUE, BORDER);
+
+ priv->disc_label = gtk_label_new ("");
+ gtk_widget_show (priv->disc_label);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_refresh), priv->disc_label, TRUE, TRUE, BORDER);
+
+ /* refresh */
+ img = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_show (img);
+ button = gtk_button_new ();
+ gtk_container_add (GTK_CONTAINER (button), img);
+ gtk_widget_show (button);
+ //gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_refresh), button, FALSE, FALSE, BORDER);
+ gtk_widget_set_sensitive (button, have_device);
+
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_speed_refresh_clicked), box);
+
+ /* speed */
+ priv->hbox_speed_selection = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_speed_selection);
+ gtk_box_pack_start (GTK_BOX (box), priv->hbox_speed_selection, TRUE, TRUE, BORDER);
+
+ label = gtk_label_new_with_mnemonic (_("_Speed:"));
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), label, FALSE, FALSE, BORDER);
+
+ store = gtk_list_store_new (SPEED_N_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
+ priv->combo_speed = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (store);
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_speed), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->combo_speed), cell, "text", SPEED_TEXT_COLUMN, NULL);
+ gtk_widget_show (priv->combo_speed);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), priv->combo_speed, TRUE, TRUE, BORDER);
+
+ /* mode */
+ priv->hbox_mode_selection = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_mode_selection);
+ gtk_box_pack_start (GTK_BOX (box), priv->hbox_mode_selection, FALSE, FALSE, BORDER);
+
+ label = gtk_label_new_with_mnemonic (_("Write _mode:"));
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_mode_selection), label, FALSE, FALSE, BORDER);
+
+ store = gtk_list_store_new (MODE_N_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
+ priv->combo_mode = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (store);
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_mode), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->combo_mode), cell, "text", MODE_TEXT_COLUMN, NULL);
+ gtk_widget_show (priv->combo_mode);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_mode_selection), priv->combo_mode, TRUE, TRUE, BORDER);
+ gtk_widget_set_sensitive (priv->combo_mode, have_device);
+
+ /* status label */
+ priv->status_label = gtk_label_new ("");
+ priv->status_text = "";
+ gtk_widget_show (priv->status_label);
+ gtk_box_pack_start (GTK_BOX (box), priv->status_label, FALSE, FALSE, 0);
+
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo_device), 0);
+ g_signal_connect (G_OBJECT (priv->combo_device), "changed", G_CALLBACK (cb_combo_device_changed), box);
+
+#ifdef HAVE_HAL
+ priv->volume_changed_handlerid = g_signal_connect (G_OBJECT (xfburn_hal_manager_get_instance ()), "volume-changed", G_CALLBACK (cb_volumes_changed), box);
+#endif
+#ifdef HAVE_THUNAR_VFS
+ priv->thunar_volman = thunar_vfs_volume_manager_get_default ();
+ if (priv->thunar_volman != NULL) {
+ /*
+ g_signal_connect (G_OBJECT (priv->thunar_volman), "volumes-added", G_CALLBACK (cb_volumes_changed), box);
+ g_signal_connect (G_OBJECT (priv->thunar_volman), "volumes-removed", G_CALLBACK (cb_volumes_changed), box);
+ */
+ } else {
+ g_warning ("Error trying to access the thunar-vfs-volume-manager!");
+ }
+#endif
+
+ priv->have_asked_for_blanking = FALSE;
+}
+
+static void
+xfburn_device_box_finalize (GObject * object)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (object);
+
+#ifdef HAVE_THUNAR_VFS
+ g_object_unref (priv->thunar_volman);
+#endif
+#ifdef HAVE_HAL
+ //g_object_unref (priv->hal_manager);
+ g_signal_handler_disconnect (xfburn_hal_manager_get_instance (), priv->volume_changed_handlerid);
+#endif
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+xfburn_device_box_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_SHOW_WRITERS_ONLY:
+ g_value_set_boolean (value, priv->show_writers_only);
+ break;
+ case PROP_SHOW_SPEED_SELECTION:
+ g_value_set_boolean (value, priv->show_speed_selection);
+ break;
+ case PROP_SHOW_MODE_SELECTION:
+ g_value_set_boolean (value, priv->show_mode_selection);
+ break;
+ case PROP_DISC_STATUS:
+ g_value_set_int (value, xfburn_device_list_get_disc_status());
+ break;
+ case PROP_VALID:
+ g_value_set_boolean (value, priv->valid_disc);
+ break;
+ case PROP_BLANK_MODE:
+ g_value_set_boolean (value, priv->blank_mode);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_device_box_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_SHOW_WRITERS_ONLY:
+ priv->show_writers_only = g_value_get_boolean (value);
+ break;
+ case PROP_SHOW_SPEED_SELECTION:
+ priv->show_speed_selection = g_value_get_boolean (value);
+ if (priv->show_speed_selection)
+ gtk_widget_show (priv->hbox_speed_selection);
+ else
+ gtk_widget_hide (priv->hbox_speed_selection);
+ update_status_label_visibility (priv);
+ break;
+ case PROP_SHOW_MODE_SELECTION:
+ priv->show_mode_selection = g_value_get_boolean (value);
+ if (priv->show_mode_selection)
+ gtk_widget_show (priv->hbox_mode_selection);
+ else
+ gtk_widget_hide (priv->hbox_mode_selection);
+ update_status_label_visibility (priv);
+ break;
+ case PROP_BLANK_MODE:
+ priv->blank_mode = g_value_get_boolean (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/*************/
+/* internals */
+/*************/
+
+static void
+update_status_label_visibility (XfburnDeviceBoxPrivate *priv)
+{
+ /*
+ if (priv->show_mode_selection || priv->show_speed_selection)
+ gtk_widget_show (priv->status_label);
+ else
+ gtk_widget_hide (priv->status_label);
+ */
+
+}
+
+static void
+empty_speed_list_dialog ()
+{
+ GtkDialog *dialog;
+ GtkWidget *label;
+ GtkWidget *check_show_notice;
+
+ if (!xfburn_settings_get_boolean ("show-empty-speed-list-notice", TRUE))
+ return;
+
+ dialog = (GtkDialog *) gtk_dialog_new_with_buttons (_("Empty speed list"),
+ NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_CLOSE,
+ NULL);
+
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), _("<b>Unable to retrieve the speed list for the drive.</b>\n\nThis is a known bug, which occurs with some drives. Please report it to <i>xfburn at xfce.org</i> together with the console output to increase the chances that it will get fixed.\n\nBurning should still work, but if there are problems anyways, please let us know.\n\n<i>Thank you!</i>")
+ );
+ gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+ gtk_label_set_width_chars (GTK_LABEL (label), 30);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (dialog->vbox), label, TRUE, TRUE, BORDER);
+ gtk_widget_show (label);
+
+
+ check_show_notice = gtk_check_button_new_with_mnemonic (_("Continue to _show this notice"));
+ gtk_box_pack_end (GTK_BOX (dialog->vbox), check_show_notice, TRUE, TRUE, BORDER);
+ gtk_widget_show (check_show_notice);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_show_notice), TRUE);
+
+
+ switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
+ case GTK_RESPONSE_CLOSE:
+ xfburn_settings_set_boolean ("show-empty-speed-list-notice",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_show_notice)));
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+fill_combo_speed (XfburnDeviceBox *box, XfburnDevice *device)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+ GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_speed));
+ GSList *el = device->supported_cdr_speeds;
+ int profile_no = xfburn_device_list_get_profile_no ();
+ int factor;
+ GtkTreeIter iter_max;
+
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ if (!check_disc_validity (priv))
+ return;
+
+ if (!priv->show_speed_selection)
+ return;
+
+ if (el == NULL) {
+ /* a valid disc is in the drive, but no speed list is present */
+ GtkTreeIter iter;
+ gchar *str;
+
+ empty_speed_list_dialog ();
+
+ str = _("default");
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, SPEED_TEXT_COLUMN, str, SPEED_VALUE_COLUMN, -1, -1);
+ }
+
+ /* check profile, so we can convert from 'kb/s' into 'x' rating */
+ if (profile_no != 0) {
+ /* this will fail if newer disk types get supported */
+ if (profile_no <= 0x0a)
+ factor = CDR_1X_SPEED;
+ else
+ /* assume DVD for now */
+ factor = DVD_1X_SPEED;
+ } else {
+ factor = 1;
+ }
+
+ while (el) {
+ gint write_speed = GPOINTER_TO_INT (el->data);
+ GtkTreeIter iter;
+ gchar *str = NULL;
+ gint speed;
+
+ speed = write_speed / factor;
+ str = g_strdup_printf ("%d", speed);
+ //DBG ("added speed: %d kb/s => %d x", el->write_speed, speed);
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, SPEED_TEXT_COLUMN, str, SPEED_VALUE_COLUMN, write_speed, -1);
+ g_free (str);
+
+ el = g_slist_next (el);
+ }
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter_max);
+
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter_max, SPEED_TEXT_COLUMN, _("Max"), SPEED_VALUE_COLUMN, 0, -1);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo_speed), gtk_tree_model_iter_n_children (model, NULL) - 1);
+}
+
+static void
+status_label_update (XfburnDeviceBoxPrivate *priv)
+{
+ gchar * text;
+ gboolean sensitive;
+
+ sensitive = GTK_WIDGET_SENSITIVE (priv->combo_device);
+
+ //DBG ("sensitive = %d", sensitive);
+
+ if (sensitive)
+ text = g_strdup_printf ("<span weight=\"bold\" foreground=\"darkred\" stretch=\"semiexpanded\">%s</span>", priv->status_text);
+ else
+ text = g_strdup_printf ("<span weight=\"bold\" foreground=\"gray\" stretch=\"semiexpanded\">%s</span>", priv->status_text);
+
+ gtk_label_set_markup (GTK_LABEL(priv->status_label), text);
+ g_free (text);
+}
+
+static guint
+ask_for_blanking (XfburnDeviceBoxPrivate *priv)
+{
+ gboolean do_blank;
+
+ if (priv->have_asked_for_blanking)
+ return FALSE;
+
+ gdk_threads_enter ();
+ priv->have_asked_for_blanking = TRUE;
+ do_blank = xfburn_ask_yes_no (GTK_MESSAGE_QUESTION, "A full, but erasable disc is in the drive",
+ "Do you want to blank the disc, so that it can be used for the upcoming burn process?");
+
+ if (do_blank) {
+ GtkDialog *blank_dialog = GTK_DIALOG (xfburn_blank_dialog_new_eject (FALSE));
+ gtk_dialog_run (blank_dialog);
+ gtk_widget_destroy (GTK_WIDGET (blank_dialog));
+ }
+ gdk_threads_leave ();
+ DBG ("done asking to blank");
+ return FALSE;
+}
+
+static gboolean
+check_disc_validity (XfburnDeviceBoxPrivate *priv)
+{
+ enum burn_disc_status disc_status = xfburn_device_list_get_disc_status ();
+ int profile_no = xfburn_device_list_get_profile_no ();
+ gboolean is_erasable = xfburn_device_list_disc_is_erasable ();
+ XfburnDevice *device = get_selected_device (priv);
+
+ gtk_label_set_text (GTK_LABEL (priv->disc_label), xfburn_device_list_get_profile_name ());
+
+ if (!priv->blank_mode) {
+ /* for burning */
+ switch (profile_no) {
+ case XFBURN_PROFILE_NONE:
+ /* empty drive is caught later,
+ * not sure if there would be another reason for 0x0 */
+ priv->valid_disc = TRUE;
+ break;
+ case XFBURN_PROFILE_CDR:
+ priv->valid_disc = device->cdr;
+ break;
+ case XFBURN_PROFILE_CDRW:
+ priv->valid_disc = device->cdrw;
+ break;
+ case XFBURN_PROFILE_DVDRAM:
+ priv->valid_disc = device->dvdram;
+ break;
+ case XFBURN_PROFILE_DVD_MINUS_R:
+ case XFBURN_PROFILE_DVD_MINUS_RW_OVERWRITE:
+ case XFBURN_PROFILE_DVD_MINUS_RW_SEQUENTIAL:
+ case XFBURN_PROFILE_DVD_MINUS_R_DL:
+ case XFBURN_PROFILE_DVD_PLUS_R:
+ case XFBURN_PROFILE_DVD_PLUS_R_DL:
+ case XFBURN_PROFILE_DVD_PLUS_RW:
+ priv->valid_disc = device->dvdr;
+ break;
+ default:
+ g_warning ("Unknown disc profile 0x%x!", profile_no);
+ priv->valid_disc = TRUE;
+ break;
+ }
+
+ if (!priv->valid_disc) {
+ priv->status_text = _("Drive can't burn on the inserted disc!");
+ } else {
+ priv->valid_disc = (disc_status == BURN_DISC_BLANK) || (disc_status == BURN_DISC_APPENDABLE);
+
+ if (!priv->valid_disc) {
+ switch (disc_status) {
+ case BURN_DISC_EMPTY:
+ priv->status_text = _("Drive is empty!");
+ break;
+ case BURN_DISC_FULL:
+ priv->status_text = _("Inserted disc is full!");
+ break;
+ case BURN_DISC_UNSUITABLE:
+ priv->status_text = _("Inserted disc is unsuitable!");
+ break;
+ case BURN_DISC_UNGRABBED:
+ priv->status_text = _("No access to drive (mounted?)");
+ break;
+ default:
+ /* if there is no detected device, then don't print an error message as it is expected to not have a disc status */
+ if (device != NULL) {
+ priv->status_text = _("Error determining disc!");
+ DBG ("weird disc_status = %d", disc_status);
+ }
+ }
+ }
+ }
+
+ if (!priv->valid_disc && disc_status == BURN_DISC_FULL && is_erasable) {
+ g_idle_add ((GSourceFunc) ask_for_blanking, priv);
+ }
+ } else {
+ /* for blanking */
+ priv->valid_disc = is_erasable && (disc_status != BURN_DISC_BLANK);
+
+ if (!priv->valid_disc) {
+ switch (profile_no) {
+ case XFBURN_PROFILE_CDR:
+ case XFBURN_PROFILE_DVD_MINUS_R:
+ case XFBURN_PROFILE_DVD_MINUS_R_DL:
+ case XFBURN_PROFILE_DVD_PLUS_R:
+ case XFBURN_PROFILE_DVD_PLUS_R_DL:
+ priv->status_text = _("Write-once disc, no blanking possible");
+ break;
+ case XFBURN_PROFILE_DVD_PLUS_RW:
+ priv->status_text = _("DVD+RW does not need blanking");
+ break;
+ default:
+ switch (disc_status) {
+ case BURN_DISC_EMPTY:
+ priv->status_text = _("Drive is empty!");
+ break;
+ case BURN_DISC_BLANK:
+ priv->status_text = _("Inserted disc is already blank!");
+ break;
+ case BURN_DISC_UNSUITABLE:
+ priv->status_text = _("Inserted disc is unsuitable!");
+ break;
+ case BURN_DISC_UNGRABBED:
+ priv->status_text = _("No access to drive (mounted?)");
+ break;
+ default:
+ priv->status_text = _("Error determining disc!");
+ DBG ("weird disc_status = %d", disc_status);
+ }
+ }
+ }
+ }
+
+ gtk_widget_set_sensitive (priv->combo_speed, priv->valid_disc);
+
+ if (priv->valid_disc)
+ priv->status_text = _("");
+
+ status_label_update (priv);
+ return priv->valid_disc;
+}
+
+static void
+fill_combo_mode (XfburnDeviceBox *box, XfburnDevice *device)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+ GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_mode));
+ GtkTreeIter iter;
+
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ if (device->tao_block_types) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "TAO", MODE_VALUE_COLUMN, WRITE_MODE_TAO, -1);
+ }
+ if (device->sao_block_types & BURN_BLOCK_SAO) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "SAO", MODE_VALUE_COLUMN, WRITE_MODE_SAO, -1);
+ }
+ /*
+ * RAW modes are not supported by libburn yet
+ *
+ if (device->raw_block_types & BURN_BLOCK_RAW16) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "RAW16", MODE_VALUE_COLUMN, WRITE_MODE_RAW16, -1);
+ }
+ if (device->raw_block_types & BURN_BLOCK_RAW96P) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "RAW96P", MODE_VALUE_COLUMN, WRITE_MODE_RAW96P, -1);
+ }
+ if (device->raw_block_types & BURN_BLOCK_RAW96R) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "RAW96R", MODE_VALUE_COLUMN, WRITE_MODE_RAW96R, -1);
+ }
+ if (device->packet_block_types) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, MODE_TEXT_COLUMN, "packet", MODE_VALUE_COLUMN, WRITE_MODE_PACKET, -1);
+ }
+ */
+
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo_mode), 0);
+}
+
+static XfburnDevice *
+get_selected_device (XfburnDeviceBoxPrivate *priv)
+{
+
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ XfburnDevice * device = NULL;
+ gboolean ret;
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_device));
+ ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->combo_device), &iter);
+ if (ret)
+ gtk_tree_model_get (model, &iter, DEVICE_POINTER_COLUMN, &device, -1);
+
+ return device;
+}
+
+static void
+cb_speed_refresh_clicked (GtkButton *button, XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+ XfburnDevice *device = NULL;
+
+ xfburn_busy_cursor (priv->combo_device);
+
+ device = xfburn_device_box_get_selected_device (box);
+ if (xfburn_device_refresh_supported_speeds (device))
+ fill_combo_speed (box, device);
+
+ xfburn_default_cursor (priv->combo_device);
+
+ g_signal_emit (G_OBJECT (box), signals[DISC_REFRESHED], 0, device);
+}
+
+static void
+cb_combo_device_changed (GtkComboBox *combo, XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+ XfburnDevice *device;
+
+ if (GTK_WIDGET_REALIZED (box))
+ xfburn_busy_cursor (GTK_WIDGET (box));
+
+ device = xfburn_device_box_get_selected_device (box);
+ if (device != NULL) {
+ //DBG ("Device changed to %s", device->name);
+ xfburn_device_refresh_supported_speeds (device);
+
+ fill_combo_speed (box, device);
+
+ if (priv->show_mode_selection)
+ fill_combo_mode (box,device);
+ }
+
+ if (GTK_WIDGET_REALIZED (box))
+ xfburn_default_cursor (GTK_WIDGET (box));
+
+ g_signal_emit (G_OBJECT (box), signals[DEVICE_CHANGED], 0, device);
+}
+
+#ifdef HAVE_HAL
+static void
+cb_volumes_changed (XfburnHalManager *halman, XfburnDeviceBox *box)
+{
+ gboolean visible;
+
+ visible = GTK_WIDGET_VISIBLE (GTK_WIDGET(box));
+ //DBG ("device box visibility: %d", visible);
+ if (visible) {
+ usleep (1000001);
+ cb_speed_refresh_clicked (NULL, box);
+ }
+}
+#endif
+
+#ifdef HAVE_THUNAR_VFS
+//(ThunarVfsVolumeManager *volman, gpointer volumes, XfburnDeviceBox *box)
+#endif
+
+static void
+refresh (GtkWidget *widget)
+{
+ XfburnDeviceBox *box = XFBURN_DEVICE_BOX (widget);
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ cb_combo_device_changed (GTK_COMBO_BOX (priv->combo_device), box);
+}
+
+/******************/
+/* public methods */
+/******************/
+GtkWidget *
+xfburn_device_box_new (XfburnDeviceBoxFlags flags)
+{
+ GtkWidget *obj;
+
+ obj = g_object_new (xfburn_device_box_get_type (),
+ "show-writers-only", ((flags & SHOW_CD_WRITERS) != 0),
+ "show-speed-selection", ((flags & SHOW_SPEED_SELECTION) != 0),
+ "show-mode-selection", ((flags & SHOW_MODE_SELECTION) != 0),
+ "blank-mode", ((flags & BLANK_MODE) != 0),
+ NULL);
+
+ refresh (obj);
+
+ return obj;
+}
+
+gchar *
+xfburn_device_box_get_selected (XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *name = NULL;
+ gboolean ret;
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_device));
+ ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->combo_device), &iter);
+ if (ret)
+ gtk_tree_model_get (model, &iter, DEVICE_NAME_COLUMN, &name, -1);
+
+ return name;
+}
+
+XfburnDevice *
+xfburn_device_box_get_selected_device (XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ return get_selected_device (priv);
+}
+
+gint
+xfburn_device_box_get_speed (XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint speed = -1;
+ gboolean ret;
+
+ g_return_val_if_fail (priv->show_speed_selection, -1);
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_speed));
+ ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->combo_speed), &iter);
+ if (ret)
+ gtk_tree_model_get (model, &iter, SPEED_VALUE_COLUMN, &speed, -1);
+
+ return speed;
+}
+
+void xfburn_device_box_set_sensitive (XfburnDeviceBox *box, gboolean sensitivity)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ /* why do we need to explicitly set this? It gets grayed out even
+ * without this call! */
+ gtk_widget_set_sensitive (priv->combo_device, sensitivity);
+ //DBG ("sensitive = %d", GTK_WIDGET_SENSITIVE (GTK_WIDGET (box)));
+ status_label_update (priv);
+}
+
+XfburnWriteMode
+xfburn_device_box_get_mode (XfburnDeviceBox *box)
+{
+ XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
+
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint mode = -1;
+ gboolean ret;
+
+ g_return_val_if_fail (priv->show_mode_selection, -1);
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_mode));
+ ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->combo_mode), &iter);
+ if (ret)
+ gtk_tree_model_get (model, &iter, SPEED_VALUE_COLUMN, &mode, -1);
+
+ return mode;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h (from rev 5093, xfburn/trunk/xfburn/xfburn-device-box.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-box.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,89 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_DEVICE_BOX_H__
+#define __XFBURN_DEVICE_BOX_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "xfburn-global.h"
+#include "xfburn-device-list.h"
+
+G_BEGIN_DECLS
+#define XFBURN_TYPE_DEVICE_BOX (xfburn_device_box_get_type ())
+#define XFBURN_DEVICE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_DEVICE_BOX, XfburnDeviceBox))
+#define XFBURN_DEVICE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_DEVICE_BOX, XfburnDeviceBoxClass))
+#define XFBURN_IS_DEVICE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_DEVICE_BOX))
+#define XFBURN_IS_DEVICE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_DEVICE_BOX))
+#define XFBURN_DEVICE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_DEVICE_BOX, XfburnDeviceBoxClass))
+
+typedef struct
+{
+ GtkVBox window;
+} XfburnDeviceBox;
+
+typedef struct
+{
+ GtkVBoxClass parent_class;
+
+ void (*device_changed) (XfburnDeviceBox *box, XfburnDevice *device);
+ void (*disc_refreshed) (XfburnDeviceBox *box, XfburnDevice *device);
+} XfburnDeviceBoxClass;
+
+typedef enum
+{
+ SHOW_CD_WRITERS = 1 << 0,
+ SHOW_CDRW_WRITERS = 1 << 1,
+ SHOW_DVD_WRITERS = 1 << 2,
+
+ SHOW_CD_READERS = 1 << 4,
+ SHOW_DVD_READERS = 1 << 5,
+
+ SHOW_SPEED_SELECTION = 1 << 7,
+ SHOW_MODE_SELECTION = 1 << 8,
+ BLANK_MODE = 1 << 9,
+} XfburnDeviceBoxFlags;
+
+typedef enum
+{
+ WRITE_MODE_TAO,
+ WRITE_MODE_SAO,
+ WRITE_MODE_RAW16,
+ WRITE_MODE_RAW96P,
+ WRITE_MODE_RAW96R,
+ WRITE_MODE_PACKET,
+} XfburnWriteMode;
+
+GtkType xfburn_device_box_get_type (void);
+
+GtkWidget *xfburn_device_box_new (XfburnDeviceBoxFlags);
+
+gchar *xfburn_device_box_get_selected (XfburnDeviceBox *box);
+XfburnDevice *xfburn_device_box_get_selected_device (XfburnDeviceBox *box);
+
+gint xfburn_device_box_get_speed (XfburnDeviceBox *box);
+XfburnWriteMode xfburn_device_box_get_mode (XfburnDeviceBox *box);
+void xfburn_device_box_set_sensitive (XfburnDeviceBox *box, gboolean sensitivity);
+
+G_END_DECLS
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c (from rev 5093, xfburn/trunk/xfburn/xfburn-device-list.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,394 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <glib.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <libburn.h>
+
+#include "xfburn-device-list.h"
+#include "xfburn-global.h"
+
+static GList *devices = NULL;
+static enum burn_disc_status disc_status;
+static int profile_no = 0;
+static char profile_name[80];
+static int is_erasable = 0;
+
+#define CAN_BURN_CONDITION device->cdr || device->cdrw || device->dvdr || device->dvdram
+#define DEVICE_INFO_PRINTF "%s can burn: %d [cdr: %d, cdrw: %d, dvdr: %d, dvdram: %d]", device->name, CAN_BURN_CONDITION, device->cdr, device->cdrw, device->dvdr, device->dvdram
+
+/*************/
+/* internals */
+/*************/
+static void
+device_content_free (XfburnDevice * device, gpointer user_data)
+{
+ g_free (device->name);
+ g_free (device->node_path);
+
+ g_slist_free (device->supported_cdr_speeds);
+}
+
+static gboolean
+no_speed_duplicate (GSList *speed_list, gint speed)
+{
+ GSList *el = speed_list;
+
+ while (el) {
+ gint el_speed = GPOINTER_TO_INT (el->data);
+
+ if (el_speed == speed)
+ return FALSE;
+
+ el = g_slist_next (el);
+ }
+
+ return TRUE;
+}
+
+/* sort the speed list in ascending order */
+static gint
+cmp_ints (gconstpointer a, gconstpointer b)
+{
+ return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
+}
+
+/* FIXME: rename function, as it is doing more than refresh speed */
+static void
+refresh_supported_speeds (XfburnDevice * device, struct burn_drive_info *drive_info)
+{
+ struct burn_speed_descriptor *speed_list = NULL;
+ gint ret;
+ /*
+ int status, num_formats;
+ off_t size;
+ unsigned bl_sas;
+ int i;
+ */
+
+ /* empty previous list */
+ g_slist_free (device->supported_cdr_speeds);
+ device->supported_cdr_speeds = NULL;
+
+ /* check if there is a disc in the drive */
+ while ((disc_status = burn_disc_get_status (drive_info->drive)) == BURN_DISC_UNREADY)
+ usleep(100001);
+
+ /* libburn docs say we might need to check more than once,
+ * but that's probably covered by the loop above */
+ /*
+ for (i=0; i<2; i++) {
+ usleep(100001);
+ disc_status = burn_disc_get_status (drive_info->drive);
+ }
+ */
+ DBG ("disc_status = %d", disc_status);
+
+ if ((ret = burn_disc_get_profile(drive_info->drive, &profile_no, profile_name)) != 1) {
+ g_warning ("no profile could be retrieved");
+ }
+ is_erasable = burn_disc_erasable (drive_info->drive);
+ DBG ("profile_no = 0x%x (%s), %s erasable", profile_no, profile_name, (is_erasable ? "" : "NOT"));
+
+ if (ret == 1 && profile_no == 0 && is_erasable && disc_status == 6) {
+ DBG ("work around bug in my drive or libburn: disc is a full DVD-RW sequential");
+ profile_no = XFBURN_PROFILE_DVD_MINUS_RW_SEQUENTIAL;
+ disc_status = BURN_DISC_FULL;
+ strcpy (profile_name, "(?) DVD-RW sequiential");
+ }
+
+ /*
+ ret = burn_disc_get_formats (drive_info->drive, &status, &size, &bl_sas, &num_formats);
+ DBG ("_get_formats (%d) = %d, %llu, %d, %d", ret, status, size, bl_sas, num_formats);
+ for (i=0; i<num_formats; i++) {
+ int type;
+ ret = burn_disc_get_format_descr (drive_info->drive, i, &type, &size, &bl_sas);
+ DBG ("_get_format_descr (%d) = 0x%x, %llu, %u", ret, type, size, bl_sas);
+ }
+ */
+
+
+ if (!(disc_status == BURN_DISC_BLANK || disc_status == BURN_DISC_APPENDABLE)) {
+ DBG ("no writable / appendable disc found in drive, speed list not updated");
+ return;
+ }
+
+ /* fill new list */
+ ret = burn_drive_get_speedlist (drive_info->drive, &speed_list);
+ /* speed_list = NULL; DEBUG */
+
+ if (ret > 0 && speed_list != NULL) {
+ struct burn_speed_descriptor *el = speed_list;
+
+ while (el) {
+ gint speed = el->write_speed;
+
+ /* FIXME: why do we need no_speed_duplicate? */
+ if (speed > 0 && no_speed_duplicate (device->supported_cdr_speeds, speed)) {
+ device->supported_cdr_speeds = g_slist_prepend (device->supported_cdr_speeds, GINT_TO_POINTER (speed));
+ }
+
+ el = el->next;
+ }
+
+ burn_drive_free_speedlist (&speed_list);
+ device->supported_cdr_speeds = g_slist_sort (device->supported_cdr_speeds, &cmp_ints);
+ } else if (ret == 0 || speed_list == NULL) {
+ g_warning ("reported speed list is empty for device:");
+ g_warning (DEVICE_INFO_PRINTF);
+ } else {
+ g_error ("severe error while retrieving speed list");
+ }
+}
+
+/**************/
+/* public API */
+/**************/
+GList *
+xfburn_device_list_get_list ()
+{
+ return devices;
+}
+
+enum burn_disc_status
+xfburn_device_list_get_disc_status ()
+{
+ return disc_status;
+}
+
+int
+xfburn_device_list_get_profile_no ()
+{
+ return profile_no;
+}
+
+const char *
+xfburn_device_list_get_profile_name ()
+{
+ return profile_name;
+}
+
+gboolean
+xfburn_device_list_disc_is_erasable ()
+{
+ return is_erasable != 0;
+}
+
+gboolean
+xfburn_device_refresh_supported_speeds (XfburnDevice * device)
+{
+ struct burn_drive_info *drive_info = NULL;
+ gboolean ret;
+
+ if (G_UNLIKELY (device == NULL)) {
+ DBG ("Hmm, why can we refresh when there is no drive?");
+ return FALSE;
+ }
+
+ /* reset other internal structures */
+ profile_no = 0;
+ *profile_name = 0;
+ is_erasable = 0;
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ return FALSE;
+ }
+
+ if (!xfburn_device_grab (device, &drive_info)) {
+ ret = FALSE;
+ g_warning ("Couldn't grab drive in order to update speed list.");
+ disc_status = BURN_DISC_UNGRABBED;
+ } else {
+ ret = TRUE;
+ refresh_supported_speeds (device, drive_info);
+
+ burn_drive_release (drive_info->drive, 0);
+ }
+
+ burn_finish ();
+
+ return ret;
+}
+
+gint
+xfburn_device_list_init ()
+{
+ struct burn_drive_info *drives;
+ gint i, ret;
+ gboolean can_burn;
+ guint n_drives = 0;
+ guint n_burners = 0;
+
+ *profile_name = '\0';
+
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ return -1;
+ }
+
+ if (devices) {
+ g_list_foreach (devices, (GFunc) device_content_free, NULL);
+ g_list_free (devices);
+ devices = NULL;
+ }
+
+ while ((ret = burn_drive_scan (&drives, &n_drives)) == 0)
+ usleep (1002);
+
+ if (ret < 0)
+ g_warning ("An error occurred while scanning for available drives!");
+
+ if (n_drives < 1)
+ g_warning ("No drives were found!");
+
+ for (i = 0; i < n_drives; i++) {
+ XfburnDevice *device = g_new0 (XfburnDevice, 1);
+ gint ret = 0;
+
+ device->name = g_strconcat (drives[i].vendor, " ", drives[i].product, NULL);
+ device->node_path = g_strdup (drives[i].location);
+
+ device->cdr = drives[i].write_cdr;
+ device->cdrw = drives[i].write_cdrw;
+
+ device->dvdr = drives[i].write_dvdr;
+ device->dvdram = drives[i].write_dvdram;
+
+ device->buffer_size = drives[i].buffer_size;
+ device->dummy_write = drives[i].write_simulate;
+
+ /* write modes */
+ device->tao_block_types = drives[i].tao_block_types;
+ device->sao_block_types = drives[i].sao_block_types;
+ device->raw_block_types = drives[i].raw_block_types;
+ device->packet_block_types = drives[i].packet_block_types;
+
+ can_burn = CAN_BURN_CONDITION;
+
+ DBG (DEVICE_INFO_PRINTF);
+
+ ret = burn_drive_get_adr (&(drives[i]), device->addr);
+ if (ret <= 0)
+ g_error ("Unable to get drive %s address (ret=%d). Please report this problem to libburn-hackers at pykix.org", device->name, ret);
+
+ /*
+ * refresh_supported_speeds now gets called when the device box gets initialized
+ if (burn_drive_grab (drives[i].drive, 1) == 1) {
+ refresh_supported_speeds (device, &(drives[i]));
+ burn_drive_release (drives[i].drive, 0);
+ } else
+ g_warning ("Failed to grab drive %s, did not refresh speed list", device->name);
+ */
+
+ if (can_burn) {
+ devices = g_list_append (devices, device);
+ n_burners++;
+ }
+ }
+
+ burn_drive_info_free (drives);
+ burn_finish ();
+
+ if (n_drives > 0 && n_burners < 1)
+ g_warning ("There are %d drives in your system, but none are capable of burning!", n_drives);
+
+ return n_burners;
+}
+
+gboolean
+xfburn_device_grab (XfburnDevice * device, struct burn_drive_info **drive_info)
+{
+ int ret = 0;
+ gchar drive_addr[BURN_DRIVE_ADR_LEN];
+ int i;
+ const int max_checks = 4;
+
+ ret = burn_drive_convert_fs_adr (device->addr, drive_addr);
+ if (ret <= 0) {
+ g_error ("Device address does not lead to a CD burner '%s' (ret=%d).", device->addr, ret);
+ return FALSE;
+ }
+
+ /* we need to try to grab several times, because
+ * the drive might be busy detecting the media */
+ for (i=0; i<max_checks; i++) {
+ ret = burn_drive_scan_and_grab (drive_info, drive_addr, 0);
+ if (ret > 0)
+ break;
+ else if (i < (max_checks-1))
+ usleep((i+1)*100001);
+ }
+
+ if (ret <= 0) {
+ g_warning ("Unable to grab drive at path '%s' (ret=%d).", device->addr, ret);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void
+xfburn_device_free (XfburnDevice * device)
+{
+ device_content_free (device, NULL);
+ g_free (device);
+}
+
+
+XfburnDevice *
+xfburn_device_lookup_by_name (const gchar * name)
+{
+ GList *device;
+
+ device = devices;
+
+ while (device) {
+ XfburnDevice *device_data = (XfburnDevice *) device->data;
+
+ if (g_ascii_strcasecmp (device_data->name, name) == 0)
+ return device_data;
+
+ device = g_list_next (device);
+ }
+
+ return NULL;
+}
+
+void
+xfburn_device_list_free ()
+{
+ g_list_foreach (devices, (GFunc) xfburn_device_free, NULL);
+ g_list_free (devices);
+
+ devices = NULL;
+}
+
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h (from rev 5093, xfburn/trunk/xfburn/xfburn-device-list.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-device-list.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,92 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_DEVICE_LIST_H__
+#define __XFBURN_DEVICE_LIST_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <libburn.h>
+
+/* what kind of recordable discs are there */
+/* usused so far */
+enum XfburnDiscTypes {
+ /* record-once types */
+ XFBURN_CDR,
+ XFBURN_DVD_R, /* we don't need a distinction for record once between + / - */
+ XFBURN_REWRITABLE, /* marker, everything after this is rewritable */
+ XFBURN_CDRW,
+ XFBURN_DVD_RAM,
+ XFBURN_DVD_MINUS_RW,
+ XFBURN_DVD_PLUS_RW,
+};
+
+enum XfburnDiscProfiles {
+ XFBURN_PROFILE_NONE = 0x0,
+ XFBURN_PROFILE_CDR = 0x09,
+ XFBURN_PROFILE_CDRW = 0x0a,
+ XFBURN_PROFILE_DVD_MINUS_R = 0x11,
+ XFBURN_PROFILE_DVDRAM = 0x12,
+ XFBURN_PROFILE_DVD_MINUS_RW_OVERWRITE = 0x13,
+ XFBURN_PROFILE_DVD_MINUS_RW_SEQUENTIAL = 0x14,
+ XFBURN_PROFILE_DVD_MINUS_R_DL = 0x15,
+ XFBURN_PROFILE_DVD_PLUS_RW = 0x1a,
+ XFBURN_PROFILE_DVD_PLUS_R = 0x1b,
+ XFBURN_PROFILE_DVD_PLUS_R_DL = 0x2b,
+ XFBURN_PROFILE_BD_RE = 0x43,
+};
+
+typedef struct
+{
+ gchar *name;
+ gchar *node_path;
+ gint buffer_size;
+ gboolean dummy_write;
+
+ gboolean cdr;
+ gboolean cdrw;
+ GSList *supported_cdr_speeds;
+
+ gint tao_block_types;
+ gint sao_block_types;
+ gint raw_block_types;
+ gint packet_block_types;
+
+ gboolean dvdr;
+ gboolean dvdram;
+
+ gchar addr[BURN_DRIVE_ADR_LEN];
+} XfburnDevice;
+
+gint xfburn_device_list_init ();
+XfburnDevice * xfburn_device_lookup_by_name (const gchar * name);
+GList * xfburn_device_list_get_list ();
+enum burn_disc_status xfburn_device_list_get_disc_status ();
+int xfburn_device_list_get_profile_no ();
+const char * xfburn_device_list_get_profile_name ();
+gboolean xfburn_device_list_disc_is_erasable ();
+void xfburn_device_list_free ();
+
+gboolean xfburn_device_refresh_supported_speeds (XfburnDevice * device);
+gboolean xfburn_device_grab (XfburnDevice * device, struct burn_drive_info **drive_info);
+void xfburn_device_free (XfburnDevice * device);
+
+#endif /* __XFBURN_DEVICE_LIST_H__ */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c (from rev 5093, xfburn/trunk/xfburn/xfburn-directory-browser.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,382 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#ifdef HAVE_THUNAR_VFS
+#include <thunar-vfs/thunar-vfs.h>
+#endif
+
+#include <exo/exo.h>
+
+#include "xfburn-directory-browser.h"
+#include "xfburn-data-composition.h"
+#include "xfburn-utils.h"
+
+#define XFBURN_DIRECTORY_BROWSER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_DIRECTORY_BROWSER, XfburnDirectoryBrowserPrivate))
+
+typedef struct
+{
+ gchar *current_path;
+} XfburnDirectoryBrowserPrivate;
+
+/* prototypes */
+static void xfburn_directory_browser_class_init (XfburnDirectoryBrowserClass *);
+static void xfburn_directory_browser_init (XfburnDirectoryBrowser *);
+static void cb_browser_drag_data_get (GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer);
+
+static gint directory_tree_sortfunc (GtkTreeModel *, GtkTreeIter *, GtkTreeIter *, gpointer);
+
+/* globals */
+static const gchar *DIRECTORY = N_("Folder");
+
+/********************************/
+/* XfburnDirectoryBrowser class */
+/********************************/
+static ExoTreeViewClass *parent_class = NULL;
+
+GtkType
+xfburn_directory_browser_get_type (void)
+{
+ static GtkType directory_browser_type = 0;
+
+ if (!directory_browser_type) {
+ static const GTypeInfo directory_browser_info = {
+ sizeof (XfburnDirectoryBrowserClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_directory_browser_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnDirectoryBrowser),
+ 0,
+ (GInstanceInitFunc) xfburn_directory_browser_init
+ };
+
+ directory_browser_type =
+ g_type_register_static (EXO_TYPE_TREE_VIEW, "XfburnDirectoryBrowser", &directory_browser_info, 0);
+ }
+
+ return directory_browser_type;
+}
+
+static void
+xfburn_directory_browser_finalize (GObject * object)
+{
+ XfburnDirectoryBrowserPrivate *priv = XFBURN_DIRECTORY_BROWSER_GET_PRIVATE (object);
+
+ g_free (priv->current_path);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+xfburn_directory_browser_class_init (XfburnDirectoryBrowserClass * klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnDirectoryBrowserPrivate));
+ parent_class = g_type_class_peek_parent (klass);
+
+ gobject_class->finalize = xfburn_directory_browser_finalize;
+}
+
+static void
+xfburn_directory_browser_init (XfburnDirectoryBrowser * browser)
+{
+ GtkListStore *model;
+ GtkTreeViewColumn *column_file;
+ GtkCellRenderer *cell_icon, *cell_file;
+ GtkTreeSelection *selection;
+
+ GtkTargetEntry gte[] = { {"text/plain", 0, DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN} };
+
+ model = gtk_list_store_new (DIRECTORY_BROWSER_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_UINT64, G_TYPE_STRING, G_TYPE_STRING);
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), DIRECTORY_BROWSER_COLUMN_FILE,
+ directory_tree_sortfunc, NULL, NULL);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), DIRECTORY_BROWSER_COLUMN_FILE, GTK_SORT_ASCENDING);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (browser), GTK_TREE_MODEL (model));
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
+
+ column_file = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (column_file, _("File"));
+
+ cell_icon = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (column_file, cell_icon, FALSE);
+ gtk_tree_view_column_set_attributes (column_file, cell_icon, "pixbuf", DIRECTORY_BROWSER_COLUMN_ICON, NULL);
+ g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);
+
+ cell_file = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (column_file, cell_file, TRUE);
+ gtk_tree_view_column_set_attributes (column_file, cell_file, "text", DIRECTORY_BROWSER_COLUMN_FILE, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column_file);
+
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (browser), -1, _("Size"), gtk_cell_renderer_text_new (),
+ "text", DIRECTORY_BROWSER_COLUMN_HUMANSIZE, NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (browser), -1, _("Type"), gtk_cell_renderer_text_new (),
+ "text", DIRECTORY_BROWSER_COLUMN_TYPE, NULL);
+
+ gtk_tree_view_column_set_resizable (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_FILE - 1)), 1);
+ gtk_tree_view_column_set_resizable (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_HUMANSIZE - 1)), 1);
+
+ gtk_tree_view_column_set_fixed_width (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_FILE - 1)), 500);
+ gtk_tree_view_column_set_fixed_width (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_HUMANSIZE - 1)), 100);
+
+ gtk_tree_view_column_set_min_width (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_FILE - 1)), 100);
+ gtk_tree_view_column_set_min_width (gtk_tree_view_get_column (GTK_TREE_VIEW (browser),
+ (DIRECTORY_BROWSER_COLUMN_HUMANSIZE - 1)), 60);
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+
+ /* set up DnD */
+ gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (browser), GDK_BUTTON1_MASK, gte,
+ G_N_ELEMENTS (gte), GDK_ACTION_COPY);
+ g_signal_connect (G_OBJECT (browser), "drag-data-get", G_CALLBACK (cb_browser_drag_data_get), browser);
+}
+
+/* internals */
+static gint
+directory_tree_sortfunc (GtkTreeModel * model, GtkTreeIter * a, GtkTreeIter * b, gpointer user_data)
+{
+ /* adapted from gnomebaker */
+ gchar *aname, *bname, *amime, *bmime;
+ gboolean aisdir = FALSE;
+ gboolean bisdir = FALSE;
+ gint result = 0;
+
+ gtk_tree_model_get (model, a, DIRECTORY_BROWSER_COLUMN_FILE, &aname, DIRECTORY_BROWSER_COLUMN_TYPE, &amime, -1);
+ gtk_tree_model_get (model, b, DIRECTORY_BROWSER_COLUMN_FILE, &bname, DIRECTORY_BROWSER_COLUMN_TYPE, &bmime, -1);
+
+ aisdir = !g_ascii_strcasecmp (amime, _(DIRECTORY));
+ bisdir = !g_ascii_strcasecmp (bmime, _(DIRECTORY));
+
+ if (aisdir && !bisdir)
+ result = -1;
+ else if (!aisdir && bisdir)
+ result = 1;
+ else
+ result = g_ascii_strcasecmp (aname, bname);
+
+ g_free (aname);
+ g_free (amime);
+ g_free (bname);
+ g_free (bmime);
+
+ return result;
+}
+
+static void
+cb_browser_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
+ GtkSelectionData * data, guint info, guint time, gpointer user_data)
+{
+ if (info == DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN) {
+ gchar *full_paths = NULL;
+
+ full_paths = xfburn_directory_browser_get_selection (XFBURN_DIRECTORY_BROWSER (widget));
+ gtk_selection_data_set_text (data, full_paths, -1);
+ g_free (full_paths);
+ }
+}
+
+/* public methods */
+GtkWidget *
+xfburn_directory_browser_new (void)
+{
+ return g_object_new (xfburn_directory_browser_get_type (), NULL);
+}
+
+void
+xfburn_directory_browser_load_path (XfburnDirectoryBrowser * browser, const gchar * path)
+{
+ XfburnDirectoryBrowserPrivate *priv = XFBURN_DIRECTORY_BROWSER_GET_PRIVATE (browser);
+
+ GtkTreeModel *model;
+ GDir *dir;
+ GError *error = NULL;
+ GdkPixbuf *icon_directory, *icon_file;
+ const gchar *dir_entry;
+ int x, y;
+ gchar *temp;
+ GdkScreen *screen;
+ GtkIconTheme *icon_theme;
+
+ dir = g_dir_open (path, 0, &error);
+ if (!dir) {
+ g_warning ("unable to open the %s directory : %s", path, error->message);
+ g_error_free (error);
+ return;
+ }
+
+ temp = g_strdup (path);
+ g_free (priv->current_path);
+ priv->current_path = temp;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (browser));
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (browser));
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+ icon_directory = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", x, 0, NULL);
+ icon_file = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-regular", x, 0, NULL);
+
+ while ((dir_entry = g_dir_read_name (dir))) {
+ gchar *full_path;
+ struct stat s;
+
+ full_path = g_build_filename (path, dir_entry, NULL);
+ if (g_file_test (full_path, G_FILE_TEST_IS_SYMLINK)) {
+ g_free (full_path);
+ continue;
+ }
+
+ if (dir_entry[0] != '.' && (stat (full_path, &s) == 0)) {
+ gchar *humansize;
+
+ humansize = xfburn_humanreadable_filesize (s.st_size);
+
+ if ((s.st_mode & S_IFDIR)) {
+ GtkTreeIter iter;
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ DIRECTORY_BROWSER_COLUMN_ICON, icon_directory,
+ DIRECTORY_BROWSER_COLUMN_FILE, dir_entry,
+ DIRECTORY_BROWSER_COLUMN_HUMANSIZE, humansize,
+ DIRECTORY_BROWSER_COLUMN_SIZE, (guint64) s.st_size,
+ DIRECTORY_BROWSER_COLUMN_TYPE, _(DIRECTORY), DIRECTORY_BROWSER_COLUMN_PATH, full_path, -1);
+ }
+ else if ((s.st_mode & S_IFREG)) {
+ GtkTreeIter iter;
+#ifdef HAVE_THUNAR_VFS
+ ThunarVfsMimeDatabase *mime_database = NULL;
+ ThunarVfsMimeInfo *mime_info = NULL;
+ const gchar *mime_icon_name = NULL;
+ GdkPixbuf *mime_icon = NULL;
+ const gchar *mime_str = NULL;
+#endif
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+
+#ifdef HAVE_THUNAR_VFS
+ mime_database = thunar_vfs_mime_database_get_default ();
+ mime_info = thunar_vfs_mime_database_get_info_for_file (mime_database, full_path, NULL);
+
+ mime_icon_name = thunar_vfs_mime_info_lookup_icon_name (mime_info, icon_theme);
+ mime_icon = gtk_icon_theme_load_icon (icon_theme, mime_icon_name, x, 0, NULL);
+
+ mime_str = thunar_vfs_mime_info_get_comment (mime_info);
+
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ DIRECTORY_BROWSER_COLUMN_ICON, (G_IS_OBJECT (mime_icon) ? mime_icon : icon_file),
+ DIRECTORY_BROWSER_COLUMN_FILE, dir_entry,
+ DIRECTORY_BROWSER_COLUMN_HUMANSIZE, humansize,
+ DIRECTORY_BROWSER_COLUMN_SIZE, (guint64) s.st_size,
+ DIRECTORY_BROWSER_COLUMN_TYPE, mime_str, DIRECTORY_BROWSER_COLUMN_PATH, full_path, -1);
+
+ if (G_LIKELY (G_IS_OBJECT (mime_icon)))
+ g_object_unref (mime_icon);
+ thunar_vfs_mime_info_unref (mime_info);
+ g_object_unref (mime_database);
+#else
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ DIRECTORY_BROWSER_COLUMN_ICON, icon_file,
+ DIRECTORY_BROWSER_COLUMN_FILE, dir_entry,
+ DIRECTORY_BROWSER_COLUMN_HUMANSIZE, humansize,
+ DIRECTORY_BROWSER_COLUMN_SIZE, (guint64) s.st_size,
+ DIRECTORY_BROWSER_COLUMN_TYPE, _("File"), DIRECTORY_BROWSER_COLUMN_PATH, full_path, -1);
+#endif
+ }
+ g_free (humansize);
+ }
+ g_free (full_path);
+ }
+
+ if (icon_directory)
+ g_object_unref (icon_directory);
+ if (icon_file)
+ g_object_unref (icon_file);
+
+ g_dir_close (dir);
+}
+
+void
+xfburn_directory_browser_refresh (XfburnDirectoryBrowser * browser)
+{
+ XfburnDirectoryBrowserPrivate *priv = XFBURN_DIRECTORY_BROWSER_GET_PRIVATE (browser);
+ gchar *temp;
+
+ temp = g_strdup (priv->current_path);
+ xfburn_directory_browser_load_path (browser, (const gchar*) temp);
+ g_free (temp);
+}
+
+gchar *
+xfburn_directory_browser_get_selection (XfburnDirectoryBrowser * browser)
+{
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GList *selected_rows;
+ gchar *full_paths = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
+
+ selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
+ selected_rows = g_list_last (selected_rows);
+ while (selected_rows) {
+ GtkTreeIter iter;
+ gchar *current_path = NULL;
+ gchar *temp = NULL;
+
+ gtk_tree_model_get_iter (model, &iter, (GtkTreePath *) selected_rows->data);
+ gtk_tree_model_get (model, &iter, DIRECTORY_BROWSER_COLUMN_PATH, ¤t_path, -1);
+
+ temp = g_strdup_printf ("file://%s\n%s", current_path, full_paths ? full_paths : "");
+ g_free (current_path);
+ g_free (full_paths);
+ full_paths = temp;
+
+ selected_rows = g_list_previous (selected_rows);
+ }
+
+ selected_rows = g_list_first (selected_rows);
+ g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free (selected_rows);
+
+ return full_paths;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h (from rev 5093, xfburn/trunk/xfburn/xfburn-directory-browser.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-directory-browser.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,73 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_DIRECTORY_BROWSER_H__
+#define __XFBURN_DIRECTORY_BROWSER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include <exo/exo.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_DIRECTORY_BROWSER (xfburn_directory_browser_get_type ())
+#define XFBURN_DIRECTORY_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_DIRECTORY_BROWSER, XfburnDirectoryBrowser))
+#define XFBURN_DIRECTORY_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_DIRECTORY_BROWSER, XfburnDirectoryBrowserClass))
+#define XFBURN_IS_DIRECTORY_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_DIRECTORY_BROWSER))
+#define XFBURN_IS_DIRECTORY_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_DIRECTORY_BROWSER))
+#define XFBURN_DIRECTORY_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_DIRECTORY_BROWSER, XfburnDirectoryBrowserClass))
+
+typedef struct
+{
+ ExoTreeView treeview;
+} XfburnDirectoryBrowser;
+
+typedef struct
+{
+ ExoTreeViewClass parent_class;
+} XfburnDirectoryBrowserClass;
+
+enum
+{
+ DIRECTORY_BROWSER_COLUMN_ICON,
+ DIRECTORY_BROWSER_COLUMN_FILE,
+ DIRECTORY_BROWSER_COLUMN_HUMANSIZE,
+ DIRECTORY_BROWSER_COLUMN_SIZE,
+ DIRECTORY_BROWSER_COLUMN_TYPE,
+ DIRECTORY_BROWSER_COLUMN_PATH,
+ DIRECTORY_BROWSER_N_COLUMNS
+};
+
+
+GtkType xfburn_directory_browser_get_type (void);
+
+GtkWidget *xfburn_directory_browser_new (void);
+
+void xfburn_directory_browser_load_path (XfburnDirectoryBrowser * browser, const gchar * path);
+void xfburn_directory_browser_refresh (XfburnDirectoryBrowser * browser);
+
+gchar *xfburn_directory_browser_get_selection (XfburnDirectoryBrowser * browser);
+
+G_END_DECLS
+
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c (from rev 5093, xfburn/trunk/xfburn/xfburn-file-browser.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,248 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "xfburn-file-browser.h"
+#include "xfburn-fs-browser.h"
+#include "xfburn-directory-browser.h"
+
+#define XFBURN_FILE_BROWSER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_FILE_BROWSER, XfburnFileBrowserPrivate))
+
+typedef enum {
+ FS_BROWSER,
+ DIRECTORY_BROWSER,
+} HasFocusWidgetType;
+
+/* private struct */
+typedef struct {
+ HasFocusWidgetType has_focus;
+} XfburnFileBrowserPrivate;
+
+/* prototypes */
+static void xfburn_file_browser_class_init (XfburnFileBrowserClass *);
+static void xfburn_file_browser_init (XfburnFileBrowser *);
+
+static void cb_fs_browser_selection_changed (GtkTreeSelection *, XfburnFileBrowser *);
+static void cb_directory_browser_row_activated (GtkWidget *, GtkTreePath *, GtkTreeViewColumn *, XfburnFileBrowser *);
+static gboolean cb_focus_in_event (GtkWidget *widget, GdkEventFocus *event, XfburnFileBrowser *file_browser);
+
+/***************************/
+/* XfburnFileBrowser class */
+/***************************/
+static GtkHPanedClass *parent_class = NULL;
+
+GtkType
+xfburn_file_browser_get_type (void)
+{
+ static GtkType file_browser_type = 0;
+
+ if (!file_browser_type) {
+ static const GTypeInfo file_browser_info = {
+ sizeof (XfburnFileBrowserClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_file_browser_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnFileBrowser),
+ 0,
+ (GInstanceInitFunc) xfburn_file_browser_init
+ };
+
+ file_browser_type = g_type_register_static (GTK_TYPE_HPANED, "XfburnFileBrowser", &file_browser_info, 0);
+ }
+
+ return file_browser_type;
+}
+
+static void
+xfburn_file_browser_class_init (XfburnFileBrowserClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (XfburnFileBrowserPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_file_browser_init (XfburnFileBrowser * file_browser)
+{
+ GtkWidget *scrolled_window;
+ GtkTreeSelection *selection;
+
+ /* FS browser */
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
+ gtk_paned_add1 (GTK_PANED (file_browser), scrolled_window);
+ gtk_widget_show (scrolled_window);
+
+ file_browser->fs_browser = xfburn_fs_browser_new ();
+ gtk_widget_show (file_browser->fs_browser);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (file_browser->fs_browser));
+
+ /* directory browser */
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
+ gtk_paned_add2 (GTK_PANED (file_browser), scrolled_window);
+ gtk_widget_show (scrolled_window);
+
+ file_browser->directory_browser = xfburn_directory_browser_new ();
+ gtk_widget_show (file_browser->directory_browser);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (file_browser->directory_browser));
+
+ xfburn_directory_browser_load_path (XFBURN_DIRECTORY_BROWSER (file_browser->directory_browser), xfce_get_homedir ());
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (file_browser->fs_browser));
+
+ g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_fs_browser_selection_changed), file_browser);
+
+ g_signal_connect (G_OBJECT (file_browser->directory_browser), "row-activated",
+ G_CALLBACK (cb_directory_browser_row_activated), file_browser);
+
+ g_signal_connect (G_OBJECT (file_browser->fs_browser), "focus-in-event", G_CALLBACK (cb_focus_in_event), file_browser);
+ g_signal_connect (G_OBJECT (file_browser->directory_browser), "focus-in-event", G_CALLBACK (cb_focus_in_event), file_browser);
+}
+
+/*************/
+/* internals */
+/*************/
+static void
+cb_directory_browser_row_activated (GtkWidget * treeview, GtkTreePath * path, GtkTreeViewColumn * column,
+ XfburnFileBrowser * browser)
+{
+ GtkTreeSelection *selection_dir, *selection_fs;
+ GtkTreeModel *model_dir, *model_fs;
+ GtkTreeIter iter_dir, iter_fs;
+
+ selection_dir = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+ selection_fs = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser->fs_browser));
+ if (gtk_tree_selection_count_selected_rows (selection_dir) == 1 &&
+ gtk_tree_selection_get_selected (selection_fs, &model_fs, &iter_fs)) {
+ GtkTreePath *path_fs, *path_dir;
+ GList *selected_row = NULL;
+ GtkTreeIter iter;
+ gchar *directory = NULL;
+ gboolean found = FALSE;
+
+ selected_row = gtk_tree_selection_get_selected_rows (selection_dir, &model_dir);
+ path_dir = (GtkTreePath *) selected_row->data;
+ gtk_tree_model_get_iter (model_dir, &iter_dir, path_dir);
+ gtk_tree_model_get (model_dir, &iter_dir, DIRECTORY_BROWSER_COLUMN_FILE, &directory, -1);
+
+ g_list_foreach (selected_row, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free (selected_row);
+
+ /* expand the parent directory in the FS browser */
+ path_fs = gtk_tree_model_get_path (model_fs, &iter_fs);
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (browser->fs_browser), path_fs, FALSE);
+
+ if (gtk_tree_model_iter_children (model_fs, &iter, &iter_fs)) {
+ do {
+ gchar *temp = NULL;
+
+ gtk_tree_model_get (model_fs, &iter, FS_BROWSER_COLUMN_DIRECTORY, &temp, -1);
+
+ if (temp && !strcmp (temp, directory)) {
+ found = TRUE;
+ g_free (temp);
+ break;
+ }
+
+ g_free (temp);
+ } while (gtk_tree_model_iter_next (model_fs, &iter));
+ }
+
+ /* select the current directory in the FS browser */
+ if (found) {
+ gtk_tree_selection_select_iter (selection_fs, &iter);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser->fs_browser), path_fs, NULL, FALSE, 0, 0);
+ }
+
+ gtk_tree_path_free (path_fs);
+ g_free (directory);
+ }
+}
+
+static void
+cb_fs_browser_selection_changed (GtkTreeSelection * selection, XfburnFileBrowser * browser)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ gchar *path;
+ gtk_tree_model_get (model, &iter, FS_BROWSER_COLUMN_PATH, &path, -1);
+ xfburn_directory_browser_load_path (XFBURN_DIRECTORY_BROWSER (browser->directory_browser), path);
+ g_free (path);
+ }
+}
+
+static gboolean
+cb_focus_in_event (GtkWidget *widget, GdkEventFocus *event, XfburnFileBrowser *file_browser)
+{
+ XfburnFileBrowserPrivate *priv = XFBURN_FILE_BROWSER_GET_PRIVATE (file_browser);
+
+ if (widget == file_browser->fs_browser) {
+ priv->has_focus = FS_BROWSER;
+ } else if (widget == file_browser->directory_browser) {
+ priv->has_focus = DIRECTORY_BROWSER;
+ }
+
+ return FALSE;
+}
+
+/******************/
+/* public methods */
+/******************/
+GtkWidget *
+xfburn_file_browser_new (void)
+{
+ return g_object_new (xfburn_file_browser_get_type (), NULL);
+}
+
+void
+xfburn_file_browser_refresh (XfburnFileBrowser *browser)
+{
+ // TODO refresh fs browser
+ xfburn_directory_browser_refresh (XFBURN_DIRECTORY_BROWSER (browser->directory_browser));
+}
+
+gchar *
+xfburn_file_browser_get_selection (XfburnFileBrowser *browser)
+{
+ XfburnFileBrowserPrivate *priv = XFBURN_FILE_BROWSER_GET_PRIVATE (browser);
+
+ if (priv->has_focus == FS_BROWSER)
+ return xfburn_fs_browser_get_selection (XFBURN_FS_BROWSER (browser->fs_browser));
+ else if (priv->has_focus == DIRECTORY_BROWSER)
+ return xfburn_directory_browser_get_selection (XFBURN_DIRECTORY_BROWSER (browser->directory_browser));
+
+ return NULL;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h (from rev 5093, xfburn/trunk/xfburn/xfburn-file-browser.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-file-browser.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,60 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_FILE_BROWSER_H__
+#define __XFBURN_FILE_BROWSER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_FILE_BROWSER (xfburn_file_browser_get_type ())
+#define XFBURN_FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_FILE_BROWSER, XfburnFileBrowser))
+#define XFBURN_FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_FILE_BROWSER, XfburnFileBrowserClass))
+#define XFBURN_IS_FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_FILE_BROWSER))
+#define XFBURN_IS_FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_FILE_BROWSER))
+#define XFBURN_FILE_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_FILE_BROWSER, XfburnFileBrowserClass))
+
+typedef struct
+{
+ GtkHPaned hpaned;
+
+ GtkWidget *fs_browser;
+ GtkWidget *directory_browser;
+} XfburnFileBrowser;
+
+typedef struct
+{
+ GtkHPanedClass parent_class;
+} XfburnFileBrowserClass;
+
+GtkType xfburn_file_browser_get_type (void);
+
+GtkWidget *xfburn_file_browser_new (void);
+
+void xfburn_file_browser_refresh (XfburnFileBrowser *browser);
+gchar *xfburn_file_browser_get_selection (XfburnFileBrowser *browser);
+
+G_END_DECLS
+
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-format-dvd-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,176 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "xfburn-global.h"
+#include "xfburn-utils.h"
+
+#include "xfburn-device-box.h"
+#include "xfburn-stock.h"
+
+#include "xfburn-format-dvd-dialog.h"
+
+#define XFBURN_FORMAT_DVD_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_FORMAT_DVD_DIALOG, XfburnFormatDvdDialogPrivate))
+
+typedef struct
+{
+ GtkWidget *device_box;
+ GtkWidget *check_eject;
+} XfburnFormatDvdDialogPrivate;
+
+static void xfburn_format_dvd_dialog_class_init (XfburnFormatDvdDialogClass * klass);
+static void xfburn_format_dvd_dialog_init (XfburnFormatDvdDialog * sp);
+
+static void xfburn_format_dvd_dialog_response_cb (XfburnFormatDvdDialog * dialog, gint response_id, gpointer user_data);
+
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_format_dvd_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnFormatDvdDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_format_dvd_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnFormatDvdDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_format_dvd_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnFormatDvdDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_format_dvd_dialog_class_init (XfburnFormatDvdDialogClass * klass)
+{
+ parent_class = g_type_class_peek_parent (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnFormatDvdDialogPrivate));
+}
+
+static void
+xfburn_format_dvd_dialog_init (XfburnFormatDvdDialog * obj)
+{
+ XfburnFormatDvdDialogPrivate *priv = XFBURN_FORMAT_DVD_DIALOG_GET_PRIVATE (obj);
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ GdkPixbuf *icon = NULL;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *button;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Format DVD+RW"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+
+ icon = gtk_widget_render_icon (GTK_WIDGET (obj), XFBURN_STOCK_FORMAT_DVDRW, GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_window_set_icon (GTK_WINDOW (obj), icon);
+ g_object_unref (icon);
+
+ /* devices list */
+ priv->device_box = xfburn_device_box_new (SHOW_DVD_WRITERS | SHOW_SPEED_SELECTION);
+ gtk_widget_show (priv->device_box);
+
+ frame = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ /* options */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ frame = xfce_create_framebox_with_content (_("Options"), vbox);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
+
+ priv->check_eject = gtk_check_button_new_with_mnemonic (_("E_ject disk"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_eject), TRUE);
+ gtk_widget_show (priv->check_eject);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->check_eject, FALSE, FALSE, BORDER);
+
+ /* action buttons */
+ button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
+
+ button = xfce_create_mixed_button (XFBURN_STOCK_FORMAT_DVDRW/*"xfburn-blank-cdrw"*/, _("_Format"));
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button);
+ gtk_widget_grab_default (button);
+
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_format_dvd_dialog_response_cb), obj);
+}
+
+static void
+xfburn_format_dvd_dialog_response_cb (XfburnFormatDvdDialog * dialog, gint response_id, gpointer user_data)
+{
+ if (response_id == GTK_RESPONSE_OK) {
+ XfburnFormatDvdDialogPrivate *priv = XFBURN_FORMAT_DVD_DIALOG_GET_PRIVATE (dialog);
+ gchar *command;
+ XfburnDevice *device;
+ gint speed;
+ //GtkWidget *dialog_progress;
+
+ device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
+ speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box));
+
+ command = g_strconcat ("cdrecord -v gracetime=2 -format", " dev=", device->node_path, " speed=", speed,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_eject)) ? " -eject" : "", NULL);
+
+
+
+
+ /*
+ dialog_progress = xfburn_format_dvd_progress_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog_progress), gtk_window_get_transient_for (GTK_WINDOW (dialog)));
+ gtk_widget_hide (GTK_WIDGET (dialog));
+
+ g_object_set_data (G_OBJECT (dialog_progress), "command", command);
+ gtk_dialog_run (GTK_DIALOG (dialog_progress));
+ */
+ g_free (command);
+
+ xfce_warn ("Sorry i don't have DVD+RW discs in order to implement and test that function currently");
+ }
+}
+
+/* public */
+GtkWidget *
+xfburn_format_dvd_dialog_new ()
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_FORMAT_DVD_DIALOG, NULL));
+
+ return obj;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-format-dvd-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-format-dvd-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,52 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_FORMAT_DVD_DIALOG_H__
+#define __XFBURN_FORMAT_DVD_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_FORMAT_DVD_DIALOG (xfburn_format_dvd_dialog_get_type ())
+#define XFBURN_FORMAT_DVD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_FORMAT_DVD_DIALOG, XfburnFormatDvdDialog))
+#define XFBURN_FORMAT_DVD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_FORMAT_DVD_DIALOG, XfburnFormatDvdDialogClass))
+#define XFBURN_IS_FORMAT_DVD_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_FORMAT_DVD_DIALOG))
+#define XFBURN_IS_FORMAT_DVD_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_FORMAT_DVD_DIALOG))
+#define XFBURN_FORMAT_DVD_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_FORMAT_DVD_DIALOG, XfburnFormatDvdDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnFormatDvdDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+} XfburnFormatDvdDialogClass;
+
+GtkType xfburn_format_dvd_dialog_get_type ();
+GtkWidget *xfburn_format_dvd_dialog_new ();
+
+G_END_DECLS
+#endif /* XFBURN_FORMAT_DVD_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c (from rev 5093, xfburn/trunk/xfburn/xfburn-fs-browser.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,307 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-fs-browser.h"
+#include "xfburn-data-composition.h"
+#include "xfburn-utils.h"
+
+/* prototypes */
+static void xfburn_fs_browser_class_init (XfburnFsBrowserClass * klass);
+static void xfburn_fs_browser_init (XfburnFsBrowser * sp);
+
+static void cb_browser_row_expanded (GtkTreeView *, GtkTreeIter *, GtkTreePath *, gpointer);
+static void cb_browser_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
+static void cb_browser_drag_data_get (GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, XfburnFsBrowser *);
+
+/*************************/
+/* XfburnFsBrowser class */
+/*************************/
+static ExoTreeViewClass *parent_class = NULL;
+
+GType
+xfburn_fs_browser_get_type ()
+{
+ static GType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnFsBrowserClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_fs_browser_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnFsBrowser),
+ 0,
+ (GInstanceInitFunc) xfburn_fs_browser_init,
+ };
+
+ type = g_type_register_static (EXO_TYPE_TREE_VIEW, "XfburnFsBrowser", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_fs_browser_class_init (XfburnFsBrowserClass * klass)
+{
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_fs_browser_init (XfburnFsBrowser * browser)
+{
+ GtkTreeStore *model;
+ GtkTreeViewColumn *column_directory;
+ GtkCellRenderer *cell_icon, *cell_directory;
+ GtkTreeSelection *selection;
+
+ GtkTargetEntry gte[] = { {"text/plain", 0, DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN} };
+
+ model = gtk_tree_store_new (FS_BROWSER_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), FS_BROWSER_COLUMN_DIRECTORY, GTK_SORT_ASCENDING);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (browser), GTK_TREE_MODEL (model));
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
+
+ column_directory = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (column_directory, _("Filesystem"));
+ gtk_tree_view_column_set_expand (column_directory, TRUE);
+
+ cell_icon = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (column_directory, cell_icon, FALSE);
+ gtk_tree_view_column_set_attributes (column_directory, cell_icon, "pixbuf", FS_BROWSER_COLUMN_ICON, NULL);
+ g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);
+
+ cell_directory = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (column_directory, cell_directory, TRUE);
+ gtk_tree_view_column_set_attributes (column_directory, cell_directory, "text", FS_BROWSER_COLUMN_DIRECTORY, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column_directory);
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+
+ g_signal_connect (G_OBJECT (browser), "row-expanded", G_CALLBACK (cb_browser_row_expanded), browser);
+ g_signal_connect (G_OBJECT (browser), "row-activated", G_CALLBACK (cb_browser_row_activated), browser);
+
+ /* load the directory list */
+ xfburn_fs_browser_refresh (browser);
+
+ /* set up DnD */
+ gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (browser), GDK_BUTTON1_MASK, gte,
+ G_N_ELEMENTS (gte), GDK_ACTION_COPY);
+ g_signal_connect (G_OBJECT (browser), "drag-data-get", G_CALLBACK (cb_browser_drag_data_get), browser);
+}
+
+static void
+load_directory_in_browser (XfburnFsBrowser * browser, const gchar * path, GtkTreeIter * parent)
+{
+ GDir *dir;
+ GError *error = NULL;
+ GdkPixbuf *icon;
+ GtkTreeModel *model;
+ GdkScreen *screen;
+ GtkIconTheme *icon_theme;
+ const gchar *dir_entry;
+ int x, y;
+
+ dir = g_dir_open (path, 0, &error);
+ if (!dir) {
+ g_warning ("unable to open the %s directory : %s", path, error->message);
+ g_error_free (error);
+ return;
+ }
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (browser));
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (browser));
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+ icon = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", x, 0, NULL);
+
+ while ((dir_entry = g_dir_read_name (dir))) {
+ gchar *full_path;
+
+ full_path = g_build_filename (path, dir_entry, NULL);
+ if (dir_entry[0] != '.' && g_file_test (full_path, G_FILE_TEST_IS_DIR) &&
+ !g_file_test (full_path, G_FILE_TEST_IS_SYMLINK)) {
+ GtkTreeIter iter;
+ GtkTreeIter iter_empty;
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter, parent);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+ FS_BROWSER_COLUMN_ICON, icon,
+ FS_BROWSER_COLUMN_DIRECTORY, dir_entry, FS_BROWSER_COLUMN_PATH, full_path, -1);
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_empty, &iter);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_empty, FS_BROWSER_COLUMN_DIRECTORY, "", -1);
+ }
+ g_free (full_path);
+ }
+
+ if (icon)
+ g_object_unref (icon);
+
+ g_dir_close (dir);
+}
+
+static void
+cb_browser_row_expanded (GtkTreeView * treeview, GtkTreeIter * iter, GtkTreePath * path, gpointer user_data)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter_empty;
+ gchar *value;
+
+ model = gtk_tree_view_get_model (treeview);
+ if (!gtk_tree_model_iter_nth_child (model, &iter_empty, iter, 0))
+ return;
+
+ gtk_tree_model_get (model, &iter_empty, FS_BROWSER_COLUMN_DIRECTORY, &value, -1);
+
+ if (gtk_tree_path_get_depth (path) > 1 && strlen (value) == 0) {
+ gchar *full_path;
+
+ gtk_tree_store_remove (GTK_TREE_STORE (model), &iter_empty);
+
+ gtk_tree_model_get (model, iter, FS_BROWSER_COLUMN_PATH, &full_path, -1);
+
+ load_directory_in_browser (user_data, full_path, iter);
+ gtk_tree_view_expand_row (treeview, path, FALSE);
+
+ g_free (full_path);
+ }
+
+ g_free (value);
+}
+
+static void
+cb_browser_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
+{
+ gtk_tree_view_expand_row (treeview, path, FALSE);
+}
+
+static void
+cb_browser_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
+ GtkSelectionData * data, guint info, guint time, XfburnFsBrowser *browser)
+{
+ if (info == DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN) {
+ gchar *full_path = NULL;
+
+ full_path = xfburn_fs_browser_get_selection (browser);
+ gtk_selection_data_set_text (data, full_path, -1);
+ g_free (full_path);
+ }
+}
+
+/* public methods */
+GtkWidget *
+xfburn_fs_browser_new ()
+{
+ return g_object_new (XFBURN_TYPE_FS_BROWSER, NULL);
+}
+
+void
+xfburn_fs_browser_refresh (XfburnFsBrowser * browser)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter_home, iter_root;
+ int x, y;
+ gchar *text;
+ GdkScreen *screen;
+ GtkIconTheme *icon_theme;
+ GdkPixbuf *icon;
+ GtkTreeSelection *selection;
+ GtkTreePath *path;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (browser));
+
+ gtk_tree_store_clear (GTK_TREE_STORE (model));
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+
+ /* load the user's home dir */
+ text = g_strdup_printf (_("%s's home"), g_get_user_name ());
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (browser));
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+ icon = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-home", x, 0, NULL);
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_home, NULL);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_home,
+ FS_BROWSER_COLUMN_ICON, icon,
+ FS_BROWSER_COLUMN_DIRECTORY, text, FS_BROWSER_COLUMN_PATH, xfce_get_homedir (), -1);
+ if (icon)
+ g_object_unref (icon);
+ g_free (text);
+
+ load_directory_in_browser (browser, xfce_get_homedir (), &iter_home);
+
+ /* load the fs root */
+ icon = gtk_icon_theme_load_icon (icon_theme, "gnome-dev-harddisk", x, 0, NULL);
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_root, NULL);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_root,
+ FS_BROWSER_COLUMN_ICON, icon,
+ FS_BROWSER_COLUMN_DIRECTORY, _("Filesystem"), FS_BROWSER_COLUMN_PATH, "/", -1);
+ if (icon)
+ g_object_unref (icon);
+
+ load_directory_in_browser (browser, "/", &iter_root);
+
+ /* set cursor on home dir row */
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
+ gtk_tree_selection_select_iter (selection, &iter_home);
+
+ /* expand the home dir row */
+ path = gtk_tree_model_get_path (model, &iter_home);
+ gtk_tree_view_expand_row (GTK_TREE_VIEW (browser), path, FALSE);
+ gtk_tree_path_free (path);
+}
+
+gchar *
+xfburn_fs_browser_get_selection (XfburnFsBrowser *browser)
+{
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ gchar *full_path = NULL;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
+ if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ gchar *path = NULL;
+
+ gtk_tree_model_get (model, &iter, FS_BROWSER_COLUMN_PATH, &path, -1);
+
+ full_path = g_strdup_printf ("file://%s", path);
+ g_free (path);
+ }
+
+ return full_path;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h (from rev 5093, xfburn/trunk/xfburn/xfburn-fs-browser.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-fs-browser.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,67 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_FS_BROWSER_H__
+#define __XFBURN_FS_BROWSER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include <exo/exo.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_FS_BROWSER (xfburn_fs_browser_get_type ())
+#define XFBURN_FS_BROWSER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_FS_BROWSER, XfburnFsBrowser))
+#define XFBURN_FS_BROWSER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_FS_BROWSER, XfburnFsBrowserClass))
+#define XFBURN_IS_FS_BROWSER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_FS_BROWSER))
+#define XFBURN_IS_FS_BROWSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_FS_BROWSER))
+#define XFBURN_FS_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_FS_BROWSER, XfburnFsBrowserClass))
+
+typedef struct
+{
+ ExoTreeView parent;
+} XfburnFsBrowser;
+
+typedef struct
+{
+ ExoTreeViewClass parent_class;
+} XfburnFsBrowserClass;
+
+enum
+{
+ FS_BROWSER_COLUMN_ICON,
+ FS_BROWSER_COLUMN_DIRECTORY,
+ FS_BROWSER_COLUMN_PATH,
+ FS_BROWSER_N_COLUMNS
+};
+
+GType xfburn_fs_browser_get_type ();
+
+GtkWidget *xfburn_fs_browser_new ();
+
+void xfburn_fs_browser_refresh (XfburnFsBrowser *browser);
+gchar * xfburn_fs_browser_get_selection (XfburnFsBrowser *browser);
+
+G_END_DECLS
+
+#endif /* __XFBURN_FS_BROWSER_H__ */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h (from rev 5093, xfburn/trunk/xfburn/xfburn-global.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-global.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,47 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_GLOBAL_H__
+#define __XFBURN_GLOBAL_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define BORDER 5
+
+#define READCD_CAPACITY "Capacity:"
+#define READCD_PROGRESS "addr:"
+#define READCD_DONE "Time total:"
+
+#define CDRDAO_LENGTH "length"
+#define CDRDAO_FLUSHING "Flushing cache..."
+#define CDRDAO_INSERT "Please insert a recordable medium and hit enter"
+#define CDRDAO_INSERT_AGAIN "Cannot determine disk status - hit enter to try again."
+#define CDRDAO_DONE "CD copying finished successfully."
+
+/* in reality CDR_1X_SPEED is 176.4 (see libburn.h:1577), but that shouldn't matter */
+#define CDR_1X_SPEED 176
+#define DVD_1X_SPEED 1385
+
+#define DATA_COMPOSITION_DEFAULT_NAME "Data composition"
+
+#define XFBURN_FIFO_DEFAULT_SIZE 4096 /* in kb/s */
+
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c (from rev 5093, xfburn/trunk/xfburn/xfburn-hal-manager.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,265 @@
+/* $Id: xfburn-hal-manager.c 4382 2006-11-01 17:08:37Z dmohr $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (dmohr at mcbf.net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_HAL
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libhal-storage.h>
+
+#include <errno.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-global.h"
+#include "xfburn-progress-dialog.h"
+
+#include "xfburn-hal-manager.h"
+
+static void xfburn_hal_manager_class_init (XfburnHalManagerClass * klass);
+static void xfburn_hal_manager_init (XfburnHalManager * sp);
+static void xfburn_hal_manager_finalize (GObject * object);
+
+static void hal_finalize (LibHalContext *hal_context);
+static void cb_device_added (LibHalContext *ctx, const char *udi);
+static void cb_device_removed (LibHalContext *ctx, const char *udi);
+static void cb_prop_modified (LibHalContext *ctx, const char *udi, const char *key,
+ dbus_bool_t is_removed, dbus_bool_t is_added);
+
+#define XFBURN_HAL_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_HAL_MANAGER, XfburnHalManagerPrivate))
+
+enum {
+ VOLUME_CHANGED,
+ LAST_SIGNAL,
+};
+
+typedef struct {
+ LibHalContext *hal_context;
+ DBusConnection *dbus_connection;
+} XfburnHalManagerPrivate;
+
+static XfburnHalManager *halman = NULL;
+
+/*********************/
+/* class declaration */
+/*********************/
+static XfburnProgressDialogClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL];
+
+GtkType
+xfburn_hal_manager_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnHalManagerClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_hal_manager_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnHalManager),
+ 0,
+ (GInstanceInitFunc) xfburn_hal_manager_init,
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "XfburnHalManager", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_hal_manager_class_init (XfburnHalManagerClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnHalManagerPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_hal_manager_finalize;
+
+ signals[VOLUME_CHANGED] = g_signal_new ("volume-changed", XFBURN_TYPE_HAL_MANAGER, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnHalManagerClass, volume_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+}
+
+static void
+xfburn_hal_manager_init (XfburnHalManager * obj)
+{
+ XfburnHalManagerPrivate *priv = XFBURN_HAL_MANAGER_GET_PRIVATE (obj);
+ LibHalContext *hal_context = NULL;
+ DBusError derror;
+ //GError *error = NULL;
+
+ DBusConnection *dbus_connection;
+
+ //if (halman != NULL)
+ // g_error ("The HAL context was already there when trying to create a hal-manager!");
+
+ /* dbus & hal init code taken from exo */
+ /* initialize D-Bus error */
+ dbus_error_init (&derror);
+
+ /* try to connect to the system bus */
+ dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
+ if (G_LIKELY (dbus_connection != NULL)) {
+ /* try to allocate a new HAL context */
+ hal_context = libhal_ctx_new ();
+ if (G_LIKELY (hal_context != NULL)) {
+ /* setup the D-Bus connection for the HAL context */
+ if (libhal_ctx_set_dbus_connection (hal_context, dbus_connection)) {
+
+ /* try to initialize the HAL context */
+ libhal_ctx_init (hal_context, &derror);
+ } else {
+ dbus_set_error_const (&derror, DBUS_ERROR_NO_MEMORY, g_strerror (ENOMEM));
+ }
+ } else {
+ /* record the allocation failure of the context */
+ dbus_set_error_const (&derror, DBUS_ERROR_NO_MEMORY, g_strerror (ENOMEM));
+ }
+ }
+
+ /* check if we failed */
+ if (dbus_error_is_set (&derror)) {
+ /* check if a HAL context was allocated */
+ if (G_UNLIKELY (hal_context != NULL)) {
+ /* drop the allocated HAL context */
+ hal_finalize (hal_context);
+ hal_context = NULL;
+ }
+ DBG ("Connection to dbus or hal failed!");
+ } else {
+ libhal_ctx_set_device_added (hal_context, cb_device_added);
+ libhal_ctx_set_device_removed (hal_context, cb_device_removed);
+ libhal_ctx_set_device_property_modified (hal_context, cb_prop_modified);
+ }
+
+ dbus_error_free (&derror);
+
+ priv->hal_context = hal_context;
+ priv->dbus_connection = dbus_connection;
+}
+
+static void
+xfburn_hal_manager_finalize (GObject * object)
+{
+ XfburnHalManagerPrivate *priv = XFBURN_HAL_MANAGER_GET_PRIVATE (object);
+
+ hal_finalize (priv->hal_context);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+ halman = NULL;
+}
+
+/* */
+/* internals */
+/* */
+static void
+hal_finalize (LibHalContext *hal_context)
+{
+ DBusError derror;
+
+ dbus_error_init (&derror);
+ libhal_ctx_shutdown (hal_context, &derror);
+ if (dbus_error_is_set (&derror)) {
+ DBG ("Error shutting hal down!");
+ }
+ dbus_error_free (&derror);
+ libhal_ctx_free (hal_context);
+}
+
+static void cb_device_added (LibHalContext *ctx, const char *udi)
+{
+ DBG ("HAL: device added");
+ g_signal_emit (halman, signals[VOLUME_CHANGED], 0);
+}
+
+static void cb_device_removed (LibHalContext *ctx, const char *udi)
+{
+ DBG ("HAL: device removed");
+ g_signal_emit (halman, signals[VOLUME_CHANGED], 0);
+}
+
+static void cb_prop_modified (LibHalContext *ctx, const char *udi,
+ const char *key, dbus_bool_t is_removed, dbus_bool_t is_added)
+{
+ /* Lets ignore this for now,
+ * way too many of these get triggered when a disc is
+ * inserted or removed!
+ DBG ("HAL: property modified");
+ g_signal_emit (halman, signals[VOLUME_CHANGED], 0);
+ */
+}
+
+/* */
+/* public */
+/* */
+
+GObject *
+xfburn_hal_manager_new ()
+{
+ if (G_UNLIKELY (halman != NULL))
+ g_error ("Trying to create a second instance of hal manager!");
+ return g_object_new (XFBURN_TYPE_HAL_MANAGER, NULL);
+}
+
+void
+xfburn_hal_manager_create_global ()
+{
+ halman = XFBURN_HAL_MANAGER (xfburn_hal_manager_new ());
+}
+
+XfburnHalManager *
+xfburn_hal_manager_get_instance ()
+{
+ if (G_UNLIKELY (halman == NULL))
+ g_error ("There is no instance of a hal manager!");
+ return halman;
+}
+
+void
+xfburn_hal_manager_shutdown ()
+{
+ if (G_UNLIKELY (halman == NULL))
+ g_error ("There is no instance of a hal manager!");
+ g_object_unref (halman);
+ halman = NULL;
+}
+
+void
+xfburn_hal_manager_send_volume_changed ()
+{
+ //gdk_threads_enter ();
+ g_signal_emit (halman, signals[VOLUME_CHANGED], 0);
+ //gdk_threads_leave ();
+}
+
+#endif /* HAVE_HAL */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h (from rev 5093, xfburn/trunk/xfburn/xfburn-hal-manager.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-hal-manager.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,66 @@
+/* $Id: xfburn-hal-manager.h 4352 2006-08-11 16:02:53Z pollux $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (david at mcbf.net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_HAL_MANAGER_H__
+#define __XFBURN_HAL_MANAGER_H__
+
+#ifdef HAVE_HAL
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include "xfburn-progress-dialog.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_HAL_MANAGER (xfburn_hal_manager_get_type ())
+#define XFBURN_HAL_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_HAL_MANAGER, XfburnHalManager))
+#define XFBURN_HAL_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_HAL_MANAGER, XfburnHalManagerClass))
+#define XFBURN_IS_HAL_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_HAL_MANAGER))
+#define XFBURN_IS_HAL_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_HAL_MANAGER))
+#define XFBURN_HAL_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_HAL_MANAGER, XfburnHalManagerClass))
+
+typedef struct
+{
+ GObject parent;
+} XfburnHalManager;
+
+typedef struct
+{
+ XfburnProgressDialogClass parent_class;
+
+ void (*volume_changed) (XfburnHalManager *halman);
+} XfburnHalManagerClass;
+
+GtkType xfburn_hal_manager_get_type ();
+GObject *xfburn_hal_manager_new ();
+void xfburn_hal_manager_create_global ();
+XfburnHalManager * xfburn_hal_manager_get_instance ();
+void xfburn_hal_manager_shutdown ();
+void xfburn_hal_manager_send_volume_changed ();
+
+G_END_DECLS
+
+#endif /* HAVE_HAL */
+
+#endif /* XFBURN_HAL_MANAGER_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c (from rev 5093, xfburn/trunk/xfburn/xfburn-main-window.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,735 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <exo/exo.h>
+
+#include "xfburn-main-window.h"
+#include "xfburn-device-list.h"
+#include "xfburn-preferences-dialog.h"
+#include "xfburn-file-browser.h"
+#include "xfburn-compositions-notebook.h"
+#include "xfburn-blank-dialog.h"
+#include "xfburn-format-dvd-dialog.h"
+#include "xfburn-copy-cd-dialog.h"
+#include "xfburn-copy-dvd-dialog.h"
+#include "xfburn-burn-image-dialog.h"
+#include "xfburn-progress-dialog.h"
+#include "xfburn-settings.h"
+#include "xfburn-main.h"
+
+#define XFBURN_MAIN_WINDOW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_MAIN_WINDOW, XfburnMainWindowPrivate))
+
+/* private struct */
+typedef struct {
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
+
+ GtkWidget *menubar;
+ GtkWidget *toolbars;
+
+ GtkWidget *vpaned;
+
+ GtkWidget *file_browser;
+ GtkWidget *compositions_notebook;
+
+ gboolean support_cdr;
+ gboolean support_cdrw;
+ XfburnWelcomeTab *welcome_tab;
+} XfburnMainWindowPrivate;
+
+/* prototypes */
+static void xfburn_main_window_class_init (XfburnMainWindowClass *);
+static void xfburn_main_window_finalize (GObject *obj);
+static void xfburn_main_window_init (XfburnMainWindow *);
+
+static gboolean cb_delete_main_window (XfburnMainWindow *, GdkEvent *, XfburnMainWindowPrivate *);
+static void cb_edit_toolbars_view (ExoToolbarsView *, gpointer);
+
+static void action_about (GtkAction *, XfburnMainWindow *);
+static void action_preferences (GtkAction *, XfburnMainWindow *);
+
+static void action_new_data_composition (GtkAction *, XfburnMainWindow *);
+//static void action_new_audio_composition (GtkAction *, XfburnMainWindow *);
+
+/*
+static void action_load (GtkAction *, XfburnMainWindow *);
+static void action_save (GtkAction *, XfburnMainWindow *);
+static void action_save_as (GtkAction *, XfburnMainWindow *);
+*/
+static void action_close (GtkAction *, XfburnMainWindow *);
+static void action_quit (GtkAction *, XfburnMainWindow *);
+
+static void action_blank (GtkAction *, XfburnMainWindow *);
+static void action_copy_cd (GtkAction *, XfburnMainWindow *);
+static void action_burn_image (GtkAction *, XfburnMainWindow *);
+
+static void action_format_dvd (GtkAction *, XfburnMainWindow *);
+static void action_copy_dvd (GtkAction *, XfburnMainWindow *);
+static void action_burn_dvd_image (GtkAction *, XfburnMainWindow *);
+
+static void action_refresh_directorybrowser (GtkAction *, XfburnMainWindow *);
+static void action_show_filebrowser (GtkToggleAction *, XfburnMainWindow *);
+static void action_show_toolbar (GtkToggleAction * action, XfburnMainWindow * window);
+
+/* globals */
+static GtkWindowClass *parent_class = NULL;
+static const GtkActionEntry action_entries[] = {
+ {"file-menu", NULL, N_("_File"), NULL,},
+ /*{"new-composition", GTK_STOCK_NEW, N_("_New composition"), "", N_("Create a new composition"),},*/
+ {"new-composition", GTK_STOCK_NEW, N_("_New composition"), NULL, N_("Create a new composition"),
+ G_CALLBACK (action_new_data_composition),},
+ /*{"new-data-composition", GTK_STOCK_HARDDISK, N_("New data composition"), "<Control><Alt>e", N_("New data composition"),
+ G_CALLBACK (action_new_data_composition),},
+ {"new-audio-composition", "audio-x-generic", N_("New audio composition"), "<Control><Alt>A", N_("New audio composition"),
+ G_CALLBACK (action_new_audio_composition),},*/
+ /*{"load-composition", GTK_STOCK_OPEN, N_("Load composition"), NULL, N_("Load composition"),
+ G_CALLBACK (action_load),},
+ {"save-composition", GTK_STOCK_SAVE, N_("Save composition"), NULL, N_("Save composition"),
+ G_CALLBACK (action_save),},
+ {"save-composition-as", GTK_STOCK_SAVE_AS, N_("Save composition as..."), NULL, N_("Save composition as"),
+ G_CALLBACK (action_save_as),},*/
+ {"close-composition", GTK_STOCK_CLOSE, N_("Close composition"), NULL, N_("Close composition"),
+ G_CALLBACK (action_close),},
+ {"quit", GTK_STOCK_QUIT, N_("_Quit"), NULL, N_("Quit Xfburn"), G_CALLBACK (action_quit),},
+ {"edit-menu", NULL, N_("_Edit"), NULL,},
+ {"preferences", GTK_STOCK_PREFERENCES, N_("Prefere_nces"), NULL, N_("Show preferences dialog"),
+ G_CALLBACK (action_preferences),},
+ {"action-menu", NULL, N_("_Actions"), NULL,},
+ {"view-menu", NULL, N_("_View"), NULL,},
+ {"refresh", GTK_STOCK_REFRESH, N_("Refresh"), NULL, N_("Refresh file list"),
+ G_CALLBACK (action_refresh_directorybrowser),},
+ {"help-menu", NULL, N_("_Help"), NULL,},
+ {"about", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("Display information about Xfburn"),
+ G_CALLBACK (action_about),},
+ {"blank-disc", "xfburn-blank-cdrw", N_("Blank CD-RW"), NULL, N_("Blank CD-RW"),
+ G_CALLBACK (action_blank),},
+ {"copy-data", "xfburn-data-copy", N_("Copy Data CD"), NULL, N_("Copy Data CD"),
+ G_CALLBACK (action_copy_cd),},
+ {"copy-audio", "xfburn-audio-copy", N_("Copy Audio CD"), NULL, N_("Copy Audio CD"),},
+ {"burn-image", "xfburn-burn-cd", N_("Burn Image"), NULL, N_("Burn Image"),
+ G_CALLBACK (action_burn_image),},
+ {"format-dvd", "xfburn-format-dvdrw", N_("Format DVD+RW"), NULL, N_("Format DVD+RW"),
+ G_CALLBACK (action_format_dvd),},
+ {"copy-dvd", "xfburn-data-copy", N_("Copy DVD"), NULL, N_("Copy DVD"),
+ G_CALLBACK (action_copy_dvd),},
+ {"burn-dvd", "xfburn-burn-image", N_("Burn DVD Image"), NULL, N_("Burn DVD Image"),
+ G_CALLBACK (action_burn_dvd_image),},
+};
+
+static const GtkToggleActionEntry toggle_action_entries[] = {
+ {"show-filebrowser", NULL, N_("Show file browser"), NULL, N_("Show/hide the file browser"),
+ G_CALLBACK (action_show_filebrowser), TRUE,},
+ {"show-toolbar", NULL, N_("Show toolbar"), NULL, N_("Show/hide the toolbar"),
+ G_CALLBACK (action_show_toolbar), TRUE,},
+};
+
+static const gchar *toolbar_actions[] = {
+ "new-composition",
+/* "load-composition",
+ "save-composition",
+ "close-composition",*/
+ "blank-disc",
+ "copy-data",
+ //"copy-audio",
+ "burn-image",
+ "format-dvd",
+ "copy-dvd",
+ "burn-dvd",
+ "refresh",
+ "about",
+ "preferences",
+};
+
+static XfburnMainWindow *instance = NULL;
+
+/**************************/
+/* XfburnMainWindow class */
+/**************************/
+GtkType
+xfburn_main_window_get_type (void)
+{
+ static GtkType main_window_type = 0;
+
+ if (!main_window_type) {
+ static const GTypeInfo main_window_info = {
+ sizeof (XfburnMainWindowClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_main_window_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnMainWindow),
+ 0,
+ (GInstanceInitFunc) xfburn_main_window_init
+ };
+
+ main_window_type = g_type_register_static (GTK_TYPE_WINDOW, "XfburnMainWindow", &main_window_info, 0);
+ }
+
+ return main_window_type;
+}
+
+static void
+xfburn_main_window_class_init (XfburnMainWindowClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnMainWindowPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_main_window_finalize;
+}
+
+static void
+xfburn_main_window_finalize (GObject *obj)
+{
+ if (instance)
+ instance = NULL;
+}
+
+static void
+xfburn_main_window_init (XfburnMainWindow * mainwin)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (mainwin);
+
+ GtkAccelGroup *accel_group;
+ gchar *file;
+
+ GtkWidget *vbox;
+
+ /* the window itself */
+ gtk_window_set_position (GTK_WINDOW (mainwin), GTK_WIN_POS_CENTER_ON_PARENT);
+ gtk_window_set_title (GTK_WINDOW (mainwin), "Xfburn");
+ gtk_window_set_icon_name (GTK_WINDOW (mainwin), GTK_STOCK_CDROM);
+ gtk_window_resize (GTK_WINDOW (mainwin), xfburn_settings_get_int ("main-window-width", 850),
+ xfburn_settings_get_int ("main-window-height", 700));
+
+ g_signal_connect (G_OBJECT (mainwin), "delete-event", G_CALLBACK (cb_delete_main_window), priv);
+
+ /* create ui manager */
+ priv->action_group = gtk_action_group_new ("xfburn-main-window");
+ gtk_action_group_set_translation_domain (priv->action_group, GETTEXT_PACKAGE);
+ gtk_action_group_add_actions (priv->action_group, action_entries, G_N_ELEMENTS (action_entries),
+ GTK_WIDGET (mainwin));
+ gtk_action_group_add_toggle_actions (priv->action_group, toggle_action_entries,
+ G_N_ELEMENTS (toggle_action_entries), GTK_WIDGET (mainwin));
+
+ priv->ui_manager = gtk_ui_manager_new ();
+ gtk_ui_manager_insert_action_group (priv->ui_manager, priv->action_group, 0);
+
+ xfce_resource_push_path (XFCE_RESOURCE_DATA, DATADIR);
+ file = xfce_resource_lookup (XFCE_RESOURCE_DATA, "xfburn/xfburn.ui");
+
+ if (G_LIKELY (file != NULL)) {
+ GError *error = NULL;
+ if (gtk_ui_manager_add_ui_from_file (priv->ui_manager, file, &error) == 0) {
+ g_warning ("Unable to load %s: %s", file, error->message);
+ g_error_free (error);
+ }
+ gtk_ui_manager_ensure_update (priv->ui_manager);
+ g_free (file);
+ }
+ else {
+ g_warning ("Unable to locate xfburn/xfburn.ui !");
+ }
+
+ /* accel group */
+ accel_group = gtk_ui_manager_get_accel_group (priv->ui_manager);
+ gtk_window_add_accel_group (GTK_WINDOW (mainwin), accel_group);
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (mainwin), vbox);
+ gtk_widget_show (vbox);
+
+ /* menubar */
+ priv->menubar = gtk_ui_manager_get_widget (priv->ui_manager, "/main-menu");
+ if (G_LIKELY (priv->menubar != NULL)) {
+ gtk_box_pack_start (GTK_BOX (vbox), priv->menubar, FALSE, FALSE, 0);
+ gtk_widget_show (priv->menubar);
+ }
+
+ /* toolbar */
+ file = xfce_resource_lookup (XFCE_RESOURCE_DATA, "xfburn/xfburn-toolbars.ui");
+
+ if (G_LIKELY (file != NULL)) {
+ ExoToolbarsModel *model;
+ GError *error = NULL;
+
+ model = exo_toolbars_model_new ();
+ exo_toolbars_model_set_actions (model, (gchar **) toolbar_actions, G_N_ELEMENTS (toolbar_actions));
+ if (exo_toolbars_model_load_from_file (model, file, &error)) {
+ priv->toolbars = exo_toolbars_view_new_with_model (priv->ui_manager, model);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->toolbars, FALSE, FALSE, 0);
+ gtk_widget_show (priv->toolbars);
+
+ g_signal_connect (G_OBJECT (priv->toolbars), "customize", G_CALLBACK (cb_edit_toolbars_view), mainwin);
+ }
+ else {
+ g_warning ("Unable to load %s: %s", file, error->message);
+ g_error_free (error);
+ }
+
+ g_free (file);
+ }
+ else {
+ g_warning ("Unable to locate xfburn/xfburn-toolbars.ui !");
+ }
+
+ /* vpaned */
+ priv->vpaned = gtk_vpaned_new ();
+ gtk_container_add (GTK_CONTAINER (vbox), priv->vpaned);
+ gtk_widget_show (priv->vpaned);
+
+ /* filebrowser */
+ priv->file_browser = xfburn_file_browser_new ();
+ gtk_paned_add1 (GTK_PANED (priv->vpaned), priv->file_browser);
+ gtk_widget_show (priv->file_browser);
+
+ gtk_paned_set_position (GTK_PANED (priv->file_browser), xfburn_settings_get_int ("hpaned-position", 250));
+
+ /* compositions notebook */
+ priv->compositions_notebook = xfburn_compositions_notebook_new ();
+ gtk_widget_show (priv->compositions_notebook);
+ gtk_paned_add2 (GTK_PANED (priv->vpaned), priv->compositions_notebook);
+ priv->welcome_tab = xfburn_compositions_notebook_add_welcome_tab (XFBURN_COMPOSITIONS_NOTEBOOK (priv->compositions_notebook), mainwin);
+
+ gtk_paned_set_position (GTK_PANED (priv->vpaned), xfburn_settings_get_int ("vpaned-position", 200));
+
+ xfce_resource_pop_path (XFCE_RESOURCE_DATA);
+}
+
+/* internals */
+static void
+cb_edit_toolbars_view_done (ExoToolbarsEditorDialog * dialog, ExoToolbarsView * toolbar)
+{
+ exo_toolbars_view_set_editing (toolbar, FALSE);
+
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+cb_edit_toolbars_view (ExoToolbarsView * toolbar, gpointer user_data)
+{
+ GtkWidget *editor_dialog;
+ ExoToolbarsModel *model;
+ GtkUIManager *ui_manager;
+ GtkWidget *toplevel;
+
+ g_return_if_fail (EXO_IS_TOOLBARS_VIEW (toolbar));
+
+ exo_toolbars_view_set_editing (toolbar, TRUE);
+
+ model = exo_toolbars_view_get_model (EXO_TOOLBARS_VIEW (toolbar));
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (toolbar));
+ ui_manager = exo_toolbars_view_get_ui_manager (EXO_TOOLBARS_VIEW (toolbar));
+
+ editor_dialog = exo_toolbars_editor_dialog_new_with_model (ui_manager, model);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (editor_dialog), TRUE);
+ gtk_window_set_title (GTK_WINDOW (editor_dialog), _("Toolbar Editor"));
+ gtk_window_set_transient_for (GTK_WINDOW (editor_dialog), GTK_WINDOW (toplevel));
+ gtk_widget_show (editor_dialog);
+
+ g_signal_connect (G_OBJECT (editor_dialog), "destroy", G_CALLBACK (cb_edit_toolbars_view_done), toolbar);
+}
+
+static gboolean
+cb_delete_main_window (XfburnMainWindow * mainwin, GdkEvent * event, XfburnMainWindowPrivate *priv)
+{
+ gint x, y;
+
+ gtk_window_get_size (GTK_WINDOW (mainwin), &x, &y);
+ xfburn_settings_set_int ("main-window-width", x);
+ xfburn_settings_set_int ("main-window-height", y);
+
+ xfburn_settings_set_int ("vpaned-position", gtk_paned_get_position (GTK_PANED (priv->vpaned)));
+ xfburn_settings_set_int ("hpaned-position", gtk_paned_get_position (GTK_PANED (priv->file_browser)));
+ gtk_main_quit ();
+
+ return FALSE;
+}
+
+/* actions */
+static void
+action_blank (GtkAction * action, XfburnMainWindow * window)
+{
+ GtkWidget *dialog;
+
+ dialog = xfburn_blank_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void action_copy_cd (GtkAction *action, XfburnMainWindow *window)
+{
+ /*
+ GtkWidget *dialog;
+ dialog = xfburn_copy_cd_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ */
+}
+
+static void
+action_burn_image (GtkAction * action, XfburnMainWindow * window)
+{
+ GtkWidget *dialog;
+
+ dialog = xfburn_burn_image_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+action_format_dvd (GtkAction * action, XfburnMainWindow * window)
+{
+ GtkWidget *dialog;
+
+ dialog = xfburn_format_dvd_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+action_copy_dvd (GtkAction * action, XfburnMainWindow * window)
+{
+ GtkWidget *dialog;
+
+ dialog = xfburn_copy_dvd_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+action_burn_dvd_image (GtkAction * action, XfburnMainWindow * window)
+{
+}
+
+/*
+static void
+action_load (GtkAction *action, XfburnMainWindow * window)
+{
+ //XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ //xfburn_data_composition_load_from_file (XFBURN_DATA_COMPOSITION (priv->data_composition), "/tmp/test.xml");
+}
+
+static void
+action_save (GtkAction *action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ xfburn_compositions_notebook_save_composition (XFBURN_COMPOSITIONS_NOTEBOOK (priv->compositions_notebook));
+}
+
+static void
+action_save_as (GtkAction *action, XfburnMainWindow * window)
+{
+ //XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+}
+*/
+
+static void
+action_close (GtkAction *action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ xfburn_compositions_notebook_close_composition (XFBURN_COMPOSITIONS_NOTEBOOK (priv->compositions_notebook));
+}
+
+static void
+action_new_data_composition (GtkAction *action, XfburnMainWindow * window)
+{
+ xfburn_main_window_add_data_composition_with_files (window, 0, NULL);
+}
+
+/*
+static void
+action_new_audio_composition (GtkAction *action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+}
+*/
+
+static void
+action_quit (GtkAction * action, XfburnMainWindow * window)
+{
+ // if (xfce_confirm (_("Are sure you want to quit?"), GTK_STOCK_QUIT, _("_Quit")))
+ gtk_main_quit ();
+}
+
+static void
+action_about (GtkAction * action, XfburnMainWindow * window)
+{
+ XfceAboutInfo *info;
+ GtkWidget *dialog;
+ gint x, y;
+ GdkPixbuf *icon;
+ guint n;
+
+ static const struct
+ {
+ gchar *name, *email, *language;
+ } translators[] = {
+ {"Mohamed Magdy", "mohamed.m.k at gmail.com", "ar",},
+ {"Pau Rul lan Ferragut", "paurullan at bulma.net", "ca",},
+ {"Michal Várady", "miko.vaji at gmail.com", "cs",},
+ {"Enrico Tröger", "enrico.troeger at uvena.de", "de",},
+ {"Fabian Nowak", "timstery at arcor.de", "de",},
+ {"Nico Schümann", "nico at prog.nico22.de", "de",},
+ {"Stavros Giannouris", "stavrosg2002 at freemail.gr", "el",},
+ {"Jeff Bailes", "thepizzaking at gmail.com", "en_GB",},
+ {"Diego Rodriguez", "dieymir at yahoo.es", "es",},
+ {"Piarres Beobide", "pi at beobide.net", "eu",},
+ {"Jari Rahkonen", "jari.rahkonen at pp1.inet.fi", "fi",},
+ {"Etienne Collet", "xanaxlnx at gmail.com", "fr",},
+ {"Maximilian Schleiss", "maximilian at xfce.org", "fr",},
+ {"Attila Szervác", "sas at 321.hu", "hu",},
+ {"Daichi Kawahata", "daichi at xfce.org", "ja",},
+ {"ByungHyun Choi", "byunghyun.choi at debianusers.org", "kr",},
+ {"Mantas", "mantaz at users.sourceforge.net", "lt",},
+ {"Rihards Prieditis", "RPrieditis at inbox.lv", "lv",},
+ {"Terje Uriansrud", "ter at operamail.com", "nb_NO",},
+ {"Stephan Arts", "psybsd at gmail.com", "nl",},
+ {"Szymon Kałasz", "szymon_maestro at gazeta.pl", "pl",},
+ {"Fábio Nogueira", "deb-user-ba at ubuntu.com", "pt_BR",},
+ {"Og Maciel", "omaciel at xfce.org", "pt_BR",},
+ {"Nuno Miguel", "nunis at netcabo.pt", "pt_PT",},
+ {"Sergey Fedoseev", "fedoseev.sergey at gmail.com", "ru",},
+ {"Besnik Bleta", "besnik at programeshqip.org", "sq",},
+ {"Maxim V. Dziumanenko", "mvd at mylinux.com.ua", "uk",},
+ {"Dmitry Nikitin", "", "uk",},
+ {"ﻢﺤﻣﺩ ﻊﻠﻳ ﺎﻠﻤﻜﻳ", "makki.ma at gmail.com", "ur",},
+ {"正龙 赵", "zzl6612 at yahoo.com.cn", "zh_CN",},
+ {"Cosmo Chene", "cosmolax at gmail.com", "zh_TW",},
+ };
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
+ icon = xfce_themed_icon_load ("media-optical", x);
+ if (!icon)
+ icon = xfce_themed_icon_load ("media-cdrom", x);
+ if (!icon)
+ icon = xfce_themed_icon_load (GTK_STOCK_CDROM, x);
+
+ info = xfce_about_info_new ("Xfburn", VERSION, _("Another cd burning GUI"),
+ XFCE_COPYRIGHT_TEXT ("2005-2008", "Jean-François Wauthy, Mario Đanić, David Mohr"), XFCE_LICENSE_GPL);
+ xfce_about_info_set_homepage (info, "http://www.xfce.org/projects/xfburn");
+ xfce_about_info_add_credit (info, "Jean-François Wauthy", "pollux at xfce.org", _("Author/Maintainer"));
+ xfce_about_info_add_credit (info, "Mario Đanić", "mario at libburnia-project.org", _("Author/Maintainer"));
+ xfce_about_info_add_credit (info, "David Mohr", "david at mcbf.net", _("Author/Maintainer"));
+
+
+ for (n = 0; n < G_N_ELEMENTS (translators); ++n) {
+ gchar *s;
+
+ s = g_strdup_printf (_("Translator (%s)"), translators[n].language);
+ xfce_about_info_add_credit (info, translators[n].name, translators[n].email, s);
+ g_free (s);
+ }
+
+ dialog = xfce_about_dialog_new_with_values (GTK_WINDOW (window), info, icon);
+ gtk_widget_set_size_request (GTK_WIDGET (dialog), 400, 300);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
+ xfce_about_info_free (info);
+ if (G_LIKELY (icon != NULL))
+ g_object_unref (G_OBJECT (icon));
+}
+
+static void
+action_preferences (GtkAction * action, XfburnMainWindow * window)
+{
+ GtkWidget *dialog;
+
+ dialog = xfburn_preferences_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+action_refresh_directorybrowser (GtkAction * action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ xfburn_file_browser_refresh (XFBURN_FILE_BROWSER (priv->file_browser));
+}
+
+static void
+action_show_filebrowser (GtkToggleAction * action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ xfburn_settings_set_boolean ("show-filebrowser", gtk_toggle_action_get_active (action));
+
+ if (gtk_toggle_action_get_active (action)) {
+ gtk_widget_show (priv->file_browser);
+ }
+ else {
+ gtk_widget_hide (priv->file_browser);
+ }
+}
+
+static void
+action_show_toolbar (GtkToggleAction * action, XfburnMainWindow * window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ xfburn_settings_set_boolean ("show-toolbar", gtk_toggle_action_get_active (action));
+
+ if (gtk_toggle_action_get_active (action)) {
+ gtk_widget_show (priv->toolbars);
+ }
+ else {
+ gtk_widget_hide (priv->toolbars);
+ }
+}
+
+/******************/
+/* public methods */
+/******************/
+GtkWidget *
+xfburn_main_window_new (void)
+{
+ GtkWidget *obj;
+
+ if (G_UNLIKELY (instance)) {
+ g_error ("An instance of XfburnMainWindow has already been created");
+ return NULL;
+ }
+
+ obj = g_object_new (xfburn_main_window_get_type (), NULL);
+
+ if (obj) {
+ XfburnMainWindow *win;
+ XfburnMainWindowPrivate *priv;
+ GtkAction *action;
+ GList *device = NULL;
+
+ instance = win = XFBURN_MAIN_WINDOW (obj);
+ priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (win);
+
+ /* load settings */
+ action = gtk_action_group_get_action (priv->action_group, "show-filebrowser");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), xfburn_settings_get_boolean ("show-filebrowser", TRUE));
+ action = gtk_action_group_get_action (priv->action_group, "show-toolbar");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), xfburn_settings_get_boolean ("show-toolbar", TRUE));
+ /* action = gtk_action_group_get_action (priv->action_group, "save-composition");
+ gtk_action_set_sensitive (GTK_ACTION (action), FALSE);*/
+
+ /* disable action that cannot be used due to device */
+ device = xfburn_device_list_get_list ();
+
+ while (device != NULL) {
+ XfburnDevice *device_info = (XfburnDevice *) device->data;
+
+ if (device_info->cdr)
+ priv->support_cdr = TRUE;
+ if (device_info->cdrw)
+ priv->support_cdrw = TRUE;
+
+ device = g_list_next (device);
+ }
+
+ if (!priv->support_cdr) {
+ action = gtk_action_group_get_action (priv->action_group, "copy-data");
+ gtk_action_set_sensitive (action, FALSE);
+ action = gtk_action_group_get_action (priv->action_group, "copy-audio");
+ gtk_action_set_sensitive (action, FALSE);
+ action = gtk_action_group_get_action (priv->action_group, "burn-image");
+ gtk_action_set_sensitive (action, FALSE);
+ }
+ if (!priv->support_cdrw) {
+ action = gtk_action_group_get_action (priv->action_group, "blank-disc");
+ gtk_action_set_sensitive (action, FALSE);
+ }
+
+ g_object_set (priv->welcome_tab, "action_group", priv->action_group, NULL);
+ }
+
+ return obj;
+}
+
+XfburnMainWindow *
+xfburn_main_window_get_instance ()
+{
+ if (!instance)
+ g_warning ("No existing instance of XfburnMainWindow");
+
+ return instance;
+}
+
+GtkUIManager *
+xfburn_main_window_get_ui_manager (XfburnMainWindow *window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ return priv->ui_manager;
+}
+
+XfburnFileBrowser *
+xfburn_main_window_get_file_browser (XfburnMainWindow *window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ return XFBURN_FILE_BROWSER (priv->file_browser);
+}
+
+void
+xfburn_main_window_add_data_composition_with_files (XfburnMainWindow *window, int filec, char **filenames)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+ XfburnComposition *comp;
+
+ comp = xfburn_compositions_notebook_add_composition (XFBURN_COMPOSITIONS_NOTEBOOK (priv->compositions_notebook), XFBURN_DATA_COMPOSITION);
+ xfburn_data_composition_add_files (XFBURN_DATA_COMPOSITION (comp), filec, filenames);
+}
+
+gboolean
+xfburn_main_window_support_cdr (XfburnMainWindow *window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ return priv->support_cdr;
+}
+
+gboolean
+xfburn_main_window_support_cdrw (XfburnMainWindow *window)
+{
+ XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
+
+ return priv->support_cdrw;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h (from rev 5093, xfburn/trunk/xfburn/xfburn-main-window.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main-window.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,65 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_MAIN_WINDOW_H__
+#define __XFBURN_MAIN_WINDOW_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "xfburn-data-composition.h"
+#include "xfburn-file-browser.h"
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_MAIN_WINDOW (xfburn_main_window_get_type ())
+#define XFBURN_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFBURN_TYPE_MAIN_WINDOW, XfburnMainWindow))
+#define XFBURN_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFBURN_TYPE_MAIN_WINDOW, XfburnMainWindowClass))
+#define XFBURN_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFBURN_TYPE_MAIN_WINDOW))
+#define XFBURN_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFBURN_TYPE_MAIN_WINDOW))
+#define XFBURN_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFBURN_TYPE_MAIN_WINDOW, XfburnMainWindowClass))
+
+typedef struct
+{
+ GtkWindow window;
+} XfburnMainWindow;
+
+typedef struct
+{
+ GtkWindowClass parent_class;
+} XfburnMainWindowClass;
+
+GtkType xfburn_main_window_get_type (void);
+
+GtkWidget *xfburn_main_window_new (void);
+XfburnMainWindow *xfburn_main_window_get_instance (void);
+
+GtkUIManager *xfburn_main_window_get_ui_manager (XfburnMainWindow *window);
+XfburnFileBrowser *xfburn_main_window_get_file_browser (XfburnMainWindow *window);
+
+void xfburn_main_window_add_data_composition_with_files (XfburnMainWindow *window, int filec, char **filenames);
+
+gboolean xfburn_main_window_support_cdr (XfburnMainWindow *window);
+gboolean xfburn_main_window_support_cdrw (XfburnMainWindow *window);
+
+G_END_DECLS
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c (from rev 5093, xfburn/trunk/xfburn/xfburn-main.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,259 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <stdlib.h>
+
+#include <gtk/gtk.h>
+
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#ifdef HAVE_THUNAR_VFS
+#include <thunar-vfs/thunar-vfs.h>
+#endif
+
+#include "xfburn-global.h"
+#include "xfburn-device-list.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+#include "xfburn-stock.h"
+#include "xfburn-burn-image-dialog.h"
+#include "xfburn-main-window.h"
+#include "xfburn-blank-dialog.h"
+#include "xfburn-hal-manager.h"
+
+
+/* internal prototypes */
+static gboolean parse_option (const gchar *option_name, const gchar *value,
+ gpointer data, GError **error);
+
+/* command line parameters */
+static gchar *image_filename = NULL;
+static gboolean show_version = FALSE;
+static gboolean other_action = FALSE;
+static gboolean show_main = FALSE;
+static gboolean add_data_composition = FALSE;
+static gboolean blank = FALSE;
+
+static GOptionEntry optionentries[] = {
+ { "burn-image", 'i', G_OPTION_FLAG_OPTIONAL_ARG /* || G_OPTION_FLAG_FILENAME */, G_OPTION_ARG_CALLBACK, &parse_option,
+ "Open the burn image dialog. The filename of the image can optionally be specified as a parameter", NULL },
+ { "blank", 'b', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
+ "Open the blank disc dialog.", NULL },
+ { "data-composition", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
+ "Start a data composition. Optionally followed by files/directories to be added to the composition.", NULL },
+ { "version", 'V', G_OPTION_FLAG_NO_ARG , G_OPTION_ARG_NONE, &show_version,
+ "Display program version and exit", NULL },
+ { "main", 'm', G_OPTION_FLAG_NO_ARG , G_OPTION_ARG_NONE, &show_main,
+ "Show main program even when other action is specified on the command line.", NULL },
+ { NULL },
+};
+
+static gboolean parse_option (const gchar *option_name, const gchar *value,
+ gpointer data, GError **error)
+{
+ if (strcmp (option_name, "-i") == 0 || strcmp (option_name, "--burn-image") == 0) {
+ if (value == NULL)
+ image_filename = "";
+ else
+ image_filename = g_strdup(value);
+ } else if (strcmp (option_name, "-d") == 0 || strcmp (option_name, "--data-composition") == 0) {
+ add_data_composition = TRUE;
+ } else if (strcmp (option_name, "-b") == 0 || strcmp (option_name, "--blank") == 0) {
+ blank = TRUE;
+ } else {
+ g_set_error (error, 0, G_OPTION_ERROR_FAILED, "Invalid command line option. Please report, this is a bug.");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* globals */
+static int window_counter = 0;
+
+void
+xfburn_main_enter_window ()
+{
+ /* if a main window is present, then it is in control */
+ if (window_counter != -42)
+ window_counter++;
+}
+
+void
+xfburn_main_leave_window ()
+{
+ /* if a main window is present, then it is in control */
+ if (window_counter == -42)
+ return;
+
+ window_counter--;
+ if (window_counter <= 0)
+ g_idle_add ((GSourceFunc) gtk_main_quit, NULL );
+}
+
+void
+xfburn_main_enter_main_window ()
+{
+ /* mark the window_counter as having a main window */
+ window_counter = -42;
+}
+
+
+/* entry point */
+int
+main (int argc, char **argv)
+{
+ GtkWidget *mainwin;
+ gint n_drives;
+ GError *error = NULL;
+
+#if DEBUG > 0
+ g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
+#endif
+
+ g_set_application_name (_("Xfburn"));
+
+ g_thread_init (NULL);
+ gdk_threads_init ();
+ gdk_threads_enter ();
+
+ xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+
+ if (!gtk_init_with_args (&argc, &argv, "", optionentries, GETTEXT_PACKAGE, &error)) {
+ if (error != NULL) {
+ g_print (_("%s: %s\nTry %s --help to see a full list of available command line options.\n"), PACKAGE, error->message, PACKAGE_NAME);
+ g_error_free (error);
+ return 1;
+ }
+ }
+
+ if (show_version) {
+ g_print ("\tThis is %s version %s for Xfce %s\n", PACKAGE, VERSION, xfce_version_string ());
+ g_print ("\tbuilt with GTK+-%d.%d.%d, ", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+ g_print ("linked with GTK+-%d.%d.%d.\n", gtk_major_version, gtk_minor_version, gtk_micro_version);
+
+ exit (EXIT_SUCCESS);
+ }
+
+
+ xfburn_settings_init ();
+
+#ifdef HAVE_THUNAR_VFS
+ thunar_vfs_init ();
+ g_message ("Using Thunar-VFS %d.%d.%d", THUNAR_VFS_MAJOR_VERSION, THUNAR_VFS_MINOR_VERSION, THUNAR_VFS_MICRO_VERSION);
+#else
+ g_message ("Thunar-VFS not available, using default implementation");
+#endif
+
+#ifdef HAVE_HAL
+ xfburn_hal_manager_create_global ();
+#endif
+
+ xfburn_stock_init ();
+ n_drives = xfburn_device_list_init ();
+ if (n_drives < 1) {
+ GtkMessageDialog *dialog = (GtkMessageDialog *) gtk_message_dialog_new (NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CLOSE,
+ ((const gchar *) _("No drives are currently available!")));
+ gtk_message_dialog_format_secondary_text (dialog,
+ _("Maybe there is a mounted media in the drive?\n\nPlease unmount and restart the application."));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ }
+
+
+ /* evaluate parsed command line options */
+
+ if (show_main) {
+ xfburn_main_enter_main_window ();
+ }
+
+ if (image_filename != NULL) {
+ GtkWidget *dialog = xfburn_burn_image_dialog_new ();
+ other_action = TRUE;
+
+ DBG ("image_filename = '%s'\n", image_filename);
+
+ if (*image_filename != '\0') {
+ gchar *image_fullname;
+
+ if (!g_path_is_absolute (image_filename))
+ image_fullname = g_build_filename (g_get_current_dir (), image_filename, NULL);
+ else
+ image_fullname = image_filename;
+
+ if (g_file_test (image_fullname, G_FILE_TEST_EXISTS))
+ xfburn_burn_image_dialog_set_filechooser_name (dialog, image_fullname);
+ else
+ xfce_err ( g_strdup_printf ( _("Image file '%s' does not exist!"), image_fullname));
+ }
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ } else if (blank) {
+ GtkWidget *dialog = xfburn_blank_dialog_new ();
+
+ other_action = TRUE;
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+
+
+ /* main window */
+ if (!other_action || show_main) {
+ xfburn_main_enter_main_window ();
+ mainwin = xfburn_main_window_new ();
+
+ gtk_widget_show (mainwin);
+
+ if (add_data_composition)
+ xfburn_main_window_add_data_composition_with_files (XFBURN_MAIN_WINDOW (mainwin), argc-1, argv+1);
+ }
+
+ gtk_main ();
+
+ /* shutdown */
+#ifdef HAVE_THUNAR_VFS
+ thunar_vfs_shutdown ();
+#endif
+
+#ifdef HAVE_HAL
+ xfburn_hal_manager_shutdown ();
+#endif
+
+ xfburn_settings_flush ();
+ xfburn_settings_free ();
+
+ xfburn_device_list_free ();
+
+ gdk_threads_leave ();
+
+ return EXIT_SUCCESS;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h (from rev 5093, xfburn/trunk/xfburn/xfburn-main.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-main.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,33 @@
+/* $Id: xfburn-main.h 4958 2008-06-17 15:11:44Z squisher $ */
+/*
+ * Copyright (c) 2008 David Mohr <david at mcbf.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_MAIN_H__
+#define __XFBURN_MAIN_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+G_BEGIN_DECLS
+
+void xfburn_main_leave_window ();
+void xfburn_main_enter_window ();
+
+G_END_DECLS
+#endif /* __XFBURN_MAIN_H__ */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c (from rev 5093, xfburn/trunk/xfburn/xfburn-notebook-tab.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,194 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-notebook-tab.h"
+
+#define XFBURN_NOTEBOOK_TAB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_NOTEBOOK_TAB, XfburnNotebookTabPrivate))
+
+enum {
+ BUTTON_CLOSE_CLICKED,
+ LAST_SIGNAL,
+};
+
+enum {
+ PROP_0,
+ PROP_LABEL,
+};
+
+/* private members */
+typedef struct
+{
+ GtkWidget *label;
+ GtkWidget *button_close;
+} XfburnNotebookTabPrivate;
+
+
+/* prototypes */
+static void xfburn_notebook_tab_class_init (XfburnNotebookTabClass * klass);
+static void xfburn_notebook_tab_init (XfburnNotebookTab * tab);
+static void xfburn_notebook_tab_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void xfburn_notebook_tab_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+
+static void cb_composition_close (GtkButton *button, XfburnNotebookTab *tab);
+
+/* static member */
+static GtkHBoxClass *parent_class = NULL;
+static guint notebook_tab_signals[LAST_SIGNAL];
+
+/************************/
+/* class initiliazation */
+/************************/
+GtkType
+xfburn_notebook_tab_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnNotebookTabClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_notebook_tab_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnNotebookTab),
+ 0,
+ (GInstanceInitFunc) xfburn_notebook_tab_init,
+ };
+
+ type = g_type_register_static (GTK_TYPE_HBOX, "XfburnNotebookTab", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_notebook_tab_class_init (XfburnNotebookTabClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnNotebookTabPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->set_property = xfburn_notebook_tab_set_property;
+ object_class->get_property = xfburn_notebook_tab_get_property;
+
+ notebook_tab_signals[BUTTON_CLOSE_CLICKED] = g_signal_new ("button-close-clicked",
+ G_TYPE_FROM_CLASS (object_class), G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnNotebookTabClass, button_close_clicked),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+
+ g_object_class_install_property (object_class, PROP_LABEL,
+ g_param_spec_string ("label", _("Label"), _("The text of the label"),
+ NULL, G_PARAM_READWRITE));
+}
+
+static void
+xfburn_notebook_tab_init (XfburnNotebookTab * tab)
+{
+ XfburnNotebookTabPrivate *priv = XFBURN_NOTEBOOK_TAB_GET_PRIVATE (tab);
+ GtkBox *hbox = GTK_BOX (tab);
+ GtkWidget *img;
+
+ priv->label = gtk_label_new ("");
+ gtk_widget_show (priv->label);
+ gtk_box_pack_start (hbox, priv->label, TRUE, TRUE, 0);
+
+ priv->button_close = gtk_button_new ();
+ gtk_button_set_relief (GTK_BUTTON (priv->button_close), GTK_RELIEF_NONE);
+ gtk_widget_show (priv->button_close);
+
+ img = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
+ gtk_widget_show (img);
+ gtk_container_add (GTK_CONTAINER (priv->button_close), img);
+ gtk_box_pack_start (hbox, priv->button_close, FALSE, FALSE, 0);
+
+ g_signal_connect (G_OBJECT (priv->button_close), "clicked", G_CALLBACK (cb_composition_close), tab);
+}
+
+static void
+xfburn_notebook_tab_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ XfburnNotebookTabPrivate *priv = XFBURN_NOTEBOOK_TAB_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_LABEL:
+ g_value_set_string (value, gtk_label_get_text (GTK_LABEL (priv->label)));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_notebook_tab_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ XfburnNotebookTabPrivate *priv = XFBURN_NOTEBOOK_TAB_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_LABEL:
+ gtk_label_set_text (GTK_LABEL (priv->label), g_value_get_string (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/*************/
+/* internals */
+/*************/
+static void
+cb_composition_close (GtkButton *button, XfburnNotebookTab *tab)
+{
+ g_signal_emit (G_OBJECT (tab), notebook_tab_signals[BUTTON_CLOSE_CLICKED], 0);
+}
+
+/**********/
+/* public */
+/**********/
+GtkWidget *
+xfburn_notebook_tab_new (const gchar *label)
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_NOTEBOOK_TAB, "homogeneous", FALSE, "label", label, NULL));
+
+ return obj;
+}
+
+void
+xfburn_notebook_tab_set_label (XfburnNotebookTab *tab, const gchar *label)
+{
+ XfburnNotebookTabPrivate *priv = XFBURN_NOTEBOOK_TAB_GET_PRIVATE (tab);
+
+ gtk_label_set_text (GTK_LABEL (priv->label), label);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h (from rev 5093, xfburn/trunk/xfburn/xfburn-notebook-tab.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-notebook-tab.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,53 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_NOTEBOOK_TAB_H__
+#define __XFBURN_NOTEBOOK_TAB_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_NOTEBOOK_TAB (xfburn_notebook_tab_get_type ())
+#define XFBURN_NOTEBOOK_TAB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_NOTEBOOK_TAB, XfburnNotebookTab))
+#define XFBURN_NOTEBOOK_TAB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_NOTEBOOK_TAB, XfburnNotebookTabClass))
+#define XFBURN_IS_NOTEBOOK_TAB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_NOTEBOOK_TAB))
+#define XFBURN_IS_NOTEBOOK_TAB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_NOTEBOOK_TAB))
+#define XFBURN_NOTEBOOK_TAB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_NOTEBOOK_TAB, XfburnNotebookTabClass))
+
+typedef struct
+{
+ GtkHBox parent;
+} XfburnNotebookTab;
+
+typedef struct
+{
+ GtkHBoxClass parent_class;
+
+ void (*button_close_clicked) (XfburnNotebookTab *tab);
+} XfburnNotebookTabClass;
+
+GtkType xfburn_notebook_tab_get_type ();
+
+GtkWidget *xfburn_notebook_tab_new (const gchar *label);
+
+void xfburn_notebook_tab_set_label (XfburnNotebookTab *tab, const gchar *label);
+
+G_END_DECLS
+#endif /* XFBURN_NOTEBOOK_TAB_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c (from rev 5093, xfburn/trunk/xfburn/xfburn-perform-burn.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,241 @@
+/* $Id: xfburn-perform-burn.c 4557 2008-04-13 23:21:56Z squisher $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (squisher at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <glib.h>
+#include <libburn.h>
+#include <unistd.h>
+
+#include "xfburn-perform-burn.h"
+#include "xfburn-progress-dialog.h"
+
+/*************/
+/* internals */
+/*************/
+
+
+/**************/
+/* public API */
+/**************/
+/*
+void
+xfburn_perform_burn_init (struct burn_disc **disc, struct burn_session **session, struct burn_track **track)
+{
+}
+*/
+
+void
+xfburn_perform_burn_write (GtkWidget *dialog_progress,
+ struct burn_drive *drive, XfburnWriteMode write_mode, struct burn_write_opts *burn_options, struct burn_disc *disc,
+ struct burn_source *fifo)
+{
+ enum burn_disc_status disc_state;
+ enum burn_drive_status status;
+ struct burn_progress progress;
+ time_t time_start;
+ char media_name[80];
+ int media_no;
+ int factor;
+
+ int ret;
+ gboolean error = FALSE;
+ int error_code;
+ char msg_text[BURN_MSGS_MESSAGE_LEN];
+ int os_errno;
+ char severity[80];
+ const char *final_status_text;
+ XfburnProgressDialogStatus final_status;
+ const char *final_message;
+ gdouble percent = 0.0;
+
+ while (burn_drive_get_status (drive, NULL) != BURN_DRIVE_IDLE)
+ usleep(100001);
+
+ /* retrieve media type, so we can convert from 'kb/s' into 'x' rating */
+ if (burn_disc_get_profile(drive, &media_no, media_name) == 1) {
+ /* this will fail if newer disk types get supported */
+ if (media_no <= 0x0a)
+ factor = CDR_1X_SPEED;
+ else
+ /* assume DVD for now */
+ factor = DVD_1X_SPEED;
+ } else {
+ g_warning ("no profile could be retrieved to calculate current burn speed");
+ factor = 1;
+ }
+
+ /* Evaluate drive and media */
+ while ((disc_state = burn_disc_get_status(drive)) == BURN_DISC_UNREADY)
+ usleep(100001);
+ if (disc_state == BURN_DISC_APPENDABLE && write_mode != WRITE_MODE_TAO) {
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot append data to multisession disc in this write mode (use TAO instead)"));
+ return;
+ } else if (disc_state != BURN_DISC_BLANK) {
+ if (disc_state == BURN_DISC_FULL)
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Closed media with data detected. Need blank or appendable media"));
+ else if (disc_state == BURN_DISC_EMPTY)
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("No media detected in drive"));
+ else
+ xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Cannot recognize state of drive and media"));
+ return;
+ }
+
+ /* set us up to receive fatal errors */
+ ret = burn_msgs_set_severities ("ALL", "NEVER", "libburn");
+
+ if (ret <= 0)
+ g_warning ("Failed to set libburn message severities, burn errors might not get detected!");
+
+ burn_disc_write (burn_options, disc);
+
+ while (burn_drive_get_status (drive, NULL) == BURN_DRIVE_SPAWNING)
+ usleep(1002);
+ time_start = time (NULL);
+ while ((status = burn_drive_get_status (drive, &progress)) != BURN_DRIVE_IDLE) {
+ time_t time_now = time (NULL);
+
+ switch (status) {
+ case BURN_DRIVE_WRITING:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Burning composition..."));
+ if (progress.sectors > 0 && progress.sector >= 0) {
+ gdouble cur_speed = 0.0;
+ int fifo_status, fifo_size, fifo_free;
+ char *fifo_text;
+
+ percent = (gdouble) (progress.buffer_capacity - progress.buffer_available) / (gdouble) progress.buffer_capacity;
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), percent);
+
+ percent = 1.0 + ((gdouble) progress.sector+1.0) / ((gdouble) progress.sectors) * 98.0;
+ xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), percent / 100.0);
+
+ cur_speed = ((gdouble) ((gdouble)(glong)progress.sector * 2048L) / (gdouble) (time_now - time_start)) / ((gdouble) (factor * 1000.0));
+ //DBG ("(%f / %f) / %f = %f\n", (gdouble) ((gdouble)(glong)progress.sector * 2048L), (gdouble) (time_now - time_start), ((gdouble) (factor * 1000.0)), cur_speed);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ cur_speed);
+
+ if (fifo != NULL) {
+ fifo_status = burn_fifo_inquire_status (fifo, &fifo_size, &fifo_free, &fifo_text);
+ switch (fifo_status) {
+ case 0:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("standby"));
+ break;
+ case 1:
+ percent = (gdouble) (fifo_size - fifo_free) / (gdouble) fifo_size;
+ xfburn_progress_dialog_set_fifo_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), percent);
+ break;
+ case 2:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("active"));
+ break;
+ case 3:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("ending"));
+ break;
+ case 4:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("failing"));
+ break;
+ case 5:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("unused"));
+ break;
+ case 6:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("abandoned"));
+ break;
+ case 7:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("ended"));
+ break;
+ default:
+ xfburn_progress_dialog_set_fifo_bar_text (XFBURN_PROGRESS_DIALOG (dialog_progress), _("aborted"));
+ break;
+ }
+ }
+ }
+ break;
+ case BURN_DRIVE_WRITING_LEADIN:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Writing Lead-In..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ case BURN_DRIVE_WRITING_LEADOUT:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Writing Lead-Out..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ case BURN_DRIVE_WRITING_PREGAP:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Writing pregap..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ case BURN_DRIVE_CLOSING_TRACK:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Closing track..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ case BURN_DRIVE_CLOSING_SESSION:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Closing session..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ case BURN_DRIVE_FORMATTING:
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress),
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Formatting..."));
+ xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG (dialog_progress), -1);
+ break;
+ default:
+ DBG ("Status %d not supported", status);
+ break;
+ }
+ usleep (500000);
+ }
+
+ /* check the libburn message queue for errors */
+ while ((ret = burn_msgs_obtain ("FAILURE", &error_code, msg_text, &os_errno, severity)) == 1) {
+ g_warning ("[%s] %d: %s (%d)", severity, error_code, msg_text, os_errno);
+ error = TRUE;
+ }
+#ifdef DEBUG
+ while ((ret = burn_msgs_obtain ("ALL", &error_code, msg_text, &os_errno, severity)) == 1) {
+ g_warning ("[%s] %d: %s (%d)", severity, error_code, msg_text, os_errno);
+ }
+#endif
+
+ if (ret < 0)
+ g_warning ("Fatal error while trying to retrieve libburn message!");
+
+ percent = (gdouble) progress.buffer_min_fill / (gdouble) progress.buffer_capacity;
+ xfburn_progress_dialog_set_buffer_bar_min_fill (XFBURN_PROGRESS_DIALOG (dialog_progress), percent);
+
+ if (G_LIKELY (!error)) {
+ final_message = _("Done");
+ final_status = XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED;
+ } else {
+ final_status_text = _("Failure");
+ final_status = XFBURN_PROGRESS_DIALOG_STATUS_FAILED;
+ final_message = g_strdup_printf ("%s: %s", final_status_text, msg_text);
+ }
+
+ xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), final_status, final_message);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h (from rev 5093, xfburn/trunk/xfburn/xfburn-perform-burn.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-perform-burn.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,37 @@
+/* $Id: xfburn-perform-burn.h 4503 2008-04-03 17:33:37Z squisher $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (squisher at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_PERFORM_BURN_H__
+#define __XFBURN_PERFORM_BURN_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <libburn.h>
+
+#include "xfburn-device-box.h"
+
+void xfburn_perform_burn_write (GtkWidget *dialog_progress, struct burn_drive *drive, XfburnWriteMode write_mode, struct burn_write_opts *burn_options, struct burn_disc *disc, struct burn_source *fifo);
+
+#endif /* __XFBURN_PERFORM_BURN_H__ */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-preferences-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,451 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <libxfcegui4/libxfcegui4.h>
+#include <exo/exo.h>
+
+#include "xfburn-preferences-dialog.h"
+#include "xfburn-device-list.h"
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+
+#define XFBURN_PREFERENCES_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_PREFERENCES_DIALOG, XfburnPreferencesDialogPrivate))
+
+typedef struct
+{
+ GtkWidget *notebook;
+ GtkWidget *icon_bar;
+
+ GtkWidget *chooser_button;
+ GtkWidget *check_clean_tmpdir;
+ GtkWidget *check_show_hidden;
+ GtkWidget *check_show_human_readable;
+
+ GtkWidget *treeview_devices;
+ GtkWidget *button_scan;
+ GtkWidget *check_empty_speed_list;
+ GtkWidget *scale_fifo;
+} XfburnPreferencesDialogPrivate;
+
+/* prototypes */
+static void xfburn_preferences_dialog_class_init (XfburnPreferencesDialogClass * klass);
+static void xfburn_preferences_dialog_init (XfburnPreferencesDialog * sp);
+
+static void refresh_devices_list (XfburnPreferencesDialog * dialog);
+static void scan_button_clicked_cb (GtkWidget * button, gpointer user_data);
+static void xfburn_preferences_dialog_response_cb (XfburnPreferencesDialog * dialog, guint response_id, XfburnPreferencesDialogPrivate * priv);
+
+enum {
+ SETTINGS_LIST_PIXBUF_COLUMN,
+ SETTINGS_LIST_TEXT_COLUMN,
+ SETTINGS_LIST_INDEX_COLUMN,
+ SETTINGS_LIST_N_COLUMNS,
+};
+
+enum
+{
+ DEVICE_LIST_COLUMN_ICON,
+ DEVICE_LIST_COLUMN_NAME,
+ DEVICE_LIST_COLUMN_NODE,
+ DEVICE_LIST_COLUMN_CDR,
+ DEVICE_LIST_COLUMN_CDRW,
+ DEVICE_LIST_COLUMN_DVDR,
+ DEVICE_LIST_COLUMN_DVDRAM,
+ DEVICE_LIST_N_COLUMNS
+};
+
+typedef struct
+{
+ XfburnPreferencesDialog *object;
+} XfburnPreferencesDialogSignal;
+
+/*********************************/
+/* XfburnPreferencesDialog class */
+/*********************************/
+static XfceTitledDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_preferences_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnPreferencesDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_preferences_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnPreferencesDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_preferences_dialog_init,
+ };
+
+ type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfburnPreferencesDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_preferences_dialog_class_init (XfburnPreferencesDialogClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (XfburnPreferencesDialogPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
+{
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (obj);
+
+ GtkWidget *vbox, *vbox2, *vbox3, *hbox;
+ GtkWidget *label;
+ GtkWidget *frame;
+ GtkWidget *scrolled_window;
+ GtkListStore *icon_store, *store;
+ gint x,y;
+ GdkPixbuf *icon = NULL;
+ GtkTreeIter iter;
+ GtkTreeViewColumn *column_name;
+ GtkCellRenderer *cell_icon, *cell_name;
+ GtkWidget *button_close;
+ gint index;
+
+ gtk_window_set_title (GTK_WINDOW (obj), _("Preferences"));
+ xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (obj), _("Tune how Xfburn behaves"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
+ gtk_window_set_icon_name (GTK_WINDOW (obj), GTK_STOCK_PREFERENCES);
+ gtk_dialog_set_has_separator (GTK_DIALOG (obj), FALSE);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (box, hbox, TRUE, TRUE, 0);
+ gtk_widget_show (hbox);
+
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ g_object_set (G_OBJECT (scrolled_window),
+ "hscrollbar-policy", GTK_POLICY_NEVER,
+ "shadow-type", GTK_SHADOW_IN,
+ "vscrollbar-policy", GTK_POLICY_NEVER,
+ NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, FALSE, FALSE, 0);
+ gtk_widget_show (scrolled_window);
+
+ /* icon bar */
+ icon_store = gtk_list_store_new (SETTINGS_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
+ priv->icon_bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (icon_store));
+ exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_PIXBUF_COLUMN);
+ exo_icon_bar_set_text_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_TEXT_COLUMN);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), priv->icon_bar);
+ gtk_widget_show (priv->icon_bar);
+
+ /* notebook */
+ priv->notebook = gtk_notebook_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), BORDER);
+ g_object_set (G_OBJECT (priv->notebook),
+ "show-border", FALSE,
+ "show-tabs", FALSE,
+ NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), priv->notebook, TRUE, TRUE, BORDER);
+ gtk_widget_show (priv->notebook);
+
+ /* general tab */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
+ index = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
+ gtk_widget_show (vbox);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+
+ frame = xfce_create_framebox_with_content (_("Temporary directory"), vbox2);
+ gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
+ gtk_widget_show (frame);
+
+ priv->chooser_button = gtk_file_chooser_button_new (_("Temporary directory"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
+ gtk_box_pack_start (GTK_BOX (vbox2), priv->chooser_button, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->chooser_button);
+
+ priv->check_clean_tmpdir = gtk_check_button_new_with_mnemonic (_("_Clean temporary directory on exit"));
+ gtk_box_pack_start (GTK_BOX (vbox2), priv->check_clean_tmpdir, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->check_clean_tmpdir);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+
+ frame = xfce_create_framebox_with_content (_("File browser"), vbox2);
+ gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
+ gtk_widget_show (frame);
+
+ priv->check_show_hidden = gtk_check_button_new_with_mnemonic (_("Show _hidden files"));
+ gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_hidden, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->check_show_hidden);
+
+ priv->check_show_human_readable = gtk_check_button_new_with_mnemonic (_("Show human_readable filesizes"));
+ gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_human_readable, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->check_show_human_readable);
+
+ icon = gtk_widget_render_icon (GTK_WIDGET (priv->icon_bar),
+ GTK_STOCK_PROPERTIES,
+ GTK_ICON_SIZE_DIALOG,
+ NULL);
+ gtk_list_store_append (icon_store, &iter);
+ gtk_list_store_set (icon_store, &iter,
+ SETTINGS_LIST_PIXBUF_COLUMN, icon,
+ SETTINGS_LIST_TEXT_COLUMN, _("General"),
+ SETTINGS_LIST_INDEX_COLUMN, index,
+ -1);
+ g_object_unref (G_OBJECT (icon));
+
+ /* devices tab */
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
+ index = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
+ gtk_widget_show (vbox);
+
+ label = gtk_label_new (_("Devices"));
+ gtk_widget_show (label);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (priv->notebook),
+ gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 1), label);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+
+ frame = xfce_create_framebox_with_content (_("Detected devices"), vbox2);
+ gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
+ gtk_widget_show (frame);
+
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
+ gtk_widget_show (scrolled_window);
+ gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, BORDER);
+
+ store = gtk_list_store_new (DEVICE_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+ priv->treeview_devices = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), DEVICE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->treeview_devices), TRUE);
+ gtk_widget_show (priv->treeview_devices);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), priv->treeview_devices);
+ g_object_unref (store);
+
+ /* add columns */
+ column_name = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (column_name, _("Name"));
+ gtk_tree_view_column_set_expand (column_name, TRUE);
+
+ cell_icon = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (column_name, cell_icon, FALSE);
+ gtk_tree_view_column_set_attributes (column_name, cell_icon, "pixbuf", DEVICE_LIST_COLUMN_ICON, NULL);
+ g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);
+
+ cell_name = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (column_name, cell_name, TRUE);
+ gtk_tree_view_column_set_attributes (column_name, cell_name, "text", DEVICE_LIST_COLUMN_NAME, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview_devices), column_name);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Node"),
+ gtk_cell_renderer_text_new (), "text", DEVICE_LIST_COLUMN_NODE, NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-R"),
+ gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDR, NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-RW"),
+ gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDRW,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-R"),
+ gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDR,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-RAM"),
+ gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDRAM,
+ NULL);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, BORDER);
+ gtk_widget_show (hbox);
+
+ priv->button_scan = xfce_create_mixed_button (GTK_STOCK_CDROM, _("Sc_an for devices"));
+ gtk_box_pack_end (GTK_BOX (hbox), priv->button_scan, FALSE, FALSE, BORDER);
+ g_signal_connect (G_OBJECT (priv->button_scan), "clicked", G_CALLBACK (scan_button_clicked_cb), obj);
+ gtk_widget_show (priv->button_scan);
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
+ icon = xfce_themed_icon_load ("media-optical", x);
+ if (!icon)
+ icon = xfce_themed_icon_load ("media-cdrom", x);
+ if (!icon)
+ icon = xfce_themed_icon_load (GTK_STOCK_CDROM, x);
+
+
+ gtk_list_store_append (icon_store, &iter);
+ gtk_list_store_set (icon_store, &iter,
+ SETTINGS_LIST_PIXBUF_COLUMN, icon,
+ SETTINGS_LIST_TEXT_COLUMN, _("Devices"),
+ SETTINGS_LIST_INDEX_COLUMN, index,
+ -1);
+ if (icon)
+ g_object_unref (G_OBJECT (icon));
+
+ exo_mutual_binding_new (G_OBJECT (priv->notebook), "page", G_OBJECT (priv->icon_bar), "active");
+
+
+ /* below the device list */
+ priv->check_empty_speed_list = gtk_check_button_new_with_mnemonic (_("Show _empty speed list bug warning"));
+ gtk_box_pack_start (GTK_BOX (vbox2), priv->check_empty_speed_list, FALSE, FALSE, BORDER);
+ gtk_widget_show (priv->check_empty_speed_list);
+
+ /* fifo */
+ vbox3 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox3);
+
+ frame = xfce_create_framebox_with_content (_("FIFO buffer size (in kb)"), vbox3);
+ gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
+ gtk_widget_show (frame);
+
+ priv->scale_fifo = gtk_hscale_new_with_range (0.0, 8192.0, 32.0);
+ gtk_scale_set_value_pos (GTK_SCALE (priv->scale_fifo), GTK_POS_LEFT);
+ gtk_range_set_value (GTK_RANGE (priv->scale_fifo), 0);
+ gtk_box_pack_start (GTK_BOX (vbox3), priv->scale_fifo, FALSE, FALSE, BORDER/2);
+ gtk_widget_show (priv->scale_fifo);
+
+
+ /* action buttons */
+ button_close = gtk_button_new_from_stock ("gtk-close");
+ gtk_widget_show (button_close);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), button_close, GTK_RESPONSE_CLOSE);
+ GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (button_close);
+ gtk_widget_grab_default (button_close);
+
+ g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_preferences_dialog_response_cb), priv);
+
+ refresh_devices_list (obj);
+
+ g_object_unref (icon_store);
+}
+
+/* internals */
+static void
+xfburn_preferences_dialog_load_settings (XfburnPreferencesDialog * dialog)
+{
+ XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (dialog);
+
+ gchar *temp_dir;
+
+ temp_dir = xfburn_settings_get_string ("temporary-dir", "/tmp");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->chooser_button), temp_dir);
+ g_free (temp_dir);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_clean_tmpdir),
+ xfburn_settings_get_boolean ("clean-temporary-dir", TRUE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_show_hidden),
+ xfburn_settings_get_boolean ("show-hidden-files", FALSE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_show_human_readable),
+ xfburn_settings_get_boolean ("human-readable-units", TRUE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check_empty_speed_list),
+ xfburn_settings_get_boolean ("show-empty-speed-list-notice", TRUE));
+ gtk_range_set_value (GTK_RANGE (priv->scale_fifo),
+ (double) xfburn_settings_get_int ("fifo-size", XFBURN_FIFO_DEFAULT_SIZE));
+}
+
+static void
+xfburn_preferences_dialog_save_settings (XfburnPreferencesDialog *dialog)
+{
+ XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (dialog);
+ gchar *temp_dir;
+
+ temp_dir = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (priv->chooser_button));
+ xfburn_settings_set_string ("temporary-dir", temp_dir);
+ g_free (temp_dir);
+
+ xfburn_settings_set_boolean ("clean-temporary-dir",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_clean_tmpdir)));
+ xfburn_settings_set_boolean ("show-hidden-files",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_show_hidden)));
+ xfburn_settings_set_boolean ("human-readable-units",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_show_human_readable)));
+ xfburn_settings_set_boolean ("show-empty-speed-list-notice",
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_empty_speed_list)));
+ xfburn_settings_set_int ("fifo-size",
+ ((((int) gtk_range_get_value (GTK_RANGE (priv->scale_fifo)) / 32) * 32))); /* this should round to multiples of 1024 */
+}
+
+static void
+refresh_devices_list (XfburnPreferencesDialog * dialog)
+{
+ XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (dialog);
+ GtkTreeModel *model;
+ GList *device;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview_devices));
+
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ device = xfburn_device_list_get_list ();
+ while (device) {
+ GtkTreeIter iter;
+ XfburnDevice *device_data;
+
+ device_data = (XfburnDevice *) device->data;
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ DEVICE_LIST_COLUMN_NAME, device_data->name,
+ DEVICE_LIST_COLUMN_NODE, device_data->node_path,
+ DEVICE_LIST_COLUMN_CDR, device_data->cdr,
+ DEVICE_LIST_COLUMN_CDRW, device_data->cdrw,
+ DEVICE_LIST_COLUMN_DVDR, device_data->dvdr, DEVICE_LIST_COLUMN_DVDRAM, device_data->dvdram, -1);
+
+ device = g_list_next (device);
+ }
+}
+
+static void
+xfburn_preferences_dialog_response_cb (XfburnPreferencesDialog * dialog, guint response_id, XfburnPreferencesDialogPrivate * priv)
+{
+ if (response_id == GTK_RESPONSE_CLOSE) {
+ xfburn_preferences_dialog_save_settings (dialog);
+ }
+}
+
+static void
+scan_button_clicked_cb (GtkWidget * button, gpointer user_data)
+{
+ xfburn_device_list_init ();
+ refresh_devices_list (user_data);
+}
+
+/* public */
+GtkWidget *
+xfburn_preferences_dialog_new ()
+{
+ GtkWidget *obj;
+
+ obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_PREFERENCES_DIALOG, NULL));
+
+ xfburn_preferences_dialog_load_settings (XFBURN_PREFERENCES_DIALOG (obj));
+ return obj;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-preferences-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-preferences-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,52 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_PREFERENCES_DIALOG_H__
+#define __XFBURN_PREFERENCES_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_PREFERENCES_DIALOG (xfburn_preferences_dialog_get_type ())
+#define XFBURN_PREFERENCES_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_PREFERENCES_DIALOG, XfburnPreferencesDialog))
+#define XFBURN_PREFERENCES_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_PREFERENCES_DIALOG, XfburnPreferencesDialogClass))
+#define XFBURN_IS_PREFERENCES_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_PREFERENCES_DIALOG))
+#define XFBURN_IS_PREFERENCES_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_PREFERENCES_DIALOG))
+#define XFBURN_PREFERENCES_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_PREFERENCES_DIALOG, XfburnPreferencesDialogClass))
+
+typedef struct
+{
+ XfceTitledDialog parent;
+} XfburnPreferencesDialog;
+
+typedef struct
+{
+ XfceTitledDialogClass parent_class;
+ /* Add Signal Functions Here */
+} XfburnPreferencesDialogClass;
+
+
+
+GtkType xfburn_preferences_dialog_get_type ();
+GtkWidget *xfburn_preferences_dialog_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_PREFERENCES_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c (from rev 5093, xfburn/trunk/xfburn/xfburn-progress-dialog.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,580 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+
+#include <gtk/gtk.h>
+
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "xfburn-progress-dialog.h"
+#include "xfburn-global.h"
+#include "xfburn-main.h"
+
+#define XFBURN_PROGRESS_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_PROGRESS_DIALOG, XfburnProgressDialogPrivate))
+
+/* struct */
+typedef struct
+{
+ XfburnProgressDialogStatus status;
+ int fd_stdin;
+ gboolean animate;
+ int ani_index;
+
+ GtkWidget *label_action;
+ GtkWidget *progress_bar;
+ GtkWidget *hbox_buffers;
+ GtkWidget *label_speed;
+ GtkWidget *fifo_bar;
+ GtkWidget *buffer_bar;
+
+ GtkWidget *button_stop;
+ GtkWidget *button_close;
+} XfburnProgressDialogPrivate;
+
+/* globals */
+static void xfburn_progress_dialog_class_init (XfburnProgressDialogClass * klass);
+static void xfburn_progress_dialog_init (XfburnProgressDialog * sp);
+
+static void xfburn_progress_dialog_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec);
+static void xfburn_progress_dialog_set_property (GObject * object, guint prop_id, const GValue * value,
+ GParamSpec * pspec);
+
+static void set_writing_speed (XfburnProgressDialog * dialog, gfloat speed);
+static void set_action_text (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status, const gchar * text);
+
+static void cb_button_close_clicked (GtkWidget *button, XfburnProgressDialog * dialog);
+static gboolean cb_dialog_delete (XfburnProgressDialog * dialog, GdkEvent * event, XfburnProgressDialogPrivate * priv);
+
+enum
+{
+ PROP_0,
+ PROP_STATUS,
+ PROP_SHOW_BUFFERS,
+ PROP_ANIMATE,
+};
+
+static gchar animation[] = { '-', '\\', '|', '/' };
+
+/* */
+/* enumeration type for dialog status */
+/* */
+GType
+xfburn_progress_dialog_status_get_type (void)
+{
+ static GType type = 0;
+ if (type == 0) {
+ static const GEnumValue values[] = {
+ {XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, "XFBURN_PROGRESS_DIALOG_STATUS_RUNNING", "running"},
+ {XFBURN_PROGRESS_DIALOG_STATUS_FAILED, "XFBURN_PROGRESS_DIALOG_STATUS_FAILED", "failed"},
+ {XFBURN_PROGRESS_DIALOG_STATUS_CANCELLED, "XFBURN_PROGRESS_DIALOG_STATUS_CANCELLED", "cancelled"},
+ {XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED, "XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED", "completed"},
+ {0, NULL, NULL}
+ };
+ type = g_enum_register_static ("XfburnProgressDialogStatus", values);
+ }
+ return type;
+}
+
+/* */
+/* progress dialog class */
+/* */
+static GtkDialogClass *parent_class = NULL;
+
+GtkType
+xfburn_progress_dialog_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnProgressDialogClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_progress_dialog_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnProgressDialog),
+ 0,
+ (GInstanceInitFunc) xfburn_progress_dialog_init,
+ };
+
+ type = g_type_register_static (GTK_TYPE_DIALOG, "XfburnProgressDialog", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_progress_dialog_class_init (XfburnProgressDialogClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnProgressDialogPrivate));
+
+ object_class->get_property = xfburn_progress_dialog_get_property;
+ object_class->set_property = xfburn_progress_dialog_set_property;
+
+ /* properties */
+ g_object_class_install_property (object_class, PROP_STATUS,
+ g_param_spec_enum ("status", "Status", "Status", XFBURN_TYPE_PROGRESS_DIALOG_STATUS,
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_BUFFERS,
+ g_param_spec_boolean ("show-buffers", "Show buffers", "Show buffers",
+ TRUE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_ANIMATE,
+ g_param_spec_boolean ("animate", "Show an animation", "Show an animation",
+ FALSE, G_PARAM_READWRITE));
+}
+
+static void
+xfburn_progress_dialog_init (XfburnProgressDialog * obj)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (obj);
+ GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
+ GtkWidget *frame;
+ GtkWidget *table;
+ GtkWidget *label;
+
+ gtk_window_set_default_size (GTK_WINDOW (obj), 575, 200);
+
+ /* label */
+ priv->label_action = gtk_label_new ("Initializing ...");
+ gtk_misc_set_alignment (GTK_MISC (priv->label_action), 0.1, 0.0);
+ gtk_label_set_justify (GTK_LABEL (priv->label_action), GTK_JUSTIFY_LEFT);
+ gtk_label_set_selectable (GTK_LABEL (priv->label_action), TRUE);
+ set_action_text (obj, XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Initializing..."));
+ gtk_widget_show (priv->label_action);
+ gtk_box_pack_start (box, priv->label_action, FALSE, TRUE, BORDER);
+
+ /* progress bar */
+ priv->progress_bar = gtk_progress_bar_new ();
+ gtk_widget_show (priv->progress_bar);
+ gtk_box_pack_start (box, priv->progress_bar, FALSE, FALSE, BORDER);
+ gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (priv->progress_bar), 0.05);
+
+ /* buffers */
+ priv->hbox_buffers = gtk_hbox_new (FALSE, BORDER);
+ gtk_widget_show (priv->hbox_buffers);
+ gtk_box_pack_start (box, priv->hbox_buffers, FALSE, TRUE, BORDER);
+
+ frame = gtk_frame_new (_("Estimated writing speed:"));
+ gtk_widget_show (frame);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_buffers), frame, FALSE, FALSE, 0);
+ priv->label_speed = gtk_label_new (_("no info"));
+ set_writing_speed (obj, -1);
+ gtk_widget_show (priv->label_speed);
+ gtk_container_add (GTK_CONTAINER (frame), priv->label_speed);
+
+ table = gtk_table_new (2, 2, FALSE);
+ gtk_table_set_row_spacings (GTK_TABLE (table), BORDER);
+ gtk_table_set_col_spacings (GTK_TABLE (table), BORDER * 2);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_buffers), table, TRUE, TRUE, 0);
+ gtk_widget_show (table);
+
+ label = gtk_label_new (_("FIFO buffer:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_widget_show (label);
+ priv->fifo_bar = gtk_progress_bar_new ();
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->fifo_bar), _("no info"));
+ gtk_table_attach (GTK_TABLE (table), priv->fifo_bar, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
+ gtk_widget_show (priv->fifo_bar);
+
+ label = gtk_label_new (_("Device buffer:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_widget_show (label);
+ priv->buffer_bar = gtk_progress_bar_new ();
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->buffer_bar), _("no info"));
+ gtk_table_attach (GTK_TABLE (table), priv->buffer_bar, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
+ gtk_widget_show (priv->buffer_bar);
+
+ /* action buttons */
+ priv->button_stop = gtk_button_new_from_stock (GTK_STOCK_STOP);
+ gtk_widget_show (priv->button_stop);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), priv->button_stop, GTK_RESPONSE_CANCEL);
+
+ priv->button_close = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+ gtk_widget_show (priv->button_close);
+ gtk_dialog_add_action_widget (GTK_DIALOG (obj), priv->button_close, GTK_RESPONSE_CLOSE);
+ GTK_WIDGET_SET_FLAGS (priv->button_close, GTK_CAN_DEFAULT);
+ gtk_widget_grab_focus (priv->button_close);
+ gtk_widget_grab_default (priv->button_close);
+ gtk_widget_set_sensitive (priv->button_close, FALSE);
+
+ g_signal_connect (G_OBJECT (priv->button_close), "clicked", G_CALLBACK (cb_button_close_clicked), obj);
+ g_signal_connect (G_OBJECT (obj), "delete-event", G_CALLBACK (cb_dialog_delete), priv);
+}
+
+static void
+xfburn_progress_dialog_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (object);
+ gboolean show_buffers = TRUE;
+
+ switch (prop_id) {
+ case PROP_STATUS:
+ g_value_set_enum (value, priv->status);
+ break;
+ case PROP_SHOW_BUFFERS:
+ g_object_get (G_OBJECT (priv->hbox_buffers), "visible", &show_buffers, NULL);
+ g_value_set_boolean (value, show_buffers);
+ break;
+ case PROP_ANIMATE:
+ g_value_set_boolean (value, priv->animate);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_progress_dialog_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
+{
+ XfburnProgressDialog *dialog = XFBURN_PROGRESS_DIALOG (object);
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ switch (prop_id) {
+ case PROP_STATUS:
+ xfburn_progress_dialog_set_status (dialog, g_value_get_enum (value));
+ break;
+ case PROP_SHOW_BUFFERS:
+ xfburn_progress_dialog_show_buffers (dialog, g_value_get_boolean (value));
+ break;
+ case PROP_ANIMATE:
+ priv->animate = g_value_get_boolean (value);
+ priv->ani_index = 0;
+ //DBG ("Set animate to %d", priv->animate);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+set_writing_speed (XfburnProgressDialog * dialog, gfloat speed)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gchar *temp;
+
+ if (speed < 0)
+ temp = g_strdup_printf ("<b><i>%s</i></b>", _("no info"));
+ else
+ temp = g_strdup_printf ("<b><i>%.1f x</i></b>", speed);
+
+ gtk_label_set_markup (GTK_LABEL (priv->label_speed), temp);
+
+ g_free (temp);
+}
+
+static void
+set_action_text (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status, const gchar * text)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gchar *temp = NULL;
+
+ if (status == XFBURN_PROGRESS_DIALOG_STATUS_FAILED)
+ temp = g_strdup_printf ("<span size=\"larger\" foreground=\"red\">%s</span>", text);
+ else
+ temp = g_strdup_printf ("<b>%s</b>", text);
+
+ gtk_label_set_markup (GTK_LABEL (priv->label_action), temp);
+
+ g_free (temp);
+}
+
+/* callbacks */
+static void
+cb_button_close_clicked (GtkWidget *button, XfburnProgressDialog *dialog)
+{
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ xfburn_main_leave_window ();
+}
+
+static gboolean
+cb_dialog_delete (XfburnProgressDialog * dialog, GdkEvent * event, XfburnProgressDialogPrivate * priv)
+{
+ xfburn_main_leave_window ();
+ if (!GTK_WIDGET_SENSITIVE (priv->button_close)) {
+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
+ return TRUE;
+ } else {
+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
+ return FALSE;
+ }
+}
+
+/* */
+/* public */
+/* */
+
+void
+xfburn_progress_dialog_show_buffers (XfburnProgressDialog * dialog, gboolean show)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ gdk_threads_enter ();
+ if (show)
+ gtk_widget_show (priv->hbox_buffers);
+ else
+ gtk_widget_hide (priv->hbox_buffers);
+ gdk_threads_leave ();
+}
+
+void
+xfburn_progress_dialog_pulse_progress_bar (XfburnProgressDialog * dialog)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ gdk_threads_enter ();
+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (priv->progress_bar));
+ gdk_threads_leave ();
+}
+
+/* getters */
+gdouble
+xfburn_progress_dialog_get_progress_bar_fraction (XfburnProgressDialog * dialog)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gdouble ret = 0;
+
+ gdk_threads_enter ();
+ ret = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (priv->progress_bar));
+ gdk_threads_leave ();
+
+ return ret;
+}
+
+XfburnProgressDialogStatus
+xfburn_progress_dialog_get_status (XfburnProgressDialog * dialog)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ return priv->status;
+}
+
+/* setters */
+void
+xfburn_progress_dialog_set_writing_speed (XfburnProgressDialog * dialog, gfloat speed)
+{
+ gdk_threads_enter ();
+ set_writing_speed (dialog, speed);
+ gdk_threads_leave ();
+}
+
+void
+xfburn_progress_dialog_set_buffer_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gchar *text = NULL;
+
+ if (fraction > 1.0) {
+ fraction = 1.0;
+ text = g_strdup ("100%");
+ } else if (fraction < 0.0) {
+ fraction = 0.0;
+ text = g_strdup (_("no info"));
+ } else {
+ text = g_strdup_printf ("%d%%", (int) (fraction * 100));
+ }
+
+ gdk_threads_enter ();
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->buffer_bar), fraction);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->buffer_bar), text);
+ gdk_threads_leave ();
+
+ g_free (text);
+}
+
+void
+xfburn_progress_dialog_set_buffer_bar_min_fill (XfburnProgressDialog * dialog, gdouble fraction)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gchar *text = NULL;
+
+ if (fraction > 1.0) {
+ fraction = 1.0;
+ text = g_strdup ("100%");
+ } else if (fraction < 0.0) {
+ fraction = 0.0;
+ text = g_strdup (_("no info"));
+ } else {
+ text = g_strdup_printf (_("Min. fill was %2d%%"), (int) (fraction * 100));
+ }
+
+ gdk_threads_enter ();
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->buffer_bar), fraction);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->buffer_bar), text);
+ gdk_threads_leave ();
+
+ g_free (text);
+}
+
+void
+xfburn_progress_dialog_set_fifo_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gchar *text = NULL;
+
+ if (fraction > 1.0) {
+ fraction = 1.0;
+ text = g_strdup ("100%");
+ } else if (fraction < 0.0) {
+ fraction = 0.0;
+ text = g_strdup (_("no info"));
+ } else {
+ text = g_strdup_printf ("%d%%", (int) (fraction * 100));
+ }
+
+ gdk_threads_enter ();
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->fifo_bar), fraction);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->fifo_bar), text);
+ gdk_threads_leave ();
+
+ g_free (text);
+}
+
+void
+xfburn_progress_dialog_set_fifo_bar_text (XfburnProgressDialog * dialog, const gchar *text)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ gdk_threads_enter ();
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->fifo_bar), 0.0);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->fifo_bar), text);
+ gdk_threads_leave ();
+}
+
+void
+xfburn_progress_dialog_set_progress_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+ gdouble cur_fraction = 0;
+ gchar *text = NULL;
+
+ cur_fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (priv->progress_bar));
+
+ if (fraction >= 1.0) {
+ fraction = 1.0;
+ switch (priv->status) {
+ case XFBURN_PROGRESS_DIALOG_STATUS_RUNNING:
+ text = g_strdup ("100%");
+ break;
+ case XFBURN_PROGRESS_DIALOG_STATUS_FAILED:
+ text = g_strdup (_("Failed"));
+ break;
+ case XFBURN_PROGRESS_DIALOG_STATUS_CANCELLED:
+ text = g_strdup (_("Cancelled"));
+ break;
+ case XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED:
+ text = g_strdup (_("Completed"));
+ break;
+ }
+ }
+ else if (fraction < 0.0) {
+ fraction = 0.0;
+ text = g_strdup ("0%");
+ }
+ else if (priv->status == XFBURN_PROGRESS_DIALOG_STATUS_RUNNING && fraction >= cur_fraction) {
+ if (priv->animate) {
+ text = g_strdup_printf ("%2d%% %c", (int) (fraction * 100), animation[priv->ani_index]);
+ priv->ani_index = (priv->ani_index + 1) % 4;
+ } else {
+ text = g_strdup_printf ("%d%% ", (int) (fraction * 100));
+ }
+ }
+ else if (fraction < cur_fraction) {
+ return;
+ }
+
+ gdk_threads_enter ();
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress_bar), fraction);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress_bar), text);
+ gdk_threads_leave ();
+
+ g_free (text);
+}
+
+void
+xfburn_progress_dialog_set_status (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status)
+{
+ XfburnProgressDialogPrivate *priv = XFBURN_PROGRESS_DIALOG_GET_PRIVATE (dialog);
+
+ priv->status = status;
+
+ if (status != XFBURN_PROGRESS_DIALOG_STATUS_RUNNING) {
+ gdk_threads_enter ();
+ gtk_widget_set_sensitive (priv->button_stop, FALSE);
+ gtk_widget_set_sensitive (priv->button_close, TRUE);
+ gdk_threads_leave ();
+
+ xfburn_progress_dialog_set_progress_bar_fraction (dialog, 1.0);
+ }
+}
+
+void
+xfburn_progress_dialog_set_status_with_text (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status, const gchar * text)
+{
+ xfburn_progress_dialog_set_status (dialog, status);
+ gdk_threads_enter ();
+ set_action_text (dialog, status, text);
+ gdk_threads_leave ();
+}
+
+/**
+ * Thread safe method that sets status to XFBURN_PROGRESS_DIALOG_STATUS_FAILED and shows
+ * an error message box.
+ **/
+void
+xfburn_progress_dialog_burning_failed (XfburnProgressDialog * dialog, const gchar * msg_error)
+{
+ xfburn_progress_dialog_set_status_with_text (dialog, XFBURN_PROGRESS_DIALOG_STATUS_FAILED, _("Failure"));
+
+ gdk_threads_enter ();
+ xfce_err (msg_error);
+ gdk_threads_leave ();
+}
+
+/* constructor */
+GtkWidget *
+xfburn_progress_dialog_new (GtkWindow *parent)
+{
+ XfburnProgressDialog *obj;
+ obj = XFBURN_PROGRESS_DIALOG (g_object_new (XFBURN_TYPE_PROGRESS_DIALOG, "transient-for", parent,
+ "modal", TRUE, NULL));
+
+ return GTK_WIDGET (obj);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h (from rev 5093, xfburn/trunk/xfburn/xfburn-progress-dialog.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-progress-dialog.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,87 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_PROGRESS_DIALOG_H__
+#define __XFBURN_PROGRESS_DIALOG_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include "xfburn-global.h"
+
+G_BEGIN_DECLS
+/* */
+#define XFBURN_TYPE_PROGRESS_DIALOG_STATUS (xfburn_progress_dialog_status_get_type ())
+typedef enum
+{
+ XFBURN_PROGRESS_DIALOG_STATUS_RUNNING,
+ XFBURN_PROGRESS_DIALOG_STATUS_FAILED,
+ XFBURN_PROGRESS_DIALOG_STATUS_CANCELLED,
+ XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED
+} XfburnProgressDialogStatus;
+
+GType xfburn_progress_dialog_status_get_type (void);
+
+
+/* */
+#define XFBURN_TYPE_PROGRESS_DIALOG (xfburn_progress_dialog_get_type ())
+#define XFBURN_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_PROGRESS_DIALOG, XfburnProgressDialog))
+#define XFBURN_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_PROGRESS_DIALOG, XfburnProgressDialogClass))
+#define XFBURN_IS_PROGRESS_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_PROGRESS_DIALOG))
+#define XFBURN_IS_PROGRESS_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_PROGRESS_DIALOG))
+#define XFBURN_PROGRESS_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_PROGRESS_DIALOG, XfburnProgressDialogClass))
+
+typedef struct
+{
+ GtkDialog parent;
+} XfburnProgressDialog;
+
+typedef struct
+{
+ GtkDialogClass parent_class;
+} XfburnProgressDialogClass;
+
+
+GtkType xfburn_progress_dialog_get_type ();
+
+void xfburn_progress_dialog_show_buffers (XfburnProgressDialog * dialog, gboolean show);
+void xfburn_progress_dialog_pulse_progress_bar (XfburnProgressDialog * dialog);
+
+XfburnProgressDialogStatus xfburn_progress_dialog_get_status (XfburnProgressDialog * dialog);
+gdouble xfburn_progress_dialog_get_progress_bar_fraction (XfburnProgressDialog * dialog);
+
+void xfburn_progress_dialog_set_progress_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction);
+void xfburn_progress_dialog_set_fifo_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction);
+void xfburn_progress_dialog_set_fifo_bar_text (XfburnProgressDialog * dialog, const gchar *text);
+void xfburn_progress_dialog_set_buffer_bar_fraction (XfburnProgressDialog * dialog, gdouble fraction);
+void xfburn_progress_dialog_set_buffer_bar_min_fill (XfburnProgressDialog * dialog, gdouble fraction);
+void xfburn_progress_dialog_set_writing_speed (XfburnProgressDialog * dialog, gfloat speed);
+void xfburn_progress_dialog_set_status (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status);
+void xfburn_progress_dialog_set_status_with_text (XfburnProgressDialog * dialog, XfburnProgressDialogStatus status, const gchar * text);
+
+void xfburn_progress_dialog_burning_failed (XfburnProgressDialog * dialog, const gchar * msg_error);
+
+GtkWidget *xfburn_progress_dialog_new (GtkWindow *parent);
+
+G_END_DECLS
+
+#endif /* XFBURN_PROGRESS_DIALOG_H */
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c (from rev 5093, xfburn/trunk/xfburn/xfburn-settings.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,477 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-settings.h"
+
+#define XFBURN_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_SETTINGS, XfburnSettingsPrivate))
+
+/* global */
+typedef struct _Setting Setting;
+
+static void xfburn_settings_class_init (XfburnSettingsClass * klass);
+static void xfburn_settings_internal_init (XfburnSettings * settings);
+static void xfburn_settings_finalize (GObject * object);
+
+static void value_destroy (Setting * val);
+static void load_settings (XfburnSettingsPrivate *priv);
+
+/* private */
+struct XfburnSettingsPrivate
+{
+ GHashTable *settings;
+ gchar *full_path;
+};
+
+/* structs */
+typedef enum
+{
+ SETTING_TYPE_INT,
+ SETTING_TYPE_BOOL,
+ SETTING_TYPE_STRING,
+} SettingType;
+
+struct _Setting
+{
+ SettingType type;
+ union
+ {
+ gchar *string;
+ gint integer;
+ gboolean boolean;
+ } value;
+};
+
+/**********************/
+/* object declaration */
+/**********************/
+static GObjectClass *parent_class = NULL;
+static XfburnSettings *instance = NULL;
+
+GType
+xfburn_settings_get_type ()
+{
+ static GType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnSettingsClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_settings_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnSettings),
+ 0,
+ (GInstanceInitFunc) xfburn_settings_internal_init,
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "XfburnSettings", &our_info, 0);
+ }
+
+ return type;
+}
+
+static void
+xfburn_settings_class_init (XfburnSettingsClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnSettingsPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_settings_finalize;
+}
+
+static void
+xfburn_settings_finalize (GObject * object)
+{
+ XfburnSettings *cobj;
+ XfburnSettingsPrivate *priv;
+
+ cobj = XFBURN_SETTINGS (object);
+
+ priv = XFBURN_SETTINGS_GET_PRIVATE (cobj);
+
+ if (instance) {
+ instance = NULL;
+ }
+
+ if (G_LIKELY (priv->settings))
+ g_hash_table_destroy (priv->settings);
+ if (G_LIKELY (priv->full_path))
+ g_free (priv->full_path);
+}
+
+static void
+xfburn_settings_internal_init (XfburnSettings *settings)
+{
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (settings);
+
+ priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) value_destroy);
+
+ priv->full_path = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, "xfburn/settings.xml", TRUE);
+}
+
+/*************/
+/* internals */
+/*************/
+
+/* saving functions */
+static void
+foreach_save (gpointer key, gpointer value, FILE * file_settings)
+{
+ Setting *setting = (Setting *) value;
+ gchar *str_type = NULL, *str_value = NULL;
+
+ switch (setting->type) {
+ case SETTING_TYPE_INT:
+ str_type = g_strdup ("int");
+ str_value = g_strdup_printf ("%d", setting->value.integer);
+ break;
+ case SETTING_TYPE_BOOL:
+ str_type = g_strdup ("boolean");
+ str_value = g_strdup_printf ("%s", setting->value.boolean ? "true" : "false");
+ break;
+ case SETTING_TYPE_STRING:
+ str_type = g_strdup ("string");
+ str_value = g_strdup (setting->value.string);
+ break;
+ }
+
+ fprintf (file_settings, "\t<setting name=\"%s\" type=\"%s\" value=\"%s\"/>\n", (gchar *) key, str_type, str_value);
+
+ g_free (str_type);
+ g_free (str_value);
+}
+
+static void
+save_settings (XfburnSettingsPrivate *priv)
+{
+ FILE *file_settings;
+
+ file_settings = fopen (priv->full_path, "w+");
+
+ fprintf (file_settings, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
+ fprintf (file_settings, "<xfburn-settings>\n");
+
+ g_hash_table_foreach (priv->settings, (GHFunc) foreach_save, file_settings);
+
+ fprintf (file_settings, "</xfburn-settings>\n");
+ fclose (file_settings);
+}
+
+/* loading functions */
+static gint
+_find_attribute (const gchar ** attribute_names, const gchar * attr)
+{
+ gint i;
+
+ for (i = 0; attribute_names[i]; i++) {
+ if (!strcmp (attribute_names[i], attr))
+ return i;
+ }
+
+ return -1;
+}
+
+static void
+load_settings_start (GMarkupParseContext * context, const gchar * element_name,
+ const gchar ** attribute_names, const gchar ** attribute_values,
+ gpointer user_data, GError ** error)
+{
+ gboolean *started = (gboolean *) user_data;
+
+ if (!(*started) && !strcmp (element_name, "xfburn-settings"))
+ *started = TRUE;
+ else if (!(*started))
+ return;
+
+ if (!strcmp (element_name, "setting")) {
+ int i, j, k;
+
+ if ((i = _find_attribute (attribute_names, "name")) != -1 &&
+ (j = _find_attribute (attribute_names, "type")) != -1 &&
+ (k = _find_attribute (attribute_names, "value")) != -1) {
+
+ if (!strcmp (attribute_values[j], "int"))
+ xfburn_settings_set_int (attribute_values[i], atoi (attribute_values[k]));
+ else if (!strcmp (attribute_values[j], "boolean")) {
+ if (!strcmp (attribute_values[k], "true"))
+ xfburn_settings_set_boolean (attribute_values[i], TRUE);
+ else
+ xfburn_settings_set_boolean (attribute_values[i], FALSE);
+ }
+ else if (!strcmp (attribute_values[j], "string"))
+ xfburn_settings_set_string (attribute_values[i], attribute_values[k]);
+ }
+ }
+}
+
+static void
+load_settings_end (GMarkupParseContext * context, const gchar * element_name, gpointer user_data, GError ** error)
+{
+ gboolean *started = (gboolean *) user_data;
+
+ if (!strcmp (element_name, "xfburn-settings"))
+ *started = FALSE;
+}
+
+static void
+load_settings (XfburnSettingsPrivate *priv)
+{
+ gchar *file_contents = NULL;
+ GMarkupParseContext *gpcontext = NULL;
+ struct stat st;
+ gboolean started = FALSE;
+ GMarkupParser gmparser = { load_settings_start, load_settings_end, NULL, NULL, NULL };
+ GError *err = NULL;
+#ifdef HAVE_MMAP
+ gint fd = -1;
+ void *maddr = NULL;
+#endif
+
+ if (stat (priv->full_path, &st) < 0) {
+ g_message ("No existing settings file, using default settings");
+ goto cleanup;
+ }
+
+#ifdef HAVE_MMAP
+ fd = open (priv->full_path, O_RDONLY, 0);
+ if (fd < 0)
+ goto cleanup;
+
+ maddr = mmap (NULL, st.st_size, PROT_READ, MAP_FILE | MAP_SHARED, fd, 0);
+ if (maddr)
+ file_contents = maddr;
+#endif
+
+ if (!file_contents && !g_file_get_contents (priv->full_path, &file_contents, NULL, &err)) {
+ if (err) {
+ g_warning ("Unable to read file '%s' (%d): %s", priv->full_path, err->code, err->message);
+ g_error_free (err);
+ }
+ goto cleanup;
+ }
+
+ gpcontext = g_markup_parse_context_new (&gmparser, 0, &started, NULL);
+
+ if (!g_markup_parse_context_parse (gpcontext, file_contents, st.st_size, &err)) {
+ g_warning ("Error parsing settings (%d): %s", err->code, err->message);
+ g_error_free (err);
+ goto cleanup;
+ }
+
+ if (g_markup_parse_context_end_parse (gpcontext, NULL)) {
+ DBG ("parsed");
+ }
+
+cleanup:
+ if (gpcontext)
+ g_markup_parse_context_free (gpcontext);
+#ifdef HAVE_MMAP
+ if (maddr) {
+ munmap (maddr, st.st_size);
+ file_contents = NULL;
+ }
+ if (fd > -1)
+ close (fd);
+#endif
+ if (file_contents)
+ g_free (file_contents);
+}
+
+static void
+value_destroy (Setting * val)
+{
+ if (val->type == SETTING_TYPE_STRING)
+ g_free (val->value.string);
+
+ g_free (val);
+}
+
+static XfburnSettings*
+get_instance ()
+{
+ if (G_LIKELY (instance))
+ return instance;
+ else
+ g_critical ("XfburnSettings hasn't been initialized");
+
+ return NULL;
+}
+
+/******************/
+/* public methods */
+/******************/
+void
+xfburn_settings_init ()
+{
+ if (G_LIKELY (instance == NULL)) {
+ XfburnSettingsPrivate *priv;
+
+ instance = XFBURN_SETTINGS (g_object_new (XFBURN_TYPE_SETTINGS, NULL));
+
+ if (instance) {
+ priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ load_settings (priv);
+ }
+ } else {
+ g_critical ("XfburnSettings is already initialized");
+ }
+}
+
+void
+xfburn_settings_flush ()
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+
+ save_settings (priv);
+}
+
+void
+xfburn_settings_free ()
+{
+ XfburnSettings *instance = get_instance ();
+
+ g_object_unref (instance);
+}
+
+gboolean
+xfburn_settings_get_boolean (const gchar * key, gboolean fallback)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ gpointer orig;
+ gpointer value;
+
+ if (g_hash_table_lookup_extended (priv->settings, key, &orig, &value)) {
+ Setting *setting = (Setting *) value;
+
+ if (setting->type == SETTING_TYPE_BOOL)
+ return setting->value.boolean;
+ else
+ g_warning ("The %s setting isn't of type boolean", key);
+ }
+
+ return fallback;
+}
+
+gint
+xfburn_settings_get_int (const gchar * key, gint fallback)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ gpointer orig;
+ gpointer value;
+
+ if (g_hash_table_lookup_extended (priv->settings, key, &orig, &value)) {
+ Setting *setting = (Setting *) value;
+
+ if (setting->type == SETTING_TYPE_INT)
+ return setting->value.integer;
+ else
+ g_warning ("The %s setting isn't of type integer", key);
+ }
+
+ return fallback;
+}
+
+gchar *
+xfburn_settings_get_string (const gchar * key, const gchar * fallback)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ gpointer orig;
+ gpointer value;
+
+ if (g_hash_table_lookup_extended (priv->settings, key, &orig, &value)) {
+ Setting *setting = (Setting *) value;
+
+ if (setting->type == SETTING_TYPE_STRING)
+ return g_strdup (setting->value.string);
+ else
+ g_warning ("The %s setting isn't of type string", key);
+ }
+
+ return g_strdup (fallback);
+}
+
+void
+xfburn_settings_set_boolean (const gchar * key, gboolean value)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ Setting *setting;
+
+ setting = g_new0 (Setting, 1);
+ setting->type = SETTING_TYPE_BOOL;
+ setting->value.integer = value;
+
+ g_hash_table_replace (priv->settings, (gpointer) g_strdup (key), (gpointer) setting);
+}
+
+void
+xfburn_settings_set_int (const gchar * key, gint value)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ Setting *setting;
+
+ setting = g_new0 (Setting, 1);
+ setting->type = SETTING_TYPE_INT;
+ setting->value.integer = value;
+
+ g_hash_table_replace (priv->settings, (gpointer) g_strdup (key), (gpointer) setting);
+}
+
+void
+xfburn_settings_set_string (const gchar * key, const gchar * value)
+{
+ XfburnSettings *instance = get_instance ();
+ XfburnSettingsPrivate *priv = XFBURN_SETTINGS_GET_PRIVATE (instance);
+ Setting *setting;
+
+ setting = g_new0 (Setting, 1);
+ setting->type = SETTING_TYPE_STRING;
+ setting->value.string = g_strdup (value);
+
+ g_hash_table_replace (priv->settings, (gpointer) g_strdup (key), (gpointer) setting);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h (from rev 5093, xfburn/trunk/xfburn/xfburn-settings.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-settings.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,64 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_SETTINGS_H__
+#define __XFBURN_SETTINGS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_SETTINGS (xfburn_settings_get_type ())
+#define XFBURN_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_SETTINGS, XfburnSettings))
+#define XFBURN_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_SETTINGS, XfburnSettingsClass))
+#define XFBURN_IS_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_SETTINGS))
+#define XFBURN_IS_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_SETTINGS))
+#define XFBURN_SETTINGS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_SETTINGS, XfburnSettingsClass))
+typedef struct XfburnSettingsPrivate XfburnSettingsPrivate;
+
+typedef struct
+{
+ GObject parent;
+} XfburnSettings;
+
+typedef struct
+{
+ GObjectClass parent_class;
+} XfburnSettingsClass;
+
+GType xfburn_settings_get_type ();
+
+void xfburn_settings_init ();
+void xfburn_settings_free ();
+void xfburn_settings_flush ();
+
+gint xfburn_settings_get_boolean (const gchar *key, gboolean fallback);
+gint xfburn_settings_get_int (const gchar *key, gint fallback);
+gchar *xfburn_settings_get_string (const gchar *key, const gchar *fallback);
+
+void xfburn_settings_set_boolean (const gchar *key, gboolean value);
+void xfburn_settings_set_int (const gchar *key, gint value);
+void xfburn_settings_set_string (const gchar *key, const gchar *value);
+
+G_END_DECLS
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c (from rev 5093, xfburn/trunk/xfburn/xfburn-stock.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,78 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "xfburn-stock.h"
+
+static const gchar *xfburn_stock_icons[] = {
+ XFBURN_STOCK_AUDIO_COPY,
+ XFBURN_STOCK_BLANK_CDRW,
+ XFBURN_STOCK_FORMAT_DVDRW,
+ XFBURN_STOCK_BURN_CD,
+ XFBURN_STOCK_CD,
+ XFBURN_STOCK_DATA_COPY,
+ XFBURN_STOCK_IMPORT_SESSION,
+};
+
+void
+xfburn_stock_init (void)
+{
+ GtkIconFactory * icon_factory;
+ GtkIconSource *icon_source;
+ GtkIconSet *icon_set;
+ gchar icon_name[128];
+ guint n;
+
+ /* allocate a new icon factory for the terminal icons */
+ icon_factory = gtk_icon_factory_new ();
+
+ memcpy (icon_name, "stock_", sizeof ("stock_"));
+
+ /* we try to avoid allocating multiple icon sources */
+ icon_source = gtk_icon_source_new ();
+
+ /* register our stock icons */
+ for (n = 0; n < G_N_ELEMENTS (xfburn_stock_icons); ++n) {
+ /* set the new icon name for the icon source */
+ strcpy (icon_name + (sizeof ("stock_") - 1), xfburn_stock_icons[n]);
+ gtk_icon_source_set_icon_name (icon_source, icon_name);
+
+ /* allocate the icon set */
+ icon_set = gtk_icon_set_new ();
+ gtk_icon_set_add_source (icon_set, icon_source);
+ gtk_icon_factory_add (icon_factory, xfburn_stock_icons[n], icon_set);
+ gtk_icon_set_unref (icon_set);
+ }
+
+ /* register the icon factory as default */
+ gtk_icon_factory_add_default (icon_factory);
+
+ /* cleanup */
+ g_object_unref (G_OBJECT (icon_factory));
+ gtk_icon_source_free (icon_source);
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h (from rev 5093, xfburn/trunk/xfburn/xfburn-stock.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-stock.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,37 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_STOCK_H__
+#define __XFBURN_STOCK_H__
+
+G_BEGIN_DECLS;
+
+#define XFBURN_STOCK_AUDIO_COPY "xfburn-audio-copy"
+#define XFBURN_STOCK_BLANK_CDRW "xfburn-blank-cdrw"
+#define XFBURN_STOCK_FORMAT_DVDRW "xfburn-format-dvdrw"
+#define XFBURN_STOCK_BURN_CD "xfburn-burn-cd"
+#define XFBURN_STOCK_CD "xfburn-cd"
+#define XFBURN_STOCK_DATA_COPY "xfburn-data-copy"
+#define XFBURN_STOCK_IMPORT_SESSION "xfburn-import-session"
+
+void xfburn_stock_init (void);
+
+G_END_DECLS;
+
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c (from rev 5093, xfburn/trunk/xfburn/xfburn-utils.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,170 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "xfburn-utils.h"
+#include "xfburn-settings.h"
+
+/***********/
+/* cursors */
+/***********/
+void
+xfburn_busy_cursor (GtkWidget * widget)
+{
+ GdkCursor *cursor;
+
+ g_return_if_fail (widget != NULL);
+ cursor = gdk_cursor_new (GDK_WATCH);
+ gdk_window_set_cursor (gtk_widget_get_parent_window (widget), cursor);
+ gdk_cursor_unref (cursor);
+ gdk_flush ();
+}
+
+void
+xfburn_default_cursor (GtkWidget * widget)
+{
+ g_return_if_fail (widget != NULL);
+ gdk_window_set_cursor (gtk_widget_get_parent_window (widget), NULL);
+ gdk_flush ();
+}
+
+/*******************/
+/* for filebrowser */
+/*******************/
+gchar *
+xfburn_humanreadable_filesize (guint64 size)
+{
+ if (!xfburn_settings_get_boolean ("human-readable-units", TRUE))
+ return g_strdup_printf ("%lu B", (long unsigned int) size);
+
+ /* copied from GnomeBaker */
+
+ gchar *ret = NULL;
+ const gchar *unit_list[5] = { "B ", "KB", "MB", "GB", "TB" };
+ gint unit = 0;
+ gdouble human_size = (gdouble) size;
+
+ while (human_size > 1024 && unit < 4) {
+ human_size = human_size / 1024;
+ unit++;
+ }
+
+ if ((human_size - (gulong) human_size) > 0.05)
+ ret = g_strdup_printf ("%.2f %s", human_size, unit_list[unit]);
+ else
+ ret = g_strdup_printf ("%.0f %s", human_size, unit_list[unit]);
+ return ret;
+}
+
+guint64
+xfburn_calc_dirsize (const gchar * dirname)
+{
+ /* copied from GnomeBaker */
+ guint64 size = 0;
+
+ GDir *dir = g_dir_open (dirname, 0, NULL);
+ if (dir != NULL) {
+ const gchar *name = g_dir_read_name (dir);
+ while (name != NULL) {
+ /* build up the full path to the name */
+ gchar *fullname = g_build_filename (dirname, name, NULL);
+ struct stat s;
+
+ if (stat (fullname, &s) == 0) {
+ /* see if the name is actually a directory or a regular file */
+ if (s.st_mode & S_IFDIR)
+ size += (guint64) s.st_size + xfburn_calc_dirsize (fullname);
+ else if (s.st_mode & S_IFREG)
+ size += (guint64) s.st_size;
+ }
+
+ g_free (fullname);
+ name = g_dir_read_name (dir);
+ }
+
+ g_dir_close (dir);
+ }
+
+ return size;
+}
+
+void
+xfburn_browse_for_file (GtkEntry *entry, GtkWindow *parent)
+{
+ GtkWidget *dialog;
+ const gchar *text;
+
+ text = gtk_entry_get_text (entry);
+
+ dialog = gtk_file_chooser_dialog_new (_("Select command"), parent, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
+ if (strlen (text) > 0)
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), text);
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
+ gchar *filename = NULL;
+
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ gtk_entry_set_text (entry, filename);
+ g_free (filename);
+ }
+
+ gtk_widget_destroy (dialog);
+}
+
+
+gboolean
+xfburn_ask_yes_no (GtkMessageType type, const gchar *primary_text, const gchar *secondary_text)
+{
+ GtkMessageDialog *dialog;
+ gint ret;
+ gboolean ok = TRUE;
+
+ dialog = (GtkMessageDialog *) gtk_message_dialog_new (NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ type,
+ GTK_BUTTONS_YES_NO,
+ primary_text);
+ gtk_message_dialog_format_secondary_text (dialog, secondary_text);
+ ret = gtk_dialog_run (GTK_DIALOG (dialog));
+ switch (ret) {
+ case GTK_RESPONSE_YES:
+ break;
+ default:
+ ok = FALSE;
+ }
+ xfburn_busy_cursor (GTK_DIALOG (dialog)->vbox);
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+
+ return ok;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h (from rev 5093, xfburn/trunk/xfburn/xfburn-utils.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-utils.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,40 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_UTILS_H__
+#define __XFBURN_UTILS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+#include "xfburn-global.h"
+
+void xfburn_busy_cursor (GtkWidget *);
+void xfburn_default_cursor (GtkWidget *);
+
+gchar *xfburn_humanreadable_filesize (guint64);
+guint64 xfburn_calc_dirsize (const gchar *);
+
+void xfburn_browse_for_file (GtkEntry *entry, GtkWindow *parent);
+
+gboolean xfburn_ask_yes_no (GtkMessageType type, const gchar *primary_text, const gchar *secondary_text);
+#endif
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c (from rev 5093, xfburn/trunk/xfburn/xfburn-welcome-tab.c)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.c 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,370 @@
+/* $Id: xfburn-welcome-tab.c 4382 2008-04-24 17:08:37Z dmohr $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (dmohr at mcbf.net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfburn-global.h"
+#include "xfburn-composition.h"
+
+#include "xfburn-welcome-tab.h"
+
+#include "xfburn-stock.h"
+#include "xfburn-main-window.h"
+#include "xfburn-compositions-notebook.h"
+#include "xfburn-burn-image-dialog.h"
+#include "xfburn-blank-dialog.h"
+
+/* prototypes */
+static void xfburn_welcome_tab_class_init (XfburnWelcomeTabClass * klass);
+static void xfburn_welcome_tab_init (XfburnWelcomeTab * sp);
+static void xfburn_welcome_tab_finalize (GObject * object);
+static void composition_interface_init (XfburnCompositionInterface *composition, gpointer iface_data);
+static void xfburn_welcome_tab_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void xfburn_welcome_tab_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+
+#define XFBURN_WELCOME_TAB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_WELCOME_TAB, XfburnWelcomeTabPrivate))
+
+enum {
+ LAST_SIGNAL,
+};
+
+enum {
+ PROP_0,
+ PROP_MAIN_WINDOW,
+ PROP_NOTEBOOK,
+ PROP_ACTION_GROUP,
+};
+
+typedef struct {
+ XfburnMainWindow *mainwin;
+ XfburnCompositionsNotebook *notebook;
+ GtkActionGroup *action_group;
+ GtkWidget *button_image;
+ GtkWidget *button_data_comp;
+ GtkWidget *button_blank;
+} XfburnWelcomeTabPrivate;
+
+/* internals */
+static GtkWidget* create_welcome_button (const gchar *stock, const gchar *text, const gchar *secondary);
+static void update_buttons_from_action_group (XfburnWelcomeTabPrivate *priv);
+static void show_custom_controls (XfburnComposition *composition);
+static void hide_custom_controls (XfburnComposition *composition);
+static void burn_image (GtkButton *button, XfburnWelcomeTab *tab);
+static void new_data_composition (GtkButton *button, XfburnWelcomeTab *tab);
+static void blank_disc (GtkButton *button, XfburnWelcomeTab *tab);
+
+
+/*********************/
+/* class declaration */
+/*********************/
+static GtkWidget *parent_class = NULL;
+//static guint signals[LAST_SIGNAL];
+
+GtkType
+xfburn_welcome_tab_get_type ()
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GTypeInfo our_info = {
+ sizeof (XfburnWelcomeTabClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) xfburn_welcome_tab_class_init,
+ NULL,
+ NULL,
+ sizeof (XfburnWelcomeTab),
+ 0,
+ (GInstanceInitFunc) xfburn_welcome_tab_init,
+ };
+
+ static const GInterfaceInfo composition_info = {
+ (GInterfaceInitFunc) composition_interface_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (GTK_TYPE_VBOX, "XfburnWelcomeTab", &our_info, 0);
+
+ g_type_add_interface_static (type, XFBURN_TYPE_COMPOSITION, &composition_info);
+ }
+
+ return type;
+}
+
+static void
+xfburn_welcome_tab_class_init (XfburnWelcomeTabClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfburnWelcomeTabPrivate));
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = xfburn_welcome_tab_finalize;
+ object_class->set_property = xfburn_welcome_tab_set_property;
+ object_class->get_property = xfburn_welcome_tab_get_property;
+
+ /*
+ signals[VOLUME_CHANGED] = g_signal_new ("volume-changed", XFBURN_TYPE_WELCOME_TAB, G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (XfburnWelcomeTabClass, volume_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ */
+
+ g_object_class_install_property (object_class, PROP_MAIN_WINDOW,
+ g_param_spec_object ("main-window", _("The main window"),
+ _("The main window"), XFBURN_TYPE_MAIN_WINDOW, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_NOTEBOOK,
+ g_param_spec_object ("notebook", _("Notebook"),
+ _("NOTEBOOK"), XFBURN_TYPE_COMPOSITIONS_NOTEBOOK, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_ACTION_GROUP,
+ g_param_spec_object ("action_group", _("Action group"),
+ _("Action group from the main window"), GTK_TYPE_ACTION_GROUP, G_PARAM_READWRITE));
+}
+
+static void
+composition_interface_init (XfburnCompositionInterface *composition, gpointer iface_data)
+{
+ composition->show_custom_controls = show_custom_controls;
+ composition->hide_custom_controls = hide_custom_controls;
+ composition->load = NULL;
+ composition->save = NULL;
+}
+
+static void
+xfburn_welcome_tab_init (XfburnWelcomeTab * obj)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (obj);
+
+ GtkWidget *vbox;
+ GtkWidget *align;
+ GtkWidget *label_welcome;
+ GtkWidget *table;
+
+ gtk_box_set_homogeneous (GTK_BOX (obj), TRUE);
+
+ align = gtk_alignment_new (0.5, 0.5, 0.5, 0.5);
+ //gtk_container_add (GTK_CONTAINER (obj), align);
+ gtk_box_pack_start (GTK_BOX (obj), align, TRUE, TRUE, BORDER);
+ gtk_widget_show (align);
+
+ vbox = gtk_vbox_new (FALSE, BORDER);
+ gtk_container_add (GTK_CONTAINER (align), vbox);
+ gtk_widget_show (vbox);
+
+ label_welcome = gtk_label_new (_("Welcome to xfburn!"));
+ gtk_box_pack_start (GTK_BOX (vbox), label_welcome, FALSE, FALSE, BORDER);
+ gtk_widget_show (label_welcome);
+
+ table = gtk_table_new (2,2,TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, BORDER);
+ gtk_table_set_row_spacings (GTK_TABLE (table), BORDER);
+ gtk_table_set_col_spacings (GTK_TABLE (table), BORDER);
+ gtk_widget_show (table);
+
+ /* buttons */
+ priv->button_image = create_welcome_button (XFBURN_STOCK_BURN_CD, _("<big>Burn _Image</big>"), _("Burn a prepared compilation, i.e. an .ISO file"));
+ gtk_table_attach_defaults (GTK_TABLE (table), priv->button_image, 0, 1, 0, 1);
+ gtk_widget_show (priv->button_image);
+ g_signal_connect (G_OBJECT(priv->button_image), "clicked", G_CALLBACK(burn_image), obj);
+
+ priv->button_data_comp = create_welcome_button (GTK_STOCK_NEW, _("<big>New _Data Composition</big>"), _("Create a new data disc with the files of your choosing"));
+ gtk_table_attach_defaults (GTK_TABLE (table), priv->button_data_comp, 1, 2, 0, 1);
+ gtk_widget_show (priv->button_data_comp);
+ g_signal_connect (G_OBJECT(priv->button_data_comp), "clicked", G_CALLBACK(new_data_composition), obj);
+
+ priv->button_blank = create_welcome_button (XFBURN_STOCK_BLANK_CDRW, _("<big>_Blank Disc</big>"), _("Prepare the rewriteable disc for a new burn"));
+ gtk_table_attach_defaults (GTK_TABLE (table), priv->button_blank, 0, 1, 1, 2);
+ gtk_widget_show (priv->button_blank);
+ g_signal_connect (G_OBJECT(priv->button_blank), "clicked", G_CALLBACK(blank_disc), obj);
+}
+
+static void
+xfburn_welcome_tab_finalize (GObject * object)
+{
+ //XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (object);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+xfburn_welcome_tab_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_MAIN_WINDOW:
+ g_value_set_object (value, priv->mainwin);
+ break;
+ case PROP_NOTEBOOK:
+ g_value_set_object (value, priv->notebook);
+ break;
+ case PROP_ACTION_GROUP:
+ g_value_set_object (value, priv->action_group);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+xfburn_welcome_tab_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_MAIN_WINDOW:
+ priv->mainwin = g_value_get_object (value);
+ break;
+ case PROP_NOTEBOOK:
+ priv->notebook = g_value_get_object (value);
+ break;
+ case PROP_ACTION_GROUP:
+ priv->action_group = g_value_get_object (value);
+ update_buttons_from_action_group (priv);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/* */
+/* internals */
+/* */
+
+/* create_welcome_button was based on xfce_create_mixed_button */
+static GtkWidget*
+create_welcome_button (const gchar *stock, const gchar *text, const gchar *secondary)
+{
+ GtkWidget *button, *align, *image, *hbox, *label, *vbox;
+
+ button = gtk_button_new ();
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup_with_mnemonic (GTK_LABEL (label), text);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+
+ image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_DIALOG);
+ hbox = gtk_hbox_new (FALSE, 20);
+ vbox = gtk_vbox_new (FALSE, 2);
+
+ align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ label = gtk_label_new (NULL);
+ gtk_label_set_text (GTK_LABEL (label), secondary);
+ gtk_box_pack_end (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (button), align);
+ gtk_container_add (GTK_CONTAINER (align), hbox);
+ gtk_widget_show_all (align);
+
+ return button;
+}
+
+static void
+update_buttons_from_action_group (XfburnWelcomeTabPrivate *priv)
+{
+ GtkAction *action;
+
+ action = gtk_action_group_get_action (priv->action_group, "burn-image");
+ gtk_widget_set_sensitive (priv->button_image, gtk_action_is_sensitive (action));
+
+ action = gtk_action_group_get_action (priv->action_group, "new-composition");
+ gtk_widget_set_sensitive (priv->button_data_comp, gtk_action_is_sensitive (action));
+
+ action = gtk_action_group_get_action (priv->action_group, "blank-disc");
+ gtk_widget_set_sensitive (priv->button_blank, gtk_action_is_sensitive (action));
+}
+
+static void
+show_custom_controls (XfburnComposition *composition)
+{
+ DBG ("show");
+}
+
+static void
+hide_custom_controls (XfburnComposition *composition)
+{
+ DBG ("hide");
+}
+
+static void
+burn_image (GtkButton *button, XfburnWelcomeTab *tab)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (tab);
+ GtkWidget *dialog;
+
+ dialog = xfburn_burn_image_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (priv->mainwin));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+blank_disc (GtkButton *button, XfburnWelcomeTab *tab)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (tab);
+ GtkWidget *dialog;
+
+ dialog = xfburn_blank_dialog_new ();
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (priv->mainwin));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+new_data_composition (GtkButton *button, XfburnWelcomeTab *tab)
+{
+ XfburnWelcomeTabPrivate *priv = XFBURN_WELCOME_TAB_GET_PRIVATE (tab);
+
+ xfburn_compositions_notebook_add_composition (XFBURN_COMPOSITIONS_NOTEBOOK (priv->notebook), XFBURN_DATA_COMPOSITION);
+}
+
+/* */
+/* public */
+/* */
+
+GtkWidget *
+xfburn_welcome_tab_new (XfburnMainWindow *window, XfburnCompositionsNotebook *notebook)
+{
+ GtkWidget *obj;
+
+ obj = g_object_new (XFBURN_TYPE_WELCOME_TAB,
+ "main-window", window,
+ "notebook", notebook,
+ NULL);
+
+ return obj;
+}
Deleted: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h
Copied: xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h (from rev 5093, xfburn/trunk/xfburn/xfburn-welcome-tab.h)
===================================================================
--- xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h (rev 0)
+++ xfburn/tags/xfburn-0.3.2/xfburn/xfburn-welcome-tab.h 2008-07-15 15:05:01 UTC (rev 5095)
@@ -0,0 +1,54 @@
+/* $Id: xfburn-welcome-tab.h 4352 2008-04-24 16:02:53Z dmohr $ */
+/*
+ * Copyright (c) 2005-2006 Jean-François Wauthy (pollux at xfce.org)
+ * Copyright (c) 2008 David Mohr (david at mcbf.net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XFBURN_WELCOME_TAB_H__
+#define __XFBURN_WELCOME_TAB_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* !HAVE_CONFIG_H */
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define XFBURN_TYPE_WELCOME_TAB (xfburn_welcome_tab_get_type ())
+#define XFBURN_WELCOME_TAB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFBURN_TYPE_WELCOME_TAB, XfburnWelcomeTab))
+#define XFBURN_WELCOME_TAB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XFBURN_TYPE_WELCOME_TAB, XfburnWelcomeTabClass))
+#define XFBURN_IS_WELCOME_TAB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFBURN_TYPE_WELCOME_TAB))
+#define XFBURN_IS_WELCOME_TAB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_WELCOME_TAB))
+#define XFBURN_WELCOME_TAB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_WELCOME_TAB, XfburnWelcomeTabClass))
+
+typedef struct
+{
+ GtkVBox parent;
+} XfburnWelcomeTab;
+
+typedef struct
+{
+ GtkVBoxClass parent_class;
+} XfburnWelcomeTabClass;
+
+GtkType xfburn_welcome_tab_get_type ();
+GtkWidget *xfburn_welcome_tab_new ();
+
+G_END_DECLS
+
+#endif /* XFBURN_WELCOME_TAB_H */
More information about the Goodies-commits
mailing list