diff --git a/ChangeLog b/ChangeLog index e8c5badc9..bd44f1fec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,1030 +1,1030 @@ 18.04.0 ======= Changes: * Add Foreground color for DiskInfoView's infokey and infovalue (BUG: 389428) * Add UpdateLater event for ViewColumnAdjuster (BUG: 387054) * Add 10px for WelcomeWidget's infoText width (BUG: 387020) * Change default save path to $HOME/Videos or fallback $HOME (BUG: 385367) * Workaround for parsing mkisofs progress when perStr is not digit (BUG: 384750) Bugfixes: * Fix build with KIO < 5.33, A patch by Wolfgang Bauer! * Fix pixmap scaling on HiDPI screens, A patch by Andrew Crouthamel! * Fix heap-use-after-free issue for ThemeManager (BUG: 390878) * Fix potential null passed to a callee that requires a non-null argument (BUG: 387298) * Fix unnecessary spaces at the end of files names (BUG: 387087) * Fix Memory-leak issue detected by clang analyzer long time ago (BUG: 386983) * K3b FFMpeg Decoder Plugin Enhanced, A patch by Mikołaj Płomieński! (BUG: 386105) 17.11.0 ======= Changes: * Hide Show progress OSD by default (BUG: 382347) * There is no IsoOptions for AudioDoc, so it could NOT create iso image like DataDoc (BUG: 260828) * Add readCheckSystemConfig before checkSystem to fix "do not show again" from system configuration problems dialog is not remembered issue, A great patch by Wolfgang Bauer! (BUG: 381368) * Consider to install the libburn and cdrskin packages (BUG: 382754) * Add cancel button for Settings window (BUG: 382775) * Implement enable "apply" button only when some setting is changed (BUG: 382776) * Use vartmp instead of tmp to save temporary files, A patch by Fedora engineer! (BUG: 384117) * Implement preventing from going into suspend/hibernate by system (BUG: 280134) * Hide Do not show again CheckBox for forceCheck (BUG: 384743) Bugfixes: * Fix missing icon in alt+tab menu and dash for GNOME (BUG: 382122) * Fix Delete audio file from audio cd and mixed mode cd projects sometimes causes crash (BUG: 382468) * Fix JobProgressDialog set duplicated percentage for MainWindow (BUG: 382488) * Fix impossible to save an ISO file to an empty folder on GNOME issue, A patch by Ernestas Kulik! (BUG: 382506) * Fix wrong comparison if there are no descriptors, A patch by Thomas Schmitt! (BUG: 382941) * Fix cannot create DVD video image issue (BUG: 383011) * Fix Blu-ray media sizes in fill widget are incorrect issue, A patch by Henryk Hecht! (BUG: 383211) * Fix "X" button from burning progress window does not work issue (BUG: 383236) * Teach K3B learned to handle BD, A patch by Thomas Schmitt! (BUG: 381074) * Fix text ilegible in darker themes/colour scheme issue (BUG: 383819) * Fix Media type selection for Image burning is partly wrong, comments are very wrong (BUG: 384471) * Fix potential copy-paste issue, switch stmt missing break issue, maybe deteced by coverity, patch by dcb314@hotmail.com! (BUG: 385674, 385676, 385677) 17.08.0 ======= Bugfixes: * Fix crashes when close an audio cd project (BUG: 381863) 17.07.0 ======= Changes: * Keep transcode until a replacement is implemented (BUG: 381131) Bugfixes: * It doesn't need to warn if filesGreaterThan2Gb for new Linux system (BUG: 380067) * Fixed Rip fails to start when using clone mode and target exsists (BUG: 379849) * Added MediaType for GrowisofsHandler (BUG: 380064) * Fixed unnecessary spaces to file names of tracks extracted from audio cd (BUG: 380322) * Set desktop file name explicitely (BUG: 380909) 17.04.0 ======= Changes: * Deprecated transcode - tried to PR but unmaintained by upstream (BUG: 360170) Bugfixes: * Fixed compilation on newer ffmpeg/libav - test 57.56.100 (REVIEW: 122569) * Fixed invalid QUrl when burning iso - imageFilesize QUrl and QString filePath wrong convertion issue (BUG: 365089) * Fixed multisession issue - but *NO* Blu-Ray test environment (BUG: 367639) * Fixed crashed when adding a directory to a project - forget to check newName.isEmpty (BUG: 349160) * Fixed can't burn BD50 ISO image - seems not to be a usable image (BUG: 344392) * Fixed from2Byte *NO* checking nullptr issue (BUG: 328529) 2.1 ==== Changes: * Revamped project size indicator widget - it now fits better into a widget style * Using KDE Plasma's global progress bar replacing K3b's own progress OSD (205843) * Usability: reduced number of message boxes interrupting user actions (196604) * Moved configuration of devices and programs permissions from SystemSettings to K3b's own settings window (220040) Bugfixes: * Added dynamic hiding of irrelevant actions in mixed project (142954) * Added sorting in data project view (191660) * Improved performance of adding/removing large number of files to a data project (226029) * Fixed crashes when editing mixed project (266942, 265775) * Usability: Inform the user if the inserted medium is not suitable (259761) 2.0.3 ===== Bugfixes: * Missing "Extract Digital Audio with K3b" in device notifier for Audio CD medium (265819) * Clearing up track info in audio project when CDDB query failed * Improper track number in CDDB track edit window title (276681) * Crash on detecting writing speeds (272427) * Incorrect capacity returned by HL-DT-ST BH10LS30. Patch by Stephane Berthelot, thanks! (268307) * Compilation fails with new FFMPEG (274817) 2.0.2 ===== Changes: - * Added K3B_ENABLE_HAL_SUPPORT option to the build configuration. It allows to disable any direct calls to HAL (253388) + * Added K3B_ENABLE_HAL_SUPPORT option to the build configuration. It allows one to disable any direct calls to HAL (253388) * Using Oxygen sounds for events (242395) Bugfixes: * Crash on start when checking device capabilities (246822) * Search paths on "Programs" options are not saved (248648) * Crash on generation of DVD previews in DVD ripping list (249941, 253639) * Crash on closing dialog after succesful audio CD ripping (241630) * Crash on device detection (249371) * Crash when showing settings window (238819) * Fixed playlist sort order (249395) * Show K3b also in "System" category in KDE launch menus (250749) * Crash when multiple instances start at the same time (253794) * Crash after track splitting (261188) * Inline editing of tracks in CD ripping view no longer works (250600) 2.0.1 ===== Bugfixes: * Freeze on ripping Audio CD using external encoder to MP3 or FLAC (236466) * Drag and drop from Dolphin doesn't work (242745) * Symbolic links are not added to a project when a folder is added recursively (243555) * Install app icons to hicolor so that they are visible in non KDE WMs (https://bugzilla.novell.com/show_bug.cgi?id=619731) * Translation fixes * Overburn doesn't work (241534) * Data part of mixed CD is not written - searching for previous session doesn't work (246798) * Fixed the speed comparision and formatting when cdrecord changes the writing speed automatically (246262, 243482) * Track pointer seg fault (247588) 2.0 === Changes (since 1.0.5): * Port to KDE Platform 4 * Always allow manual writing speed selection. * Use proper toolbars instead of the toolboxes -> nicer layouting with different styles * Merged CD and DVD copy dialogs * Merged CD and DVD image burning dialogs * Merged CD-RW erasing and DVD formatting dialogs * Merged Data CD and Data DVD projects into one plain data project with Blu-ray support * Merged eMovix CD and eMovix DVD projects * Removed CD copy option "prefere CD-Text". K3b will now ask individually (there is no need to do this if no mounting is involved.) * Allow importing of arbitrary sessions into a data project, thus continuing other than the last session. * "Clear" project" now only clears the added data but leaves the settings as they were (bug 147838) * Support files bigger than 4GB via mkisofs 2.01.01a32 and above * Do only reload the medium for verification if necessary (depends on the writer) * Support for Blu-ray writing * Support for DVD and Blu-ray writing via cdrecord * New audio ripping pattern %e which is replaced by the file extension * Better support for RTL languages 2.0-rc4 (1.93) ============== Changes: * Moved K3b Handbook to http://userbase.kde.org/K3b * Improved checking/unchecking items using Space key. Previously to do that the current item had to be in first column. Bugfixes: * Cannot choose between cdrecord when both cdrecord and wodim are installed (239861) * Crash when files have been removed right before burning the project (240398) * Crash when moving a file into a directory with Shift key pressed (239075) * Invalid parameter to cdrecord for non-integer burning speed (240310) * Crash when burning CD Audio project with tracks from another CD (240450) * Crash when turning off the drive (235743) * Crash when importing previous session (235734) * Various crashes during manipulation of eMovix project view * Hang before verification (156684) * Crash when "Waiting for medium" dialog is closed (232148) 2.0-rc3 (1.92) ============== Bugfixes: * In some cases medium doesn't get accepted for multisession burning (230742) * Data files in VCD ripping view are not listed * Show "Modify Permissions" button in System Problem Dialog only when it makes sense (230706) * Crash after "Cancel" was clicked while adding audio files to AudioCD project (231348) * Error window at the start when a place on the left pane is not accessible (230194) * Incorrect minimum size of welcome widget (231939) * Hangs while ripping AudioCD with data tracks (231174) * Crash when auto-removing non-existing files from a project before the burning (236005) * Empty Blu-ray medium not detected properly (236069) * eMovix project cannot be burned (236823) * M3U playlist not read properly (237654) * K3b overwrites iso ignoring user choice on dvd copy with option "only create image" checked (185251) * Compilation fails with FFmpeg version SVN-r23001 (236036) * Crash when waiting for reload the medium 2.0-rc2 (1.91) ============== Bugfixes: * Added missing translation files for libk3b, libk3bdevice and K3bSetup 2.0-rc1 (1.90) ============== Changes: * K3bSetup ported to KAuth framework Bugfixes: * Crash on start of Audio Ripping Dialog (226595) * Incorrect ordering of files added to Audio Project (224649) * Too wide Image Burn Dialog when file path was long (225735) * Crash when creating image files for AudioCD project (219500) * Crash when manipulating VCD project items (227855) * Mixed-up metadata in files created with external encoder (227927) * Cannot edit time values in "Split Audio Track" and "Edit Audio Track" dialogs (229042) * Empty Blu-ray medium not detected properly (227339, 229039) * Crash during splitting/editing audio tracks * Entry fields doesn't work in burn window when "Only Create Image" option is checked (220970) * Layout issues in settings window (227733) 2.0-beta1 (1.70) ================ Changes: * Added Blu-ray support * Added "Options" button to file browser toolbar with view options menu (e.g. "Show Hidden Files") (196992) * Image and project files can be opened directly from K3b file browser * Using Oxygen icons (many thanks for Oxygen Team!) Bugfixes: * Fixed visual glitch when panes are in "locked" state. Patch by Craig Drummond * Fixed hang up when "Create Image" option is checked (217301) * "Hide main window while writing" option is working again * "Show OSD progress" option is working again * Improved message when ISO with incorrect size is detected (216812) * Improved consistency: K3b now uses system-wide Positive/Neutral/Negative colors where possible instead of hard-coded green/yellow/red * Fixed incorrect default value "4gb." in "Custom Size" dialog (215539) * Fixed usability issues with project size menu: "Custom..." and "From Medium..." menu entries are non-checkable now (215539) * Show correct message at the end of CD-RW erasing (207972) * Fixed issue with too small configuration dialog for external encoder (218613) * Track number is now stored in ripped MP3 files when using lame (218614) * "Defaults" button in encoder configuration dialogs are working now * Fixed usability problems of audio project list * Fixed linking error on Windows * Fixed crash during verification process (219962) * Fixed crash in external encoder plug-in * Brought back SOX encoder configuration dialog * Fixed checking free space in temporary folder * Fixed videodvd:/ KIO slave * Fixed hang-up for mixed projects after reloading medium for verification * Converting audio tracks from audio project is working again * Fixed burning bootable discs * Custom widgets are now properly rendered for Right-to-Left languages * Progress bar in image writing dialog is shown again * Fixed crash while analysing invalid medium (223362) * Acquire lock also on storage interface. This prevents HAL from polling medium during burning which might disrupt burning process. * Fixed bug in external programs detection (221638) * Improved usability: don't show popups when clicking on DVD, VCD or audio discs. Added appriopriate actions on toolbars instead. * Fixed crash while analysing invalid medium (195436) 2.0-alpha4 (1.69) ================= Changes: * Added close buttons on project tabs (159751) * Added support for new libmpcdec API (214149) Bugfixes: * Crash at the beginning of burning (204333) * Crash during DVD ripping (207958) * Crash right after burn (195436) * Crash during Audio CD ripping (198015) * Crash at the beginning of ripping Audio CD with data tracks (186555) * Crash at the beginning of burning cue/bin image (190775) * Fixed various typos in UI (208401, 209512) * Fixed potential aliasing issues (210890) * Show only one entry on the task list even when dialog window is opened (211680) * Show correct size when project contains invalid links (212609) * Show correct elapsed time when burning over midnight (211604) * Added timeout when checking version number and features of executable (212582) * Fixed visually endless busy status when opening an empty folder (113649) * Burning double-layer DVDs should be possible again (214115) 1.0.5 ===== * Fix CD Copy device selection (Bug 151924) * Fixed HAL mounting (thanks to Ken Milmore) * Always wait for the drive to become ready before starting verification. 1.0.4 ===== * Never use growisofs parameter -dvd-compat with DVD-RW media in restricted overwrite mode * Unmount medium before DVD formatting * Silently (without introducing new strings for translation) allow the burning of files bigger than 4 GB with appropriate versions of genisoimage or mkisofs. * Do only reload the medium before verification if necessary, i.e. if the newly written track cannot be read otherwise (many old drives depend on this). Hopefully this will at least work around the aweful "DMA disabled" bug for many users. 1.0.3 ===== * Reverted to old behaviour of reloading medium before verification. Not enough testing had been done before introducing this and some systems fail to read the medium before reload (Bugs 147297, 147328, 147420, 147698). * Do not crash when the currently playing audio project item is removed (Bug 147548). * Added desktop actions to handle empty media with K3b. * Fixed read retry when reading data tracks (Bug 147778) * K3b's dialogs now honor the global button layout setting (Bug 147799) * Do not crash on mp3 files without tags if compiled with taglib support (Bug 142651) * Do not allow one to copy a rewritable media to itself. * Fixed crash on startup with devices that return bogus GET PERFORMANCE data (Bug 147676) 1.0.2 ===== * Properly determine the capacity of complete CD-R(W) media. * Mark a data project as modified if files are renamed. * Allow adding of all actions to the welcome window (Bug 145866) * Added "NoDisplay=true" property to k3b-cue.desktop and k3b-iso.desktop * Fixed supported write speed detection on some devices * No reload before verification and between writing sessions (CD copy + Mixed Mode CD) anymore 1.0.1 ===== * Fixed crash when using the Device menu without a selected device. * Fixed DVD copy when reading from a DVD+RW. * Fixed --without-alsa configure check * Fixed a crash in Video DVD ripping when the title does not contain an audio stream * Only use the mkisofs parameters -biblio, -copyright, and -abstract if they have been set. Using them with invalid values (empty) seems to result in broken iso images sometimes. 1.0 === * K3b now includes a VideoDVD kio slave. It can be used in Konqueror through the protocol videodvd:/ to copy the files from a VideoDVD with on-the-fly decryption if libdvdcss is installed. (Be aware that in some countries it is not permitted to use libdvdcss.) * New Device menu containing all the actions possible for a device (like eject, unmount, ...). This includes the possibility of assigning shortcuts to these kind of actions. * K3b now warns if user parameters for external programs have been specified. This has been introduced because there were some bug report that were caused by faulty user parameters. * Cleaned up all the job classes: No job creates a widget anymore. This allows for non-GUI usage of libk3b. For example in a kioslave. * New option in the data project to not cache the inodes. That means it is possible to have multiple actual copies of the same file on one CD/DVD. * K3b now tries to disable stuff that might influence the burning process. This includes the KDED module mediamanager, SuSEPlugger, and automounting (currently supported: subfs, supermount). * New Audio Track source editor dialog to cut audio track sources at the beginning and the end. * Splitted "read retries" and "ignore read errors" for data and audio sectors in cd copy and set new defaults for audio sectors which make more sense: 5 retires and skip unreadable sectors. * New Mediamanager which makes K3b always know which device contains which medium. This makes medium handling more smooth and the user now selects a medium instead of a device. Other advantages: - No waiting time anymore when asking for information on media (including for example Audio CD ripping). - Nice default image filenames. - CD Copy: Enable/disable options based on the source medium - Automatically select newly inserted media as burning medium * DCOP call directBurn() now returns a boolean value stating if the process could be started. * New DCOP calls cddaRip(), videocdrip(), and videodvdrip() with media:/ url support. * K3b can now handle media:/ urls from the command line to specify devices * Better Lame settings dialog. Easier to use for the novice user and better defaults. * Nicer Ogg Vorbis encoder settings dialog. * K3b now shows the DVD Medium ID in the disk information view. * K3b now displays a rough estimate on the remaining time for the current job. * New automatic media size mode for the projects. This means K3b uses the size from an inserted medium for the project maximum size. * Make a suggestion for the filename when saving a project based on the Volume ID (data projects) or the CD-Text title (Audio CD) * The Audio encoder plugins are now able to provide (very simplistic) user feedback in case of an error. * New settings "Swap byte order" and "Write Wave header" in the audio encoding plugin using external apps. This makes way for the usage of such programs as mppenc to encode Musepack files. In fact, mppenc is set up as a default along with flac if installed. * New DCOP interface: K3bJobInterface which provides DCOP signals for the currently running job. It may, for example, be used to provide information to a Karamba module. * New KFile plugin for K3b projects. For now it only shows the type of the project (Data DVD or Audio CD or ...) but may be extended to show arbitrary information. * K3b now chooses default image names based on the project name or the volumeid/cdtext title in case of CD/DVD copy. * The K3b Project DCOP Interface now uses the QString type for url parameters instead of KURL. * Save/load audio cd track sources in audio projects * Display a beautified volume id. For example: THE_TRANSPORTER -> The Transporter * Check if the image directory exists before starting to create a project image * Possibility to hide the OSD temporarily for one process. * Completely rewritten Video DVD ripping and transcoding support: - Simple on-the-fly transcoding of Video DVD titles - Interface similar to Audio CD ripping - Preview images in the ripping window - Automatic clipping - Simple resizing with automatic aspect ratio handling * File System presets for all data projects including all the advanced options. * Completely rewritten data project verification - K3b now compares the written image instead of the single files - Verification of Video DVD projects * Little GUI changes: - Changed the dialog layout in the action dialogs. - Simplified the layout of the burn dialogs for data projects (more advanced settings hidden) - Improved theme support (transparent themes) * Device buffer status display for DVD burning with growisofs >= 7.0 * Support for Audio CD ripping with libcdio instead of libcdparanoia * Support for Cdrkit, the Debian fork of cdrtools 0.12.17 ======= * Fixed saving/loading of the file view configuration. * Improved ffmpeg autoconf check. * More FreeBSD Compile fixes (thanks to Heiner Eichmann). * Fixed symbolic link handling in data projects (a bug introduced in 0.12.16) * Use UTF-8 encoding to store and load local CDDB entries. * Never use growisofs parameter -dvd-compat with DVD+RW media. * Fixed flac audio encoding for the audio project conversion feature. 0.12.16 ======= * FreeBSD Compile fixes (thanks to Heiner Eichmann). * Always force 44.1khz in the Lame MP3 encoder plugin. * Fixed VideoDVD creation on rewritable media. * NetBSD support (thanks to Mark Davies). * Fixed Copy of Enhanced Audio CDs with CD-Text * Changed default boot cataloge name from "boot.cataloge" to "boot.catalog" * Fixed a crash when reusing the same DVD Iso Image writing dialog. * Ignore case when comparing MD5 sums entered by the user. * Make sure that filenames in a data project's folder are unique. * Allow index statements bigger than 99 minutes in cue files. * Properly set the length of SCSI commands (this fixes some device detection problems). 0.12.15 ======= * Write more metadata tags in the default setup of the external encoder plugin. * Fixed on-the-fly Video DVD creation * Fixed data project verification in case filenames had to be shortened due to Joliet limitations. * Use -dvd-compat parameter to close DVDs in on-the-fly mode. * Fixed libdvdcss handling (again), no crashes anymore. * Fixed the "invalid url" bug. * Use SG IO for scsi commands with newer linux kernels. This should fix problems with scsi device detection. * Warn about shortened filenames due to Joliet restrictions before starting the burning process. 0.12.14 ======= * Make sure new projects are not already marked as modified. * Fixed (hopefully) the last bug related to Data project verification. 0.12.13 ======= * Honor umask when creating directories for Audio CD ripping. * Only update the buffer state for DVD burning if it really changes. * Fixed a crash in verification if the CD/DVD does not contain RR extensions. * Lowered default DVD writing buffer size to 32 MB to avoid "memorylock limit" problems as described on http://fy.chalmers.se/~appro/linux/DVD+RW/tools/ * Fixed loading of libdvdcss. 0.12.12 ======= * Fixed another bug in the iso options code which sometimes resulted in a failed verification. * Properly close the reading device when copying VideoDVDs. This bug resulted in a blocked device. * Fixed handling of filenames in libdvdcss backend (this fixes VideoDVD copy). 0.12.11 ======= * Fixed selection in the audio CD ripping window. * Fixed info block handling in WAVE audio file decoder: no more clicks at the end. * Introduced a hack which fixes the "Wav detected as Mpeg file" bug. * Fixed Auto multisession mode for DVD+RW and DVD-RW in restricted overwrite mode in case a previous session was imported. * Fixed a crash with HAL >= 0.5 when exiting K3b. * Allow copying of double layer DVDs with a size below 4.3 GB to single layer media. * Support for the ring buffer in growisofs 6.0. * Use .iso extension for images instead of .img * Properly remove the image file in case verification failed. * Ignore mounting state of a medium when showing its contents. * Fixed a bug in the iso options code which sometimes resulted in a failed verification. * Properly handle cue files withan image file name like image.bin.cue + image.bin * Write a proper Xing header when encoding VBR mp3 files. 0.12.10 ======= * Fixed Auto multisession mode in DVD projects * Fixed crash in dcop call directBurn in case no valid burner device was set. * Fixed verification of datacd projects when using the MaxIso9660 option without the OmitVersionNumber option 0.12.9 ====== * New project dcop calls: directBurn() - directly starts the burn process without user interaction setBurnDevice(QString) - set the burn device to be used * Disable the cd-text fields if cd-text writing is disabled. * New Alsa audio output plugin. * If a DVD project does not fill up the DVD completely do not close the DVD in automatic multisession mode. * Fixed problems with filenames ending in backslashes. * Fixed verification problems with localized characters. * Added error handling for incorrectly encoded filenames. * Automatically use a newly installed version of an external application at the next K3b start. * Complete new set of K3b action icons for project types and tools. Many thanks to Marcel Dierkes. * Show text on the burn button to make it catch the eye. * Support for media:// urls in the Image writing dialogs. * Fixed problems with files bigger than 2 GB on some systems. 0.12.8 ====== * Load index0 value in audio project. * Ignore case in cue files. * The "eject media" setting was not used properly in some situations (thanks to simon@munton.demon.co.uk for the patch) * Fixed a bug in the mp3 decoder which caused it to miss some perfectly valid mp3 files. 0.12.7 ====== * Fixed crash when refreshing the device list. * Fixed cancellation of adding files to a data project. * Fixed on-the-fly data project burning. * Backported a warning about following links to folders (K3b cannot do that after the link has been added to the project). 0.12.6 ====== * Copy XA Form1 tracks always in TAO writing mode. * Support for media:/ urls. * No extra whitespace when renaming audio files in a data project anymore. * Fixed verification of multisession CDs (thanks to simon@munton.demon.co.uk) * Preserve directory access time in data projects when using the "backup" option. * Disable the "audio normalization" option in case the normalize program is not installed. 0.12.5 ====== * Fixed the progressbar in the file view * It is possible to add the "New Data DVD Project" button to the welcome window again. * Fixed problems with unreadable items when using a non-standard color scheme * Properly set the permissions on cdrecord versions >= 2.01.01a02 * Fixed the "Disabled start button in Copy dialog" bug. * Little window layout fix in K3bSetup2. * Always use sector size 2048 when only creating an image in CD Copy. This means extracted iso images from CDs with non-Mode1 tracks are useable again. * Preserve directory permissions and user/group id in data projects when using the "backup" option. 0.12.4 ====== * Fixed --cdimage and --dvdimage parameters. * Fixed the file browser menu. Now it contains the bookmarks and "add to project" actions again. * Fixed Index 0 (Pregap) handling in audio cue files. * Improved handling of broken cue files: K3b now searches the directory for image files that could fit the cue file in case the FILE entry is bogus. * Always try to create a new session in case the old one has been imported regardless of the inserted medium's free space. * Fixed DVD-RW Restricted Overwrite media handling * Use RAW writing mode for audio CDs in case the writer does not support DAO but RAW. * Fixed compile problems with latest ffmpeg builds. 0.12.3 ====== * Ignore dock config from K3b versions older than 0.12 * Do not delete DVD project iso image if "remove image" is unchecked. * Properly load multisession default settings. * Update device selection boxes when devices are added or removed via HAL. * Properly cancel DVD project writing. * Fixed DVD+RW session import 0.12.2 ====== * After for example copying a CD when the dialog comes up again keep the last settings. * Default to incremental sequential writing mode when copying a DVD to a DVD-R. * Fixed a crash when the DVD copy dialog is reused. * Fixed inline editing in the audio CD view (without bigger changes this only works with a rather strange selection mode.) * Show the configured splash screen image instead of the default. * Fixed eMovix 0.9 default settings handling. * Import session: disable RockRidge if the previous session does not contain RR extensions. This fixes the problem with strange filenames if the new session is mounted via RR. * Fixed the --cdimage parameter. * Changed max copies from 99 to 999. * Improved session import dialog. * Properly default to DVD size in Video DVD project. * Fixed automatic multisession handling for DVD+RW media. * Fixed handbook installation. * Fixed HAL backend: devices are properly removed now. * Ignore K3b Themes that do not follow the new filename scheme. 0.12.1 Fixed compilation problems with older musepack library version. Fixed compile problem with older gcc versions. Enable verification checkbox for ISO9660 images in the CD writing dialog. Do not report success even if audio project conversion failed. 0.12 Added "Mpeg Still" support to Video-CD Project FreeBSD support (thanks to Adriaan De Groot) Support for all global CD-Text fields with cdrecord. Some GUI changes: cleaned up the action dialogs, moved the burnfree option to the global settings dialog since turning it off should be a very seldomly used task. Added support for multiple copies to the projects. Added missed VCD 3.0 track interpretation option for SVCD's New Lame encoding plugin providing a proper configuration dialog. Added Bookmarks to the file browser. Fixed window layering problem with windowmanagers != kwm Added KPart plugin which converts a list of audio files into one of the supported encoder formats. Allow disabling of CD-Text reading in cd-copy to overcome problems with CD-Text on some drives. Check CD-Text crc when copying Fixed incorrect PBC order, PBC now should work on all "standalone" DVD Players Fixed waittime bug for PBC infinite timeout. Import Audio Cue files into an audio project. It is now possible to open an iso image or an audio cue file just like a project file. Create cue files for an audio CD ripped into one single file Show writer buffer state in addition to fifo buffer when writing CDs. Show device buffer state for DVD writing (does not work always yet) Fixed read and save setting in Video CD project. Big parts of the audio project have been rewritten to have a way better design: - K3b now does not create additional silence between the tracks by default the pregap is treated as part of the previous track like in all other writing applications. - Instead it's possible to add additional silence manually to a track. - Allow multible sources for one track. - Split tracks, merge tracks. - Improved track dialog. K3b now always writes a logfile in $(KDEHOME)/share/apps/k3b/lastlog.log New device configuration format which solves all issues with removable devices like USB. Copy CSS encrypted DVDs if libdvdcss is installed. Libsndfile decoder plugin. This includes support for AIFF audio files. ffmpeg decoder plugin. This includes support for wma audio files. Musepack audio decoder plugin. Use DAO writing mode for data CDs when overwrite is enabled. Added option to load the last used settings in addition to the default user settings in every action dialog. Show system device name in case the string representing two devices are equal. Fixed the docking issues. No floating dock windows anymore. :) I have no idea why I wasn't able to do this before... it was so easy after all. Plugin based Audio Output system for Audio project "preview". Dropped id3lib in favor of TagLib (great work Scott :) When the speed for an on-the-fly audio project is set to "Auto" K3b now determines the max writing speed. Do not close dialogs after the action is done (for example cd copy) Directly copy Audio tracks from an Audio CD to an Audio project. Session management Made K3b a unique application only allowing one instance. -Improved dcop interface for data projects which allows to add and remove items +Improved dcop interface for data projects which allows one to add and remove items to and from specific folders in the project. Conditional audio ripping pattern. Now what does that mean? It means that you can do stuff like: "if the track has a genre encoded use it, otherwise use 'misc'" and stuff like that. New project plugin interface. Example: the audio project cddb plugin is now a project plugin MusicBrainz support (Query audio file tags over the internet) K3b now has a "smart" automatic multisession handling in Data projects. Replaced the system tray by an OSD inspired by the one in amaroK Better symlink handling with proper size information if "follow symlinks" is activated. HAL support (turn on your USB writer while K3b is running and see it getting detected automatically) eMovix 0.9.0 support 0.11.10 Support Mp3 files starting with multiple ID3 tags. Improved ~ handling in the QuickDirSelector. Save/Load composer fields in audio projects Save/Load default DVD Copy reading device 0.11.9 Fixed data project size calculation (for good this time). 0.11.8 K3b now searches for the Debian cdrecord wrapper script and properly selects the cdrecord version to use (cdrecord.mmap or cdrecord.shm) based on the kernel version. This should fix all problems with K3bSetup on Debian. Fixed writing speed parsing with patched cdrecord Add leading zero to tracknumber meta data field when encoding audio tracks. Fixed data project size calculation if files from different devices have the same inode number. It is now possible to enter hexadecimal values in the boot image load segment fields. Fixed external program encoder plugin (this includes lame and flac encoding) 0.11.7 Check size of returned CD-TEXT data to be a multiple of the pack length. This should fix problems with CD copy. Audio Project: Do not overwrite CD-Text values loaded from the project file with the ones detected. Added --copydvd command line parameter Do only read MCN and ISRCs when copying an audio cd since scanning them takes a very long time. Fixed cdrdao 1.1.8 version handling (no ATAPI warning) Fixed crash when using the Audiometadatarenamer on Movix Projects Automatically enable UDF extensions in case the project contains files bigger then 2 gb. 0.11.6 Fixed length calculation for long FLAC files. Allow Audio CDs that violate the Red Book standard (Tracks shorter than 4 seconds) Some improvements in disk-info retrieval 0.11.5 Do not ask for overwriting directories in cloning dialog Again fixed some disk detection problems which were introduced with the previous fixes :-( Fixed a crash which occured if the last boot image was displayed in the fileview while removing it. Support for ID3 Tags in FLAC files. Support for cdrdao 1.1.8. 0.11.4 Fixed adding of hidden files (wrong naming of config entries) Use a default imagefile name for cloning if none was specified. Use the Joliet names if no Rockridge is available in session import 0.11.3 fixed features detection with some devices. fixed multisession writing on some systems (K3b used to open the device instead of leaving it to mkisofs to prevent permission problems. Sadly this does not work with all systems since it seems that K3b does not close the device early enough so cdrecord cannot open it.) 0.11.2 K3bProcess now has a clean API and a non-stupid implementation which fixes the kde 3.2 issue way better than the hotfix from 0.11.1. Fixed a crash at K3b start which happened with ROM drives that return zero length modepage 0x05 data. fixed onthefly DVD copy issues K3b now uses the internal reader for DVD copy instead of readcd added read retries and "ignore read error" options to the dvd copy dialog fixed handling of empty raw toc data fixed the bug that made K3b try to use cdrdao for DVD iso image writing. add files to a project by dropping them on the corresponding tab removed the "query cddb" option from the copy dialog since this is configured globally anyway. fixed loading of VideoDVD projects Fixed VideoDVD project with a HACK. mkisofs is not able to create a VideoDVD using graft-points which is the default in K3b. So now K3b links all VIDEO_TS files in a temp directory. 0.11.1 fixed an issue introduced with KDE 3.2rc1 which caused on-the-fly data writing to fail all the time. (If you need to know: For some reason KProcess makes the Stdin fd O_NONBLOCK. This way mkisofs is not able to write properly to cdrecord's stdin anymore.) 0.11 fixed libcdparanoia-loading on Debian (and maybe some other systems) fixed crash at end of image creation in DVD project fixed filesize display for very large files and projects (integer overflow) fixed CD-TEXT reading. On some systems some senseless characters where appended. fixed Id3lib detection in configure.in.in added primitive supermount support kernel 2.5 compile fixes (thanks to ismail (cartman) d�mez ) K3b now defaults to the generic-mmc cdrdao driver if the used burner is not listed in cdrdao's driver table. As all modern drives use the generic-mmc driver anyway this is valid and prevents from a lot of newbie problems. Added a thememanager and the new crystal look by Everaldo K3b does not mount the disk for session import or data verification anymore. This way supermount users will have no problems. merged cue/bin and isoimage burning in one dialog which provides image-type-detection supported so far: iso, cue, cdrdao toc, cdrecord clone images better systemconfigcheck messages when cdrecord is not running with root privs proper automatic writing mode and writing app selection for non-DAO-capable writers overwriting of files in a new session default CD size is now 80 min generic resampling for all audio plugins support for mono files support for 8Bit wave files FLAC decoding plugin (thanks to John Steele Scott) check if a DVD-R(W) writer supports incremental streaming before trying multisession check if a DVD-R(W) writer supports testwriting before trying a simulation fixed DVD-Copy. We needed to determine the size of the data to copy for ourselves instead of relying on the kernel Automatic CD-writing speed selection (chooses always the max for now) Technical info about audiofiles in the audio project are displayed in the track properties dialog One may now add complete dirs to an audio project Detection of Justlink support Finally the device handling is completely independant. No calls to cdrecord anymore. That's why we now have a libk3bdevice. Improved writing speed estimation for audio tracks. Added a button which determines the supported writing speeds with the mounted media. this way it is possible to also select dvd writing speeds other than 1x fixed directory sorting in iso filesystems fixed boot image file sorting Joliet long support (103 chars joliet filenames) improved meta tag handling for audio encoding, support for album title and stuff fixed crash when only creating images without an installed cd writer writing speed is loaded correctly again Completely rewritten CD copy: - Copy Audio, multisession and Mixed mode CDs. - Copy CD-TEXT - Create CD-TEXT from Cddb entries - Audio reading with cdparanoia for high quality ripping - no cdrdao anymore Support for new growisofs option to specify the size of a written image in DAO mode Added check for free space in temp dir to dvd copy Added a script to simplify the start of K3bSetup2. 0.10 DVD writing support with the DVD+RW-tools by Andy Polyakov DVD formatting DVD Copy (pure data dvd copy without any video transcoding) CD Cloning with cdrtools >= 2.01a17 device capabilities detection without cdrecord. This solves the long startup problem with ATAPI devices. moved audio ripping pattern configuration from options dialog to audio ripping dialog option to automatically erase CD-RWs and DVD-RWs without asking before writing dragging files from a data project to the audio player (basically it's just a KURLDrag so it may be dragged everywhere) K3b is now divided in three libs and the main application: libk3bcore, libk3btools, and libk3bproject this makes creating KParts-plugins easy. Two examples can be found in the tests/kpartplugins dir one of them is a former K3b option which allowed to use audio meta data to rename files while adding them to a data project. Now this is done by a plugin and a much higher degree of user interaction. Iso9660 file sorting (mkisofs -sort) libid3 support for better mp3 tag access (we had that in some very old version but back then K3b depended on it. Now it defaults to using KFileMetaInfo if it's not available) Pluggable audio decoding Pluggable audio encoding and completely rewritten audio ripping much faster now due to a much better threading Check for read permission when adding files to a project file filter in binimagewritingdialog and isoimagewritingdialog (thanx to David Maciejak) Verification of written data (compares md5 sums of all written files). K3bSetup is not longer compiled unless explicit activated (K3bSetup is outdated and K3bSetup2 is still not ready) K3b now also compiles without aRts. In this case the audioplayer will be useless (but still there) no need for special mkisofs permissons anymore. K3b now openes the device itself when importing an old session. added a little color animation when dropping files onto a directory in data projects it is always hard to tell if one dropped on the correct dir. If some one has a better animation I would be interested in replacing this simple one. Added CD-TEXT reading (used for Audio CD ripping) sox encoder plugin to encode to all audio formats supported by sox (will anyone ever use this??) encoder plugin that let's you specify a commandline to encode the data. Typical example would be calling lame to encode to mp3. much better TOC reading. K3b now displays multisession info. m3u Playlist creation for ripped audio files replaced the old K3bSetup with a quite simple KControl Module which is only able to change the needed permission for devices and external programs. Everything else is nowadays done by the distros. 0.9 support for eMovix 0.8.0rc2 better data project size calculation 0.9pre2 support for writing CD-Text with cdrecord support for writing audio and mixed-mode CDs on-the-fly with cdrecord >= 2.01a13 no gui blocking when reloading the media while writing a two-session mixed-mode cd nodma option in eMovix project fixed problems with audio decoding (the process sometimes stalled) 0.9pre1 added system notification added eMovix project added bootable cd support (multible images) K3b now allows automatic writing mode selection to be sure to always use the best writing mode (DAO, TAO) the environment PATH is searched for external bins more error handling dropped KDE/QT 3.0.x compatibility, now K3b requires at least 3.1 internals: devices rewrite, use generic packet ioctl's cdinfo rewrite, use generic packet ioctl's merged cdrdaoparser and cdrdaowriter added multisession cd copy fixed onlyCreateImage (this time for real!) added option to hide main window while writing fixed temp-dir problems with nfs-mounted home directories K3b now uses the default kde tempdir Resmgr support added user datamode selection (mode1, mode2(form1)) support for relative paths in playlists (thanx to Nick Bloke) new progressdialog faster cddb access (older versions just queried all entries, now only the selected one gets queried) K3b is now threaded. Gui beautifying. Video CD: add playback control (PBC) add customizing of Gaps and Margins add HQ-VIDEOCD support add relaxed APS support (this controls whether APS constraints are strict or relaxed) add category restriction support add an option to create always an empty `/SEGMENT' directory (some Players need this) fixed load and saveUserDefaults fixed autodetection VCD Typ (now the user can turn off this feature) added audio volume normalization added udf support to data project user commands for external programs are separated by space now since the comma just made problems for options like "--driver generic-mmc" which had to be specified as "--driver, generic-mmc" support for newer versions of cdrecord which have a slighly changed user interface support for cuefile writing with cdrecord > 2.01a14 0.8.1 fixed compiling problems with kernel < 2.4.3 fixed onlyCreateImage in data project fixed handling of cdrecord burnfree/burnproof driveroption in versions < 1.10 fixed error with localized docking config that caused empty windows when changing the language introduced workaround for serious cdrdao bug that caused tocfiles to be deleted disabled the delete shortcut in the fileview (way too many users deleted files by accident when they wanted to remove project items) 0.8 advanced options: manually selection of writing app (cdrecord or cdrdao) changed the option dialog layout -> smaller window fixed problems with first pregap in audio project: no need to set the first pregap to 0 on some writers anymore no 4 second pregap before first tracks anymore fixed problems with detecting some audio tracks that had flags like preemp set removed cdparanoia dependancy (dynamic linking) big internal changes split bin/cue writing from iso-image-writing better cdcopy (mainly more options) customizeable audio ripping mixed mode cd creation video cd creation video cd on cd-i support better error handling indivdual selection of final size for encoded movie clean vob dir before start and restore it (i.e playing wiht PowerDVD stores config files in the directory) AC3-passthrough mode for DIVX Encoding DND for AudioCD-Ripping to harddisc. 0.7.5 Added session import little reordering of menus fixed the "cdrecord error 255" bug fixed some i18n issues improved mp3 file detection added K3b project mimetype added konqueror servicemenu entries now KoStore is used for saving documents K3bSetup is started with the correct language now MD5 sum is only calculated on demand (but still asynchronous) fixed K3bSetup linking problems 0.7.4 fixed bug that caused stupid mountpoints to be assigned to the devices Mounting dvd with UDF filesystem (uppercase words) should now work (copy ifo-files). beautified cddb setup internal cddb change (rewrite) fixed problems when writing mp3 and ogg vorbis files together burnproof support for cdrecord <= 1.11a02 works again (and also for the new cdrecord ;) Fix audiolanguange parsing for transcode 0.6.2 (wrong entries in k3bDVDRip.xml) Bugfix Selecting ripping dir with file dialog and new directory now shows the available space properly. Bugfix Cancel one pass in encoding now works If select "Add to project" in the context menu of the file/dir tree a dialog (audio/data) asks for creating a new data or audio project. 0.7.3 fixed compile problems with gcc 3.x 0.7.2 added md5sum to iso-image dialog fixed compile problem when ogg-vorbis is not installed fixed iso-image volume descriptor problem that caused all descriptors to be enclosed in quotation marks added raw-copy option better external program handling 0.7.1 audio: fixed mp3 resampling problems better handling of newly added tracks data: proper symlink handling better support of the mkisofs options option for adding hidden files backup permissions device: support for symlinks in fstab misc: progress display in the K3b titlebar better progress display in systray 0.7 DivX/XviD encoding enhanced cddb support new artwork from Ayo fixed some device detection problems fixed problems with long filenames and Joliet some gui enhancements added libmad to the sources removed id3lib 0.6pre2 added ogg-vorbis support added iso ids to diskInfo fixed iso project input fields 0.6pre1 well... I don't know.. everything? 0.5.1 fixed bug that caused a compile error on some systems fixed problems with audio cd writing disabled projects while writing (needed for writing in the background) 0.5.0 -fixed mkisofs 1.14 problems -audio on-the-fly burning (even corrupted mp3-files) -saving/loading of projects -atip and toc info -cd-ripping (wav) with extended pattern support -cddb support -play audio cds -extended option-dialog -hide first track on audio-cds -detection of ide-devices as cd-rom -blanking of cdrws -writing of existing iso-images -optional setting of cdrdao driver for every scsi-device -burn in the background (it's even possible to write on two writers simultaneous or write a cd and create an image (if your system is fast enough ;-)) -K3b checks for an empty disk before writing! -and like every time some other stuff i cannot remember ;-) 0.4.3 Fixed bug that caused K3b to crash while detecting devices highly improved adding of files and directories to a data project adding empty directories to data project via context menu disabled audio on-the-fly burning due to a problem that caused faulty cds 0.4.2 added new DirTree (code from Konqueror) added new device-management (the scsi-bus is checked directly) detection of Burn-Proof-capable drives some bugfixes 0.4.1 added whitespace-treatment dock-positions are saved 0.4.0 Added ISO-cd support file-tree creation via drag'n'drop renaming of files support of most of the mkisofs-features improved audiotrack dialog use of ID3Lib ... and other things i really cannot remember... ;-) diff --git a/FAQ.txt b/FAQ.txt index 6ba757e84..3c9800b77 100644 --- a/FAQ.txt +++ b/FAQ.txt @@ -1,75 +1,75 @@ Q: Compiling K3b fails with errors like this: base_k3badvanceddataimagesettings.cpp:185: invalid use of undefined type `struct KComboBox' base_k3badvanceddataimagesettings.h:17: forward declaration of `struct KComboBox' A: The QTDesigner tool 'uic' is not able to find the kde widget plugins. To solve this run 'qtconfig' and add '$KDEDIR/lib/kde3/plugins' to the plugin search path (replace $KDEDIR with your kde base dir). Q: Where has all the fancy graphic gone? A: Most likely you installed K3b in the wrong directory. All KDE programs are installed in the KDE dirtree (SuSE: /opt/kde3, RedHat: /usr). If you compile K3b from source it defaults to either $KDEDIR or /usr/local. To install in the correct directory you need to specify the prefix to configure like this: ./configure --prefix=`kde-config --prefix` That will install K3b relative to the correct path. Q: The linking always breaks with the missing -laudio. A: You need to install NAS. Q: Where can I find K3bSetup2? A: K3bSetup2 is a KControlCenter Module. You can find it in the System Administration section or start it manually with "kdesu kcmshell4 k3bsetup2". There also is a script since K3b 0.11 called k3bsetup. Q: My writer supports writing at speed X but K3b shows Y as a max. A: K3b determined the maximum writing speed the first time you start it. Since the speed reported by the writer always depends on the mounted medium this may not be the real max. To manually change it open the K3b settings in the device section and click on the value. You will - be presented with a spinbox which allows to change the speed. + be presented with a spinbox which allows one to change the speed. Q: Writing fails with the following cdrecord message: "Cannot allocate memory. Cannot get SCSI I/O buffer." A: Since kernel 2.6.9 suid root programs are not allowed to use the SCSI subsystem. To solve this issue either configure cdrecord to run without root privileges: chmod 755 /usr/bin/cdrecord or run K3b as root (which is not recommended but works also). Q: Writing fails with the following cdrecord message over and over again: "Error trying to open /dev/hdc exclusively (Device or resource busy)..." A: You are using a patched cdrecord version which tries to open the device exclusively which fails because your are probably also using automounting. The solutions are to disable automounting altogether (and this is the recommended solution as automounting can cause other more serious problems with CD/DVD writing) or to install a non-patched cdrecord version. Q: My DVD drive supports 16X but K3B keeps burning at 1X! What's happening? A: Your kernel most likely didn't apply optimal settings for your drive when it detected it. You can find out what are the current settings of your drive with the command "hdparm -v /dev/dvd": /dev/dvd: IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 0 (off) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) The following options are known to maximize burning and playback performance: hdparm -d1 -c1 -a8 -u1 /dev/dvd To make these options permanent, a quick and dirty solution is to include the command in /etc/rc.local. Consult your distribution documentation for a tailored solution. Some drives have buggy DMA support. If you experience instability, leave these options disabled. Some useful references: http://www.togaware.com/linux/survivor/CD_DVD_Drives.shtml http://www.linuxjournal.com/article/6921 diff --git a/libk3b/tools/k3bactivepipe.cpp b/libk3b/tools/k3bactivepipe.cpp index e8da81841..d4857ce71 100644 --- a/libk3b/tools/k3bactivepipe.cpp +++ b/libk3b/tools/k3bactivepipe.cpp @@ -1,201 +1,201 @@ /* * * Copyright (C) 2006-2009 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2009 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "k3bactivepipe.h" #include #include #include class K3b::ActivePipe::Private : public QThread { public: Private( K3b::ActivePipe* pipe ) : m_pipe( pipe ), sourceIODevice(0), sinkIODevice(0), closeSinkIODevice( false ), closeSourceIODevice( false ) { } void run() override { qDebug() << "(K3b::ActivePipe) writing from" << sourceIODevice << "to" << sinkIODevice; bytesRead = bytesWritten = 0; buffer.resize( 10*2048 ); bool fail = false; qint64 r = 0; while( !fail && ( r = m_pipe->readData( buffer.data(), buffer.size() ) ) > 0 ) { bytesRead += r; ssize_t w = 0; ssize_t ww = 0; while( w < r ) { if( ( ww = m_pipe->write( buffer.data()+w, r-w ) ) > 0 ) { w += ww; bytesWritten += ww; } else { qDebug() << "write failed." << sinkIODevice->errorString(); fail = true; break; } } } if ( r < 0 ) { qDebug() << "Read failed:" << sourceIODevice->errorString(); } qDebug() << "Done:" - << ( fail ? QLatin1String( "write failed" ) : QLatin1String( "write succcess" ) ) + << ( fail ? QLatin1String( "write failed" ) : QLatin1String( "write success" ) ) << ( r != 0 ? QLatin1String( "read failed" ) : QLatin1String( "read success" ) ) << "(total bytes read/written:" << bytesRead << "/" << bytesWritten << ")"; } void _k3b_close() { qDebug(); if ( closeWhenDone ) m_pipe->close(); } private: K3b::ActivePipe* m_pipe; public: QIODevice* sourceIODevice; QIODevice* sinkIODevice; bool closeWhenDone; bool closeSinkIODevice; bool closeSourceIODevice; QByteArray buffer; quint64 bytesRead; quint64 bytesWritten; }; K3b::ActivePipe::ActivePipe() { d = new Private( this ); connect( d, SIGNAL(finished()), this, SLOT(_k3b_close()) ); } K3b::ActivePipe::~ActivePipe() { delete d; } bool K3b::ActivePipe::open( OpenMode mode ) { return QIODevice::open( mode ); } bool K3b::ActivePipe::open( bool closeWhenDone ) { if( d->isRunning() ) return false; QIODevice::open( ReadWrite|Unbuffered ); d->closeWhenDone = closeWhenDone; if( d->sourceIODevice && !d->sourceIODevice->isOpen() ) { qDebug() << "Need to open source device:" << d->sourceIODevice; if( !d->sourceIODevice->open( QIODevice::ReadOnly ) ) return false; } if( d->sinkIODevice && !d->sinkIODevice->isOpen() ) { qDebug() << "Need to open sink device:" << d->sinkIODevice; if( !d->sinkIODevice->open( QIODevice::WriteOnly ) ) return false; } qDebug() << "(K3b::ActivePipe) successfully opened pipe."; // we only do active piping if both devices are set. // Otherwise we only work as a conduit if ( d->sourceIODevice && d->sinkIODevice ) { d->start(); } return true; } void K3b::ActivePipe::close() { qDebug(); if( d->sourceIODevice && d->closeSourceIODevice ) d->sourceIODevice->close(); if( d->sinkIODevice && d->closeSinkIODevice ) d->sinkIODevice->close(); d->wait(); } void K3b::ActivePipe::readFrom( QIODevice* dev, bool close ) { d->sourceIODevice = dev; d->closeSourceIODevice = close; } void K3b::ActivePipe::writeTo( QIODevice* dev, bool close ) { d->sinkIODevice = dev; d->closeSinkIODevice = close; } qint64 K3b::ActivePipe::readData( char* data, qint64 max ) { if( d->sourceIODevice ) { return d->sourceIODevice->read( data, max ); } return -1; } qint64 K3b::ActivePipe::writeData( const char* data, qint64 max ) { if( d->sinkIODevice ) { return d->sinkIODevice->write( data, max ); } else return -1; } quint64 K3b::ActivePipe::bytesRead() const { return d->bytesRead; } quint64 K3b::ActivePipe::bytesWritten() const { return d->bytesWritten; } #include "moc_k3bactivepipe.cpp" diff --git a/src/k3bemptydiscwaiter.cpp b/src/k3bemptydiscwaiter.cpp index aa5973893..988dd219e 100644 --- a/src/k3bemptydiscwaiter.cpp +++ b/src/k3bemptydiscwaiter.cpp @@ -1,810 +1,808 @@ /* * * Copyright (C) 2003-2010 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2010 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "k3bemptydiscwaiter.h" #include "k3bmediacache.h" #include "k3bapplication.h" #include "k3bdevice.h" #include "k3bdeviceglobals.h" #include "k3bdevicehandler.h" #include "k3bglobals.h" #include "k3bcore.h" #include "k3biso9660.h" #include "k3bblankingjob.h" #include "k3bbusywidget.h" #include "k3bdvdformattingjob.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class K3b::EmptyDiscWaiter::Private { public: Private() : erasingInfoDialog(0) { dialogVisible = false; inLoop = false; mediumChanged = 0; blockMediaChange = false; } K3b::Device::Device* device; Device::MediaTypes wantedMediaType; Device::MediaStates wantedMediaState; Msf wantedMinMediaSize; Device::MediaType result; int dialogVisible; bool inLoop; bool blockMediaChange; int mediumChanged; bool canceled; bool waitingDone; QLabel* labelRequest; QLabel* labelFoundMedia; QLabel* pixLabel; QProgressDialog* erasingInfoDialog; }; K3b::EmptyDiscWaiter::EmptyDiscWaiter( K3b::Device::Device* device, QWidget* parent ) : QDialog( parent ), d( new Private() ) { setWindowTitle(i18n("Waiting for Disk")); setModal(true); d->device = device; // setup the gui // ----------------------------- d->labelRequest = new QLabel( this ); d->labelRequest->setAlignment( Qt::AlignLeft | Qt::AlignVCenter ); d->labelFoundMedia = new QLabel( this ); d->pixLabel = new QLabel( this ); d->pixLabel->setAlignment( Qt::AlignHCenter | Qt::AlignTop ); QFont f( d->labelFoundMedia->font() ); f.setBold(true); d->labelFoundMedia->setFont( f ); QDialogButtonBox* buttonBox = new QDialogButtonBox( this ); QPushButton* cancelButton = buttonBox->addButton( QDialogButtonBox::Cancel ); connect( cancelButton, SIGNAL(clicked()), this, SLOT(slotCancel()) ); QPushButton* ejectButton = new QPushButton( this ); KGuiItem::assign( ejectButton, KGuiItem( i18n("Eject"), QString::fromLatin1( "media-eject" ) ) ); buttonBox->addButton( ejectButton, QDialogButtonBox::NoRole ); connect( ejectButton, SIGNAL(clicked()), this, SLOT(slotEject()) ); QPushButton* loadButton = buttonBox->addButton( i18n("Load"), QDialogButtonBox::NoRole ); connect( loadButton, SIGNAL(clicked()), this, SLOT(slotLoad()) ); QVBoxLayout* box = new QVBoxLayout( this ); QHBoxLayout* hbox = new QHBoxLayout( this ); hbox->addWidget(d->pixLabel); QVBoxLayout* vbox = new QVBoxLayout( this ); vbox->addWidget(new QLabel(i18n("Found medium:"), this)); vbox->addWidget(d->labelFoundMedia); vbox->addWidget(d->labelRequest); hbox->addLayout( vbox ); box->addLayout( hbox ); box->addWidget(buttonBox); // ----------------------------- connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3b::Device::Device*)), this, SLOT(slotMediumChanged(K3b::Device::Device*)) ); } K3b::EmptyDiscWaiter::~EmptyDiscWaiter() { delete d; } K3b::Device::MediaType K3b::EmptyDiscWaiter::waitForDisc( Device::MediaStates mediaState, Device::MediaTypes mediaType, const K3b::Msf& minMediaSize, const QString& message ) { if ( d->inLoop ) { qCritical() << "Recursive call detected." << endl; return Device::MEDIA_UNKNOWN; } qDebug() << "Waiting for medium" << mediaState << mediaType << message; d->wantedMediaState = mediaState; d->wantedMediaType = mediaType; d->wantedMinMediaSize = minMediaSize; d->dialogVisible = false; d->canceled = false; d->waitingDone = false; d->blockMediaChange = false; d->mediumChanged = 0; // FIXME: reproducablitity race? if (message.isEmpty()) d->labelRequest->setText( Medium::mediaRequestString( d->wantedMediaType, d->wantedMediaState, minMediaSize, d->device ) ); else d->labelRequest->setText( message ); if( d->wantedMediaType & K3b::Device::MEDIA_WRITABLE_DVD ) d->pixLabel->setPixmap( KIconLoader::global()->loadIcon( "media-optical-dvd", KIconLoader::NoGroup, KIconLoader::SizeMedium ) ); else d->pixLabel->setPixmap( KIconLoader::global()->loadIcon( "media-optical-recordable", KIconLoader::NoGroup, KIconLoader::SizeMedium ) ); adjustSize(); slotMediumChanged( d->device ); // // in case we already found a medium and thus the dialog is not shown entering // the loop only causes problems (since there is no dialog yet the user could // not have canceled yet // if( !d->waitingDone ) { d->inLoop = true; enterLoop(); } return d->result; } void K3b::EmptyDiscWaiter::enterLoop() { QEventLoop eventLoop; connect(this, SIGNAL(leaveModality()), &eventLoop, SLOT(quit())); eventLoop.exec(); } int K3b::EmptyDiscWaiter::exec() { return waitForDisc(); } void K3b::EmptyDiscWaiter::slotMediumChanged( K3b::Device::Device* dev ) { qDebug() << dev->blockDeviceName(); if( d->canceled || d->device != dev ) return; // // This slot may open dialogs which enter a new event loop and that // may result in another call to this slot if a medium changes while // a dialog is open // if( d->blockMediaChange ) { d->mediumChanged++; return; } d->blockMediaChange = true; bool formatWithoutAsking = KConfigGroup( KSharedConfig::openConfig(), "General Options" ).readEntry( "auto rewritable erasing", false ); K3b::Medium medium = k3bappcore->mediaCache()->medium( dev ); d->labelFoundMedia->setText( medium.shortString( Medium::NoStringFlags ) ); if( medium.diskInfo().diskState() == K3b::Device::STATE_NO_MEDIA ) { continueWaiting(); d->blockMediaChange = false; return; } // QString mediaState; // if( medium.diskInfo().diskState() == K3b::Device::STATE_COMPLETE ) // mediaState = i18n("complete"); // else if( medium.diskInfo().diskState() == K3b::Device::STATE_INCOMPLETE ) // mediaState = i18n("appendable"); // else if( medium.diskInfo().diskState() == K3b::Device::STATE_EMPTY ) // mediaState = i18n("empty"); // if( !mediaState.isEmpty() ) // mediaState = " (" + mediaState +")"; // ///////////////////////////////////////////////////////////// // // BD-RE handling // // ///////////////////////////////////////////////////////////// if ( (d->wantedMediaType & K3b::Device::MEDIA_BD_RE) && (medium.diskInfo().mediaType() & K3b::Device::MEDIA_BD_RE) ) { qDebug() << "------ found BD-RE as wanted."; #ifdef _MSC_VER #pragma message ("WARNING: FIXME: We need to preformat empty BD-RE just like we do with empty DVD+RW") #else #warning FIXME: We need to preformat empty BD-RE just like we do with empty DVD+RW #endif if( d->wantedMediaState == K3b::Device::STATE_EMPTY && ( d->wantedMinMediaSize <= medium.diskInfo().capacity() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity() ) ) ) { // check if the media contains a filesystem K3b::Iso9660 isoF( d->device ); bool hasIso = isoF.open(); if( formatWithoutAsking || !hasIso || KMessageBox::warningContinueCancel( parentWidgetToUse(), i18n("Found %1 medium in %2 - %3. Should it be overwritten?", QLatin1String("BD-RE"), d->device->vendor(), d->device->description()), i18n("Found %1", QLatin1String("BD-RE")), KStandardGuiItem::overwrite(), KGuiItem(i18n("&Eject"), "media-eject") ) == KMessageBox::Continue ) { finishWaiting( K3b::Device::MEDIA_BD_RE ); } else { qDebug() << "starting devicehandler: no BD-RE overwrite"; K3b::eject( d->device ); continueWaiting(); } } // // We want a BD-RE not nessessarily empty. No problem, just use this one. Because incomplete and complete // are handled the same everywhere (isofs is grown). // else if ( d->wantedMediaState != Device::STATE_EMPTY && ( d->wantedMinMediaSize <= medium.actuallyRemainingSize() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity(), medium.actuallyUsedCapacity() ) ) ) { finishWaiting( K3b::Device::MEDIA_BD_RE ); } else { qDebug() << "BD-RE medium too small"; continueWaiting(); } } // ///////////////////////////////////////////////////////////// // // DVD+RW handling // // ///////////////////////////////////////////////////////////// // DVD+RW: if empty we need to preformat. Although growisofs does it before writing doing it here // allows better control and a progress bar. If it's not empty we should check if there is // already a filesystem on the medium. else if( (d->wantedMediaType & K3b::Device::MEDIA_DVD_PLUS_RW) && (medium.diskInfo().mediaType() & K3b::Device::MEDIA_DVD_PLUS_RW) ) { qDebug() << "------ found DVD+RW as wanted."; if( medium.diskInfo().diskState() == K3b::Device::STATE_EMPTY ) { if( d->wantedMediaState & K3b::Device::STATE_EMPTY && ( d->wantedMinMediaSize <= medium.diskInfo().capacity() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity() ) ) ) { // special case for the formatting job which wants to preformat on it's own! if( d->wantedMediaState & K3b::Device::STATE_COMPLETE && d->wantedMediaState & K3b::Device::STATE_EMPTY ) { qDebug() << "special case: DVD+RW for the formatting job."; finishWaiting( K3b::Device::MEDIA_DVD_PLUS_RW ); } else { // empty - preformat without asking prepareErasingDialog(); K3b::DvdFormattingJob job( this ); job.setDevice( d->device ); job.setFormattingMode( FormattingQuick ); job.setForce( false ); job.setForceNoEject( true ); d->erasingInfoDialog->reset(); d->erasingInfoDialog->setLabelText( i18n("Preformatting DVD+RW") ); d->erasingInfoDialog->setRange( 0, 100 ); connect( &job, SIGNAL(finished(bool)), this, SLOT(slotErasingFinished(bool)) ); connect( &job, SIGNAL(percent(int)), d->erasingInfoDialog, SLOT(setValue(int)) ); connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) ); job.start( medium.diskInfo() ); d->erasingInfoDialog->exec(); } } else { qDebug() << "starting devicehandler: empty DVD+RW where a non-empty was requested."; continueWaiting(); } } else { // // We have a DVD+RW medium which is already preformatted // if( d->wantedMediaState == K3b::Device::STATE_EMPTY ) { if ( d->wantedMinMediaSize <= medium.diskInfo().capacity() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity() ) ) { // check if the media contains a filesystem K3b::Iso9660 isoF( d->device ); bool hasIso = isoF.open(); if( formatWithoutAsking || !hasIso || KMessageBox::warningContinueCancel( parentWidgetToUse(), i18n("Found %1 medium in %2 - %3. " "Should it be overwritten?", QString("DVD+RW"), d->device->vendor(), d->device->description()), i18n("Found %1",QString("DVD+RW")), KStandardGuiItem::overwrite(), KGuiItem(i18n("&Eject"), "media-eject") ) == KMessageBox::Continue ) { finishWaiting( K3b::Device::MEDIA_DVD_PLUS_RW ); } else { qDebug() << "starting devicehandler: no DVD+RW overwrite"; K3b::eject( d->device ); continueWaiting(); } } else { qDebug() << "starting devicehandler: DVD+RW too small"; continueWaiting(); } } // // We want a DVD+RW not nessessarily empty. No problem, just use this one. Becasue incomplete and complete // are handled the same everywhere (isofs is grown). // else if ( d->wantedMinMediaSize <= medium.actuallyRemainingSize() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity(), medium.actuallyUsedCapacity() ) ) { finishWaiting( K3b::Device::MEDIA_DVD_PLUS_RW ); } else { qDebug() << "starting devicehandler: DVD+RW too small"; continueWaiting(); } } } // --- DVD+RW -------- // ///////////////////////////////////////////////////////////// // // DVD-RW handling // // ///////////////////////////////////////////////////////////// // // DVD-RW in sequential mode can be empty. DVD-RW in restricted overwrite mode is always complete. // else if( (d->wantedMediaType & (K3b::Device::MEDIA_DVD_RW| K3b::Device::MEDIA_DVD_RW_SEQ| K3b::Device::MEDIA_DVD_RW_OVWR) ) && (medium.diskInfo().mediaType() & (K3b::Device::MEDIA_DVD_RW| K3b::Device::MEDIA_DVD_RW_SEQ| K3b::Device::MEDIA_DVD_RW_OVWR) ) ) { qDebug() << "------ found DVD-R(W) as wanted."; // we format in the following cases: // seq. incr. and not empty and empty requested // seq. incr. and restr. overwri. reqested // restr. ovw. and seq. incr. requested // we have exactly what was requested (K3b never requests a specific // size for read-only cases, thus using remainingSize() is perfectly fine) if( (d->wantedMediaType & medium.diskInfo().mediaType()) && (d->wantedMediaState & medium.diskInfo().diskState()) && ( d->wantedMinMediaSize <= medium.actuallyRemainingSize() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity(), medium.actuallyUsedCapacity() ) ) ) { finishWaiting( medium.diskInfo().mediaType() ); } // DVD-RW in restr. overwrite may just be overwritten else if( (medium.diskInfo().mediaType() & K3b::Device::MEDIA_DVD_RW_OVWR) && (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_OVWR) ) { if( d->wantedMediaState == K3b::Device::STATE_EMPTY && ( d->wantedMinMediaSize <= medium.diskInfo().capacity() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity() ) ) ) { qDebug() << "------ DVD-RW restricted overwrite."; // check if the media contains a filesystem K3b::Iso9660 isoF( d->device ); bool hasIso = isoF.open(); if( formatWithoutAsking || !hasIso || KMessageBox::warningContinueCancel( parentWidgetToUse(), i18n("Found %1 medium in %2 - %3. " "Should it be overwritten?", K3b::Device::mediaTypeString(medium.diskInfo().mediaType()), d->device->vendor(), d->device->description()), i18n("Found %1",QString("DVD-RW")), KStandardGuiItem::overwrite(), KGuiItem(i18n("&Eject"), "media-eject")) == KMessageBox::Continue ) { finishWaiting( K3b::Device::MEDIA_DVD_RW_OVWR ); } else { qDebug() << "starting devicehandler: no DVD-RW overwrite."; K3b::eject( d->device ); continueWaiting(); } } // no need to check the size here. K3b never asks for non-empty media by size else if( !(d->wantedMediaState & K3b::Device::STATE_EMPTY ) ) { // check if the media contains a filesystem K3b::Iso9660 isoF( d->device ); bool hasIso = isoF.open(); if( hasIso ) { finishWaiting( K3b::Device::MEDIA_DVD_RW_OVWR ); } else { qDebug() << "starting devicehandler: empty DVD-RW where a non-empty was requested."; continueWaiting(); } } // // We want a DVD-RW overwrite not nessessarily empty. No problem, just use this one. Becasue incomplete and complete // are handled the same everywhere (isofs is grown). // else if ( d->wantedMinMediaSize <= medium.actuallyRemainingSize() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity(), medium.actuallyUsedCapacity() ) ) { finishWaiting( K3b::Device::MEDIA_DVD_RW_OVWR ); } else { qDebug() << "starting devicehandler: DVD-RW too small"; continueWaiting(); } } // formatting else if( ( (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_OVWR) && (medium.diskInfo().mediaType() & K3b::Device::MEDIA_DVD_RW_SEQ) && !(d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_SEQ) ) || ( (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_SEQ) && (medium.diskInfo().mediaType() & K3b::Device::MEDIA_DVD_RW_OVWR) && !(d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_OVWR) ) || ( (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_SEQ) && (medium.diskInfo().mediaType() & K3b::Device::MEDIA_DVD_RW_SEQ) && (d->wantedMediaState & K3b::Device::STATE_EMPTY) && (medium.diskInfo().diskState() != K3b::Device::STATE_EMPTY) ) ) { - qDebug() << "------ DVD-RW needs to be formated."; + qDebug() << "------ DVD-RW needs to be formatted."; if( formatWithoutAsking || KMessageBox::warningContinueCancel( parentWidgetToUse(), i18n("Found %1 medium in %2 - %3. " "Should it be formatted?", K3b::Device::mediaTypeString(medium.diskInfo().mediaType()), d->device->vendor(), d->device->description()), i18n("Found %1",QString("DVD-RW")), KGuiItem(i18n("&Format"), "tools-media-optical-format"), KGuiItem(i18n("&Eject"), "media-eject")) == KMessageBox::Continue ) { qDebug() << "------ formatting DVD-RW."; prepareErasingDialog(); K3b::DvdFormattingJob job( this ); job.setDevice( d->device ); // we prefer the current mode of the media if no special mode has been requested job.setMode( ( (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_SEQ) && (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_OVWR) ) ? ( medium.diskInfo().mediaType() == K3b::Device::MEDIA_DVD_RW_OVWR ? K3b::WritingModeRestrictedOverwrite : K3b::WritingModeIncrementalSequential ) : ( (d->wantedMediaType & K3b::Device::MEDIA_DVD_RW_SEQ) ? K3b::WritingModeIncrementalSequential : K3b::WritingModeRestrictedOverwrite ) ); job.setFormattingMode( FormattingQuick ); job.setForce( false ); job.setForceNoEject(true); d->erasingInfoDialog->reset(); d->erasingInfoDialog->setLabelText( i18n("Formatting DVD-RW") ); d->erasingInfoDialog->setRange( 0, 100 ); connect( &job, SIGNAL(finished(bool)), this, SLOT(slotErasingFinished(bool)) ); connect( &job, SIGNAL(percent(int)), d->erasingInfoDialog, SLOT(setValue(int)) ); connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) ); job.start( medium.diskInfo() ); d->erasingInfoDialog->exec(); } else { qDebug() << "starting devicehandler: no DVD-RW formatting."; K3b::eject( d->device ); continueWaiting(); } } else { qDebug() << "------ nothing useful found."; continueWaiting(); } } // --- DVD-RW ------ // ///////////////////////////////////////////////////////////// // // CD-RW handling // // ///////////////////////////////////////////////////////////// // format CD-RW else if( medium.diskInfo().mediaType() == Device::MEDIA_CD_RW && (d->wantedMediaType & medium.diskInfo().mediaType()) && (d->wantedMediaState & K3b::Device::STATE_EMPTY) && !medium.diskInfo().empty() && medium.diskInfo().rewritable() ) { if( formatWithoutAsking || KMessageBox::questionYesNo( parentWidgetToUse(), i18n("Found rewritable medium in %1 - %2. " "Should it be erased?",d->device->vendor(),d->device->description()), i18n("Found Rewritable Disk"), KGuiItem(i18n("E&rase"), "tools-media-optical-erase"), KGuiItem(i18n("&Eject"), "media-eject") ) == KMessageBox::Yes ) { prepareErasingDialog(); // start a k3bblankingjob d->erasingInfoDialog->reset(); d->erasingInfoDialog->setLabelText( i18n("Erasing CD-RW") ); d->erasingInfoDialog->setRange( 0, 0 ); // the user may be using cdrdao for erasing as cdrecord does not work WritingApp erasingApp = K3b::WritingAppAuto; if( KSharedConfig::openConfig()->group( "General Options" ).readEntry( "Show advanced GUI", false ) ) { erasingApp = K3b::writingAppFromString( KSharedConfig::openConfig()->group( "CDRW Erasing" ).readEntry( "writing_app" ) ); } K3b::BlankingJob job( this ); job.setDevice( d->device ); job.setFormattingMode( FormattingQuick ); job.setForce(true); job.setForceNoEject(true); job.setSpeed( 0 ); // Auto job.setWritingApp( erasingApp ); connect( &job, SIGNAL(finished(bool)), this, SLOT(slotErasingFinished(bool)) ); connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) ); job.start(); d->erasingInfoDialog->exec(); } else { qDebug() << "starting devicehandler: no CD-RW overwrite."; K3b::eject( d->device ); continueWaiting(); } } // ///////////////////////////////////////////////////////////// // // All the non-rewritable media types are handled here // // ///////////////////////////////////////////////////////////// // we have exactly what was requested (K3b never requests a specific // size for read-only cases, thus using remainingSize() is perfectly fine) else if( (d->wantedMediaType & medium.diskInfo().mediaType()) && (d->wantedMediaState & medium.diskInfo().diskState()) && (d->wantedMinMediaSize <= medium.actuallyRemainingSize() || IsOverburnAllowed( d->wantedMinMediaSize, medium.diskInfo().capacity(), medium.actuallyUsedCapacity() )) ) { finishWaiting( medium.diskInfo().mediaType() ); } // this is for CD drives that are not able to determine the state of a disk else if( medium.diskInfo().diskState() == K3b::Device::STATE_UNKNOWN && medium.diskInfo().mediaType() == K3b::Device::MEDIA_CD_ROM && d->wantedMediaType & K3b::Device::MEDIA_CD_ROM ) { finishWaiting( medium.diskInfo().mediaType() ); } else { qDebug() << "------ nothing useful found."; continueWaiting(); } // handle queued medium changes d->blockMediaChange = false; if( d->mediumChanged > 0 ) { d->mediumChanged--; slotMediumChanged( dev ); } } void K3b::EmptyDiscWaiter::showDialog() { // we need to show the dialog if not done already if( !d->dialogVisible ) { KNotification::event( "WaitingForMedium", i18n("Waiting for Medium") ); d->dialogVisible = true; //clear it. setAttribute(Qt::WA_DeleteOnClose,false); setWindowModality( Qt::NonModal ); setResult( 0 ); show(); } } void K3b::EmptyDiscWaiter::continueWaiting() { showDialog(); } void K3b::EmptyDiscWaiter::slotCancel() { qDebug() << "slotCancel() "; d->canceled = true; finishWaiting( Device::MEDIA_UNKNOWN ); } void K3b::EmptyDiscWaiter::slotEject() { K3b::unmount( d->device ); K3b::Device::eject( d->device ); } void K3b::EmptyDiscWaiter::slotLoad() { K3b::Device::load( d->device ); } void K3b::EmptyDiscWaiter::finishWaiting( Device::MediaType type ) { qDebug() << "finishWaiting() "; d->waitingDone = true; d->result = type; if( d->dialogVisible ) hide(); if( d->inLoop ) { d->inLoop = false; qDebug() << "exitLoop "; emit leaveModality(); } } void K3b::EmptyDiscWaiter::slotErasingFinished( bool success ) { if( success ) { // close the dialog thus ending it's event loop -> back to slotMediumChanged d->erasingInfoDialog->hide(); } else { K3b::Device::eject( d->device ); KMessageBox::error( d->erasingInfoDialog, i18n("Erasing failed.") ); d->erasingInfoDialog->hide(); // close the dialog thus ending it's event loop -> back to slotMediumChanged } } K3b::Device::MediaType K3b::EmptyDiscWaiter::wait( K3b::Device::Device* device, Device::MediaStates mediaState, Device::MediaTypes mediaType, const K3b::Msf& minMediaSize, const QString& message, QWidget* parent ) { if( device != 0 ) { K3b::EmptyDiscWaiter d( device, parent ? parent : qApp->activeWindow() ); return d.waitForDisc( mediaState, mediaType, minMediaSize, message ); } else { return Device::MEDIA_UNKNOWN; } } void K3b::EmptyDiscWaiter::prepareErasingDialog() { // we hide the emptydiskwaiter so the info dialog needs to have the same parent if( !d->erasingInfoDialog ) d->erasingInfoDialog = new QProgressDialog( parentWidget() ); // // hide the dialog // if( d->dialogVisible ) { hide(); d->dialogVisible = false; } } QWidget* K3b::EmptyDiscWaiter::parentWidgetToUse() { // we might also show dialogs if the discwaiter widget is not visible yet if( d->dialogVisible ) return this; else return parentWidget(); } K3b::Device::MediaType K3b::EmptyDiscWaiter::waitForMedium( K3b::Device::Device* device, Device::MediaStates mediaState, Device::MediaTypes mediaType, const K3b::Msf& minMediaSize, const QString& message ) { // this is only needed for the formatting return wait( device, mediaState, mediaType, minMediaSize, message, d->erasingInfoDialog ); } bool K3b::EmptyDiscWaiter::questionYesNo( const QString& text, const QString& caption, const KGuiItem& buttonYes, const KGuiItem& buttonNo ) { return ( KMessageBox::questionYesNo( parentWidgetToUse(), text, caption, buttonYes, buttonNo ) == KMessageBox::Yes ); } void K3b::EmptyDiscWaiter::blockingInformation( const QString& text, const QString& caption ) { KMessageBox::information( this, text, caption ); } - - diff --git a/src/k3binteractiondialog.h b/src/k3binteractiondialog.h index 93e5f893c..84e5fb41a 100644 --- a/src/k3binteractiondialog.h +++ b/src/k3binteractiondialog.h @@ -1,256 +1,256 @@ /* * * Copyright (C) 2003-2008 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2008 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef _K3B_INTERACTION_DIALOG_H_ #define _K3B_INTERACTION_DIALOG_H_ #include #include #include #include #include class QGridLayout; class QLabel; class QPushButton; class KGuiItem; class QToolButton; namespace K3b { class ThemedHeader; /** * This is the base dialog for all the dialogs in K3b that start * some job. Use setMainWidget to set the contents or let mainWidget() * create an empty plain page. * The default implementations of the slots just emit the * corresponding signals. */ class InteractionDialog : public QDialog { Q_OBJECT public: /** * The constructor. * loadSettings will be called automatically when the dialog is showing. * * @param title the text to be displayed in the K3b header (not the widget frame) * @param subTitle additional text that will be displayed after the title in smaller size * @param buttonMask combination of Buttons * @param defaultButton may also be null to deactivate the feature * @param configgroup The config group used for the loadSettings and saveSettings methods */ explicit InteractionDialog( QWidget* parent = 0, const QString& title = QString(), const QString& subTitle = QString(), int buttonMask = START_BUTTON|CANCEL_BUTTON, int defaultButton = START_BUTTON, const QString& configgroup = QString() ); ~InteractionDialog() override; void setMainWidget( QWidget* w ); void setTitle( const QString& title, const QString& subTitle = QString() ); void setDefaultButton( int b ); /** * In contract to "normal" dialogs InteractionDialog will not return from exec - * until close() has been called. This allows to hide the dialog while a progress + * until close() has been called. This allows one to hide the dialog while a progress * dialog is shown. */ int exec() override; /** * reimplemented to allow initialization after the dialog has been opened. */ void show(); /** * If no mainWidget has been set a plain page will be created. */ QWidget* mainWidget(); enum Buttons { START_BUTTON = 1, SAVE_BUTTON = 2, CANCEL_BUTTON = 4 }; QSize sizeHint() const override; QString configGroup() const { return m_configGroup; } enum StartUpSettings { LOAD_K3B_DEFAULTS = 1, LOAD_SAVED_SETTINGS = 2, LOAD_LAST_SETTINGS = 3 }; Q_SIGNALS: void started(); void canceled(); void saved(); public Q_SLOTS: /** * \deprecated use setButtonText */ void setStartButtonText( const QString& text, const QString& tooltip = QString(), const QString& whatsthis = QString() ); /** * \deprecated use setButtonText */ void setCancelButtonText( const QString& text, const QString& tooltip = QString(), const QString& whatsthis = QString() ); /** * \deprecated use setButtonText */ void setSaveButtonText( const QString& text, const QString& tooltip = QString(), const QString& whatsthis = QString() ); void setButtonGui( int button, const KGuiItem& ); void setButtonText( int button, const QString& text, const QString& tooltip = QString(), const QString& whatsthis = QString() ); void setButtonEnabled( int button, bool enabled ); void setButtonShown( int button, bool enabled ); /** * If set true the init() method will be called via a QTimer to ensure event * handling be done before (default: false). */ void setDelayedInitialization( bool b ) { m_delayedInit = b; } /** * Hide the dialog but do not return from the exec call. */ void hideTemporarily(); /** * Close the dialog and return from any exec call. */ void close(); /** * Close the dialog and return from any exec call. */ void done( int r ) override; protected Q_SLOTS: // FIXME: replace these with protected methods which are called from private slots. virtual void slotStartClicked(); /** * The default implementation emits the canceled() signal * and calls close() */ virtual void slotCancelClicked(); virtual void slotSaveClicked(); /** * This slot will call the toggleAll() method protecting from infinite loops * caused by one element influencing another element which in turn influences * the first. * * Connect this slot to GUI elements (like Checkboxes) that change * the state of the whole dialog. */ void slotToggleAll(); protected: /** * Reimplement this method in case you are using slotToggleAll() */ virtual void toggleAll(); /** * Reimplement this to support the save/load user default buttons. * @p config is already set to the correct group. * * The save/load buttons are only activated if the config group is * set in the constructor. */ virtual void saveSettings( KConfigGroup config ); /** * Reimplement this to support the save/load user default buttons. * @p config is already set to the correct group. * * The save/load buttons are only activated if the config group is * set in the constructor. * * This method will also be called to load defaults. In that case * \m config will ignore local settings. */ virtual void loadSettings( const KConfigGroup& config ); /** * This is called after the dialog has been shown. * Use this for initialization that should happen * when the user already sees the dialog. */ virtual void init() {} /** * reimplemented from QDialog */ bool eventFilter( QObject*, QEvent* ) override; void hideEvent( QHideEvent* ) override; private Q_SLOTS: void slotLoadK3bDefaults(); void slotLoadUserDefaults(); void slotSaveUserDefaults(); void slotLoadLastSettings(); void slotStartClickedInternal(); void slotInternalInit(); private: void initConnections(); void initToolTipsAndWhatsThis(); void saveLastSettings(); void loadStartupSettings(); QPushButton* getButton( int ); ThemedHeader* m_dialogHeader; QPushButton* m_buttonStart; QPushButton* m_buttonSave; QPushButton* m_buttonCancel; QWidget* m_mainWidget; QToolButton* m_buttonLoadSettings; QToolButton* m_buttonSaveSettings; QGridLayout* mainGrid; int m_defaultButton; QString m_configGroup; bool m_inToggleMode; bool m_delayedInit; }; } #endif diff --git a/src/k3bmediaselectioncombobox.h b/src/k3bmediaselectioncombobox.h index a5b4b4898..fcc9a948b 100644 --- a/src/k3bmediaselectioncombobox.h +++ b/src/k3bmediaselectioncombobox.h @@ -1,138 +1,138 @@ /* * * Copyright (C) 2005-2009 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2009 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef _K3B_MEDIA_SELECTION_COMBOBOX_H_ #define _K3B_MEDIA_SELECTION_COMBOBOX_H_ #include "k3bmedium.h" #include #include namespace K3b { namespace Device { class Device; class DeviceManager; } class Msf; /** - * Combo box which allows to select a media (in comparison - * to the DeviceComboBox which allows to select a device. + * Combo box which allows one to select a media (in comparison + * to the DeviceComboBox which allows one to select a device. * * This class uses the MediaCache to update it's status. */ class MediaSelectionComboBox : public KComboBox { Q_OBJECT public: explicit MediaSelectionComboBox( QWidget* parent ); ~MediaSelectionComboBox() override; /** * Although the widget allows selection of media this * results in a device being selected. */ Device::Device* selectedDevice() const; QList allDevices() const; Device::MediaTypes wantedMediumType() const; Device::MediaStates wantedMediumState() const; Medium::MediumContents wantedMediumContent() const; K3b::Msf wantedMediumSize() const; Q_SIGNALS: /** * Be aware that his signal will also be emitted in case * no medium is available with a null pointer. */ void selectionChanged( K3b::Device::Device* ); /** * This signal is emitted if the selection of media changed. * This includes a change due to changing the wanted medium state. */ void newMedia(); void newMedium( K3b::Device::Device* dev ); public Q_SLOTS: /** * Only works in case the device actually contains a usable medium. * Otherwise the currently selected medium stays selected. */ void setSelectedDevice( K3b::Device::Device* ); /** * Set the wanted medium type. Defaults to writable CD. * * \param type a bitwise combination of the Device::MediaType enum */ void setWantedMediumType( K3b::Device::MediaTypes type ); /** * Set the wanted medium state. Defaults to empty media. * * \param state a bitwise combination of the Device::State enum */ void setWantedMediumState( K3b::Device::MediaStates state ); /** * Set the wanted medium content type. The default is Medium::ContentAll. * * \param content A bitwise or of Medium::MediumContent */ void setWantedMediumContent( K3b::Medium::MediumContents content ); /** * Set the wanted medium size. Defaults to 0 which means * that the size should be irgnored. */ void setWantedMediumSize( const K3b::Msf& minSize ); /** * Set the device to ignore. This device will not be checked for * wanted media. This is many useful for media copy. * * \param dev The device to ignore or 0 to not ignore any device. */ void setIgnoreDevice( K3b::Device::Device* dev ); private Q_SLOTS: void slotMediumChanged( K3b::Device::Device* ); void slotDeviceManagerChanged( K3b::Device::DeviceManager* ); void slotActivated( int i ); void slotUpdateToolTip( K3b::Device::Device* ); protected: void updateMedia(); virtual bool showMedium( const Medium& ) const; virtual QString mediumString( const Medium& ) const; virtual QString mediumToolTip( const Medium& ) const; virtual QString noMediumMessage() const; QStringList noMediumMessages() const; private: void updateMedium( Device::Device* ); void addMedium( Device::Device* ); void showNoMediumMessage(); void clear(); class Private; Private* d; }; } #endif diff --git a/src/k3bmetaitemmodel.h b/src/k3bmetaitemmodel.h index 710e36829..8c319c607 100644 --- a/src/k3bmetaitemmodel.h +++ b/src/k3bmetaitemmodel.h @@ -1,122 +1,122 @@ /* * * Copyright (C) 2008 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2008 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef _K3B_META_ITEM_MODEL_H_ #define _K3B_META_ITEM_MODEL_H_ #include #include class QIcon; -// TODO: * Have a MetaItemView which allows to set delegates for submodel header painting +// TODO: * Have a MetaItemView which allows one to set delegates for submodel header painting // * implement something like modelHeaderData() to get data for the root elements namespace K3b { /** * Meta item model which combines multiple submodels into * one big model. * * Usage is very simple: just call addSubModel for each * model that should be added to the meta model. */ class MetaItemModel : public QAbstractItemModel { Q_OBJECT public: explicit MetaItemModel( QObject* parent = 0 ); ~MetaItemModel() override; QModelIndex indexForSubModel( QAbstractItemModel* model ) const; QAbstractItemModel* subModelForIndex( const QModelIndex& index ) const; /** * Map index to an index used in the submodel. The returned index * should be used carefully. */ QModelIndex mapToSubModel( const QModelIndex& index ) const; QModelIndex mapFromSubModel( const QModelIndex& index ) const; /** * Returns the column count for the given index * For the root index it always return 1 */ int columnCount( const QModelIndex& parent = QModelIndex() ) const override; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const override; QModelIndex parent( const QModelIndex& index ) const override; int rowCount( const QModelIndex& parent = QModelIndex() ) const override; Qt::ItemFlags flags( const QModelIndex& index ) const override; bool hasChildren( const QModelIndex& parent = QModelIndex() ) const override; bool canFetchMore( const QModelIndex& parent ) const override; void fetchMore( const QModelIndex& parent ) override; bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole ) override; QStringList mimeTypes() const override; bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent ) override; bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override; /** * Can handle lists of indexes from a single submodel. Mixing indexes * from different submodels is not supported yet and results in the method * returning 0. */ QMimeData* mimeData( const QModelIndexList& indexes ) const override; /** * The default implementation just returns the list of all drop actions * supported by any of the submodels. */ Qt::DropActions supportedDragActions() const override; /** * The default implementation just returns the list of all drop actions * supported by any of the submodels. */ Qt::DropActions supportedDropActions() const override; public Q_SLOTS: /** * PlacesModel takes over ownership of model. * FIXME: name and icon are weird parameters here * * \param model The submodel to be added. * \param flat If flat is set true the root items of the submodel will * be merged into the root item list of this model. Otherwise the submodel * will be added under a new root item. */ void addSubModel( const QString& name, const QIcon& icon, QAbstractItemModel* model, bool flat = false ); /** * FIXME: better use an id or something? */ void removeSubModel( QAbstractItemModel* model ); private Q_SLOTS: void slotRowsAboutToBeInserted( const QModelIndex&, int, int ); void slotRowsInserted( const QModelIndex&, int, int ); void slotRowsAboutToBeRemoved( const QModelIndex&, int, int ); void slotRowsRemoved( const QModelIndex&, int, int ); void slotDataChanged( const QModelIndex&, const QModelIndex& ); void slotAboutToBeReset(); void slotReset(); private: class Private; Private* const d; }; } #endif diff --git a/src/k3bplacesmodel.h b/src/k3bplacesmodel.h index 0d343bdb0..928a0947f 100644 --- a/src/k3bplacesmodel.h +++ b/src/k3bplacesmodel.h @@ -1,97 +1,97 @@ /* * * Copyright (C) 2007-2008 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2008 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef _K3B_PLACES_MODEL_H_ #define _K3B_PLACES_MODEL_H_ #include "k3bmetaitemmodel.h" #include class KFileItem; namespace K3b { namespace Device { class Device; class DeviceManager; } /** * Wraps multiple KDirModels and a DeviceModel */ class PlacesModel : public MetaItemModel { Q_OBJECT public: explicit PlacesModel( QObject* parent = 0 ); ~PlacesModel() override; /** * Will return an invalid item if the index is not part * of a KDirModel. */ KFileItem itemForIndex( const QModelIndex& index ) const; /** * Will return 0 if the index does not refer to a device item. */ Device::Device* deviceForIndex( const QModelIndex& index ) const; /** * Will return invalid index if model does not contain such device */ QModelIndex indexForDevice( Device::Device* dev ) const; Q_SIGNALS: /** * Emitted for each subdirectory that is a parent of a url - * passed to expandToUrl This allows to asynchronously open + * passed to expandToUrl This allows one to asynchronously open * a tree view down to a given directory. * * \sa KDirModel::expand */ void expand( const QModelIndex& index ); public Q_SLOTS: void addPlace( const QString& name, const QIcon& icon, const QUrl& rootUrl ); /** * \short Lists subdirectories using fetchMore() as needed until the given \p url exists in the model. * * When the model is used by a treeview, call KDirLister::openUrl with the base url of the tree, * then the treeview will take care of calling fetchMore() when the user opens directories. * However if you want the tree to show a given URL (i.e. open the tree recursively until that URL), * call expandToUrl(). * Note that this is asynchronous; the necessary listing of subdirectories will take time so * the model will not immediately have this url available. * The model emits the signal expand() when an index has become available; this can be connected * to the treeview in order to let it open that index. * \param url the url of a subdirectory of the directory model * * \sa KDirModel::expandToUrl */ void expandToUrl( const QUrl& url ); private Q_SLOTS: void slotDevicesChanged( K3b::Device::DeviceManager* dm ); void slotExpand( const QModelIndex& index ); private: class Private; Private* const d; }; } #endif diff --git a/src/k3bwritingmodewidget.cpp b/src/k3bwritingmodewidget.cpp index 3894f273e..17bdb4e1c 100644 --- a/src/k3bwritingmodewidget.cpp +++ b/src/k3bwritingmodewidget.cpp @@ -1,259 +1,259 @@ /* * * Copyright (C) 2003-2009 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2009 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "k3bwritingmodewidget.h" #include "k3bmediacache.h" #include "k3bapplication.h" #include "k3bglobals.h" #include #include #include static const KLocalizedString s_autoHelp = ki18n("Let K3b select the best-suited mode. This is the recommended selection."); static const KLocalizedString s_daoHelp = ki18n("Disk At Once or more properly Session At Once. " "The laser is never turned off while writing the CD or DVD. " "This is the preferred mode to write audio CDs since it allows " "pregaps other than 2 seconds. Not all writers support DAO.
" "DVD-R(W)s written in DAO provide the best DVD-Video compatibility."); static const KLocalizedString s_taoHelp = ki18n("Track At Once should be supported by every CD writer. " "The laser will be turned off after every track.
" "Most CD writers need this mode for writing multisession CDs."); // TODO: add something like: "No CD-TEXT writing in TAO mode." static const KLocalizedString s_rawHelp = ki18n("RAW writing mode. The error correction data is created by the " "software instead of the writer device.
" "Try this if your CD writer fails to write in DAO and TAO."); static const KLocalizedString s_seqHelp = ki18n("Incremental sequential is the default writing mode for DVD-R(W). " "It allows multisession DVD-R(W)s. It only applies to DVD-R(W)."); static const KLocalizedString s_ovwHelp = - ki18n("Restricted Overwrite allows to use a DVD-RW just like a DVD-RAM " + ki18n("Restricted Overwrite allows one to use a DVD-RW just like a DVD-RAM " "or a DVD+RW. The media may just be overwritten. It is not possible " "to write multisession DVD-RWs in this mode but K3b uses growisofs " "to grow an ISO 9660 filesystem within the first session, thus allowing " "new files to be added to an already burned disk."); class K3b::WritingModeWidget::Private { public: // modes set via setSupportedModes WritingModes supportedModes; // filtered modes WritingModes selectedModes; Device::Device* device; void _k_writingModeChanged( int mode ) { emit q->writingModeChanged( WritingMode( mode ) ); } WritingModeWidget* q; }; K3b::WritingModeWidget::WritingModeWidget( WritingModes modes, QWidget* parent ) : IntMapComboBox( parent ) { init(); setSupportedModes( modes ); } K3b::WritingModeWidget::WritingModeWidget( QWidget* parent ) : IntMapComboBox( parent ) { init(); setSupportedModes( WritingModeSao | WritingModeTao | WritingModeRaw ); // default: support all CD-R(W) modes } K3b::WritingModeWidget::~WritingModeWidget() { delete d; } void K3b::WritingModeWidget::init() { d = new Private(); d->q = this; d->device = 0; connect( this, SIGNAL(valueChanged(int)), this, SLOT(_k_writingModeChanged(int)) ); setToolTip( i18n("Select the writing mode to use") ); addGlobalWhatsThisText( "

" + i18n("Writing mode") + "

", i18n("Be aware that the writing mode is ignored when writing DVD+R(W) and BD-R(E) since " "there is only one way to write them.") + "

" + i18n("The selection of writing modes depends on the inserted burning medium.") + "" ); } K3b::WritingMode K3b::WritingModeWidget::writingMode() const { return WritingMode( selectedValue() ); } K3b::WritingModes K3b::WritingModeWidget::supportedWritingModes() const { return d->selectedModes; } void K3b::WritingModeWidget::setWritingMode( WritingMode m ) { if( m & d->selectedModes ) { setSelectedValue( m ); } else { setSelectedValue( WritingModeAuto ); } } void K3b::WritingModeWidget::setSupportedModes( WritingModes m ) { d->supportedModes = m|WritingModeAuto; // we always support the Auto mode updateModes(); } void K3b::WritingModeWidget::setDevice( Device::Device* dev ) { d->device = dev; updateModes(); } void K3b::WritingModeWidget::updateModes() { // save current mode int currentMode = writingMode(); clear(); if( d->device ) d->selectedModes = d->supportedModes & d->device->writingModes(); else d->selectedModes = d->supportedModes; insertItem( WritingModeAuto, i18n("Auto"), s_autoHelp.toString() ); if( d->selectedModes & WritingModeSao ) insertItem( WritingModeSao, i18n("DAO"), s_daoHelp.toString() ); if( d->selectedModes & WritingModeTao ) insertItem( WritingModeTao, i18n("TAO"), s_taoHelp.toString() ); if( d->selectedModes & WritingModeRaw ) insertItem( WritingModeRaw, i18n("RAW"), s_rawHelp.toString() ); if( d->selectedModes & WritingModeRestrictedOverwrite ) insertItem( WritingModeRestrictedOverwrite, i18n("Restricted Overwrite"), s_ovwHelp.toString() ); if( d->selectedModes & WritingModeIncrementalSequential ) insertItem( WritingModeIncrementalSequential, i18n("Incremental"), s_seqHelp.toString() ); setWritingMode( currentMode != -1 ? WritingMode( currentMode ) : WritingModeAuto ); } void K3b::WritingModeWidget::saveConfig( KConfigGroup c ) { switch( writingMode() ) { case WritingModeSao: c.writeEntry( "writing_mode", "dao" ); break; case WritingModeTao: c.writeEntry( "writing_mode", "tao" ); break; case WritingModeRaw: c.writeEntry( "writing_mode", "raw" ); break; case WritingModeIncrementalSequential: c.writeEntry( "writing_mode", "incremental" ); break; case WritingModeRestrictedOverwrite: c.writeEntry( "writing_mode", "overwrite" ); break; default: c.writeEntry( "writing_mode", "auto" ); break; } } void K3b::WritingModeWidget::loadConfig( const KConfigGroup& c ) { QString mode = c.readEntry( "writing_mode" ); if ( mode == "dao" ) setWritingMode( WritingModeSao ); else if( mode == "tao" ) setWritingMode( WritingModeTao ); else if( mode == "raw" ) setWritingMode( WritingModeRaw ); else if( mode == "incremental" ) setWritingMode( WritingModeIncrementalSequential ); else if( mode == "overwrite" ) setWritingMode( WritingModeRestrictedOverwrite ); else setWritingMode( WritingModeAuto ); } void K3b::WritingModeWidget::determineSupportedModesFromMedium( const Medium& m ) { WritingModes modes = WritingModeAuto; if( m.diskInfo().mediaType() & (Device::MEDIA_CD_R|Device::MEDIA_CD_RW) ) { modes |= WritingModeTao; if( m.device()->supportsWritingMode( Device::WRITINGMODE_SAO ) ) modes |= WritingModeSao; if( m.device()->supportsWritingMode( Device::WRITINGMODE_RAW ) ) modes |= WritingModeRaw; } if( m.diskInfo().mediaType() & Device::MEDIA_DVD_MINUS_ALL ) { modes |= WritingModeSao; if ( !k3bcore->deviceBlocked( m.device() ) ) if( m.device()->featureCurrent( Device::FEATURE_INCREMENTAL_STREAMING_WRITABLE ) != 0 ) modes |= WritingModeIncrementalSequential; } if( m.diskInfo().mediaType() & (Device::MEDIA_DVD_RW| Device::MEDIA_DVD_RW_SEQ| Device::MEDIA_DVD_RW_OVWR) ) { modes |= WritingModeRestrictedOverwrite; } setSupportedModes( modes ); setDevice( m.device() ); } void K3b::WritingModeWidget::determineSupportedModesFromMedium( K3b::Device::Device* dev ) { if( dev ) determineSupportedModesFromMedium( k3bappcore->mediaCache()->medium( dev ) ); else determineSupportedModesFromMedium( Medium() ); // no medium } #include "moc_k3bwritingmodewidget.cpp" diff --git a/src/misc/k3bimagewritingdialog.cpp b/src/misc/k3bimagewritingdialog.cpp index 2e1708e96..4955a3907 100644 --- a/src/misc/k3bimagewritingdialog.cpp +++ b/src/misc/k3bimagewritingdialog.cpp @@ -1,1226 +1,1226 @@ /* * * Copyright (C) 2003-2009 Sebastian Trueg * Copyright (C) 2010 Michal Malek * * This file is part of the K3b project. * Copyright (C) 1998-2009 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "k3bimagewritingdialog.h" #include "k3biso9660imagewritingjob.h" #include "k3bbinimagewritingjob.h" #include "k3bcuefileparser.h" #include "k3bclonetocreader.h" #include "k3baudiocuefilewritingjob.h" #include "k3bclonejob.h" #include "k3bmediacache.h" #include "k3bapplication.h" #include #include "k3btempdirselectionwidget.h" #include "k3bdevicemanager.h" #include "k3bdevice.h" #include "k3bwriterselectionwidget.h" #include "k3bburnprogressdialog.h" #include "k3bstdguiitems.h" #include "k3bmd5job.h" #include "k3bdatamodewidget.h" #include "k3bglobals.h" #include "k3bwritingmodewidget.h" #include "k3bcore.h" #include "k3biso9660.h" #include "k3btoc.h" #include "k3btrack.h" #include "k3bcdtext.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace { enum ImageType { IMAGE_UNKNOWN, IMAGE_ISO, IMAGE_CUE_BIN, IMAGE_AUDIO_CUE, IMAGE_CDRDAO_TOC, IMAGE_CDRECORD_CLONE, IMAGE_RAW }; } // namespace class K3b::ImageWritingDialog::Private { public: Private() : md5SumItem(0), haveMd5Sum( false ), foundImageType( IMAGE_UNKNOWN ), imageForced( false ) { } WriterSelectionWidget* writerSelectionWidget; QCheckBox* checkDummy; QCheckBox* checkNoFix; QCheckBox* checkCacheImage; QCheckBox* checkVerify; DataModeWidget* dataModeWidget; WritingModeWidget* writingModeWidget; QSpinBox* spinCopies; KUrlRequester* editImagePath; KComboBox* comboRecentImages; QComboBox* comboImageType; QTreeWidget* infoView; TempDirSelectionWidget* tempDirSelectionWidget; QTreeWidgetItem* md5SumItem; QString lastCheckedFile; K3b::Md5Job* md5Job; bool haveMd5Sum; ImageType foundImageType; QMap imageTypeSelectionMap; QMap imageTypeSelectionMapRev; QString imageFile; QString tocFile; QTabWidget* optionTabbed; QWidget* advancedTab; QWidget* tempPathTab; bool advancedTabVisible; bool tempPathTabVisible; int advancedTabIndex; int tempPathTabIndex; bool imageForced; QColor infoTextColor; QColor negativeTextColor; QColor normalTextColor; static KIO::filesize_t volumeSpaceSize( const Iso9660& iso ); void createIso9660InfoItems( Iso9660* ); void createCdrecordCloneItems( const QString&, const QString& ); void createCueBinItems( const QString&, const QString& ); void createAudioCueItems( const CueFileParser& cp ); int currentImageType(); QString imagePath() const; }; KIO::filesize_t K3b::ImageWritingDialog::Private::volumeSpaceSize( const Iso9660& isoFs ) { return static_cast( isoFs.primaryDescriptor().volumeSpaceSize*2048 ); } void K3b::ImageWritingDialog::Private::createIso9660InfoItems( K3b::Iso9660* isoF ) { QTreeWidgetItem* isoRootItem = new QTreeWidgetItem( infoView ); isoRootItem->setText( 0, i18n("Detected:") ); isoRootItem->setText( 1, i18n("ISO 9660 image") ); isoRootItem->setForeground( 0, infoTextColor ); isoRootItem->setIcon( 1, QIcon::fromTheme( "application-x-cd-image") ); isoRootItem->setTextAlignment( 0, Qt::AlignRight ); const KIO::filesize_t size = K3b::filesize( QUrl::fromLocalFile(isoF->fileName()) ); const KIO::filesize_t volumeSpaceSize = Private::volumeSpaceSize( *isoF ); QTreeWidgetItem* item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Filesize:") ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); if( size < volumeSpaceSize ) { item->setText( 1, i18n("%1 (different than declared volume size)", KIO::convertSize( size )) ); item->setForeground( 1, negativeTextColor ); item->setIcon( 1, QIcon::fromTheme( "dialog-error") ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Volume Size:") ); item->setText( 1, KIO::convertSize( volumeSpaceSize ) ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); } else { item->setText( 1, KIO::convertSize( size ) ); } item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("System Id:") ); item->setText( 1, isoF->primaryDescriptor().systemId.isEmpty() ? QString("-") : isoF->primaryDescriptor().systemId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Volume Id:") ); item->setText( 1, isoF->primaryDescriptor().volumeId.isEmpty() ? QString("-") : isoF->primaryDescriptor().volumeId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Volume Set Id:") ); item->setText( 1, isoF->primaryDescriptor().volumeSetId.isEmpty() ? QString("-") : isoF->primaryDescriptor().volumeSetId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Publisher Id:") ); item->setText( 1, isoF->primaryDescriptor().publisherId.isEmpty() ? QString("-") : isoF->primaryDescriptor().publisherId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Preparer Id:") ); item->setText( 1, isoF->primaryDescriptor().preparerId.isEmpty() ? QString("-") : isoF->primaryDescriptor().preparerId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Application Id:") ); item->setText( 1, isoF->primaryDescriptor().applicationId.isEmpty() ? QString("-") : isoF->primaryDescriptor().applicationId ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); } void K3b::ImageWritingDialog::Private::createCdrecordCloneItems( const QString& tocFile, const QString& imageFile ) { QTreeWidgetItem* isoRootItem = new QTreeWidgetItem( infoView ); isoRootItem->setText( 0, i18n("Detected:") ); isoRootItem->setText( 1, i18n("Cdrecord clone image") ); isoRootItem->setForeground( 0, infoTextColor ); isoRootItem->setIcon( 1, QIcon::fromTheme( "application-x-cd-image") ); isoRootItem->setTextAlignment( 0, Qt::AlignRight ); QTreeWidgetItem* item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Filesize:") ); item->setText( 1, KIO::convertSize( K3b::filesize(QUrl::fromLocalFile(imageFile)) ) ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Image file:") ); item->setText( 1, imageFile ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("TOC file:") ); item->setText( 1, tocFile ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); } void K3b::ImageWritingDialog::Private::createCueBinItems( const QString& cueFile, const QString& imageFile ) { QTreeWidgetItem* isoRootItem = new QTreeWidgetItem( infoView ); isoRootItem->setText( 0, i18n("Detected:") ); isoRootItem->setText( 1, i18n("Cue/bin image") ); isoRootItem->setForeground( 0, infoTextColor ); isoRootItem->setIcon( 1, QIcon::fromTheme( "application-x-cd-image") ); isoRootItem->setTextAlignment( 0, Qt::AlignRight ); QTreeWidgetItem* item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Filesize:") ); item->setText( 1, KIO::convertSize( K3b::filesize(QUrl::fromLocalFile(imageFile)) ) ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Image file:") ); item->setText( 1, imageFile ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); item = new QTreeWidgetItem( infoView ); item->setText( 0, i18n("Cue file:") ); item->setText( 1, cueFile ); item->setForeground( 0, infoTextColor ); item->setTextAlignment( 0, Qt::AlignRight ); } void K3b::ImageWritingDialog::Private::createAudioCueItems( const K3b::CueFileParser& cp ) { QTreeWidgetItem* rootItem = new QTreeWidgetItem( infoView ); rootItem->setText( 0, i18n("Detected:") ); rootItem->setText( 1, i18n("Audio Cue Image") ); rootItem->setForeground( 0, infoTextColor ); rootItem->setIcon( 1, QIcon::fromTheme( "audio-x-generic") ); rootItem->setTextAlignment( 0, Qt::AlignRight ); QTreeWidgetItem* trackParent = new QTreeWidgetItem( infoView ); trackParent->setText( 0, i18np("One track", "%1 tracks", cp.toc().count() ) ); trackParent->setText( 1, cp.toc().length().toString() ); if( !cp.cdText().isEmpty() ) { trackParent->setText( 1, QString("%1 (%2 - %3)") .arg(trackParent->text(1)) .arg(cp.cdText().performer()) .arg(cp.cdText().title()) ); } int i = 1; foreach( const K3b::Device::Track& track, cp.toc() ) { QTreeWidgetItem* trackItem = new QTreeWidgetItem( trackParent ); trackItem->setText( 0, i18n("Track") + ' ' + QString::number(i).rightJustified( 2, '0' ) ); trackItem->setText( 1, " " + ( i < cp.toc().count() ? track.length().toString() : QString("??:??:??") ) ); if( !cp.cdText().isEmpty() && (cp.cdText().count() > 0) &&!cp.cdText()[i-1].isEmpty() ) trackItem->setText( 1, QString("%1 (%2 - %3)") .arg(trackItem->text(1)) .arg(cp.cdText()[i-1].performer()) .arg(cp.cdText()[i-1].title()) ); ++i; } trackParent->setExpanded( true ); } int K3b::ImageWritingDialog::Private::currentImageType() { if( comboImageType->currentIndex() == 0 ) return foundImageType; else return imageTypeSelectionMap[comboImageType->currentIndex()]; } QString K3b::ImageWritingDialog::Private::imagePath() const { return K3b::convertToLocalUrl( editImagePath->url() ).toLocalFile(); } K3b::ImageWritingDialog::ImageWritingDialog( QWidget* parent ) : K3b::InteractionDialog( parent, i18n("Burn Image"), "iso cue toc", START_BUTTON|CANCEL_BUTTON, START_BUTTON, "image writing" ) // config group { d = new Private(); const KColorScheme colorScheme( QPalette::Normal, KColorScheme::View ); d->infoTextColor = palette().color( QPalette::Disabled, QPalette::Text ); d->negativeTextColor = colorScheme.foreground( KColorScheme::NegativeText ).color(); d->normalTextColor = colorScheme.foreground( KColorScheme::NormalText ).color(); setAcceptDrops( true ); setupGui(); d->md5Job = new K3b::Md5Job( 0, this ); connect( d->md5Job, SIGNAL(finished(bool)), this, SLOT(slotMd5JobFinished(bool)) ); connect( d->md5Job, SIGNAL(percent(int)), this, SLOT(slotMd5JobPercent(int)) ); connect( d->writerSelectionWidget, SIGNAL(writerChanged()), this, SLOT(slotToggleAll()) ); connect( d->writerSelectionWidget, SIGNAL(writingAppChanged(K3b::WritingApp)), this, SLOT(slotToggleAll()) ); connect( d->writerSelectionWidget, SIGNAL(writerChanged(K3b::Device::Device*)), d->writingModeWidget, SLOT(setDevice(K3b::Device::Device*)) ); connect( d->comboImageType, SIGNAL(activated(int)), this, SLOT(slotToggleAll()) ); connect( d->writingModeWidget, SIGNAL(writingModeChanged(WritingMode)), this, SLOT(slotToggleAll()) ); connect( d->editImagePath, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateImage(QString)) ); connect( d->checkDummy, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); connect( d->checkCacheImage, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); } K3b::ImageWritingDialog::~ImageWritingDialog() { d->md5Job->cancel(); KConfigGroup c( KSharedConfig::openConfig(), configGroup() ); QStringList recentImages; // do not store more than 10 recent images for ( int i = 0; i < d->comboRecentImages->count() && recentImages.count() < 10; ++i ) { QString image = d->comboRecentImages->itemText( i ); if ( !recentImages.contains( image ) ) recentImages += image; } c.writePathEntry( "recent images", recentImages ); delete d; } void K3b::ImageWritingDialog::init() { KConfigGroup c( KSharedConfig::openConfig(), configGroup() ); if( !d->imageForced ) { // when opening the dialog first the default settings are loaded and afterwards we set the // last written image because that's what most users want QString image = c.readPathEntry( "last written image", QString() ); if( QFile::exists( image ) ) d->editImagePath->setUrl( QUrl::fromLocalFile( image ) ); d->comboRecentImages->clear(); } d->comboRecentImages->addItems( c.readPathEntry( "recent images", QStringList() ) ); } void K3b::ImageWritingDialog::setupGui() { QWidget* frame = K3b::InteractionDialog::mainWidget(); // image // ----------------------------------------------------------------------- QGroupBox* groupImageUrl = new QGroupBox( i18n("Image to Burn"), frame ); d->comboRecentImages = new KComboBox( true, this ); d->comboRecentImages->setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLength ); d->editImagePath = new KUrlRequester( d->comboRecentImages, groupImageUrl ); d->editImagePath->setMode( KFile::File|KFile::ExistingOnly ); d->editImagePath->setWindowTitle( i18n("Choose Image File") ); d->editImagePath->setFilter( i18n("*.iso *.toc *.ISO *.TOC *.cue *.CUE|Image Files") + '\n' + i18n("*.iso *.ISO|ISO 9660 Image Files") + '\n' + i18n("*.cue *.CUE|Cue Files") + '\n' + i18n("*.toc *.TOC|Cdrdao TOC Files and Cdrecord Clone Images") + '\n' + i18n("*|All Files") ); QHBoxLayout* groupImageUrlLayout = new QHBoxLayout( groupImageUrl ); groupImageUrlLayout->addWidget( d->editImagePath ); QGroupBox* groupImageType = new QGroupBox( i18n("Image Type"), frame ); QHBoxLayout* groupImageTypeLayout = new QHBoxLayout( groupImageType ); d->comboImageType = new QComboBox( groupImageType ); groupImageTypeLayout->addWidget( d->comboImageType ); groupImageTypeLayout->addStretch( 1 ); d->comboImageType->addItem( i18n("Auto Detection") ); d->comboImageType->addItem(i18n("ISO 9660 filesystem image")); d->comboImageType->addItem( i18n("Cue/bin image") ); d->comboImageType->addItem( i18n("Audio cue file") ); d->comboImageType->addItem( i18n("Cdrdao TOC file") ); d->comboImageType->addItem( i18n("Cdrecord clone image") ); d->comboImageType->addItem(i18n("Plain data image")); d->imageTypeSelectionMap[1] = IMAGE_ISO; d->imageTypeSelectionMap[2] = IMAGE_CUE_BIN; d->imageTypeSelectionMap[3] = IMAGE_AUDIO_CUE; d->imageTypeSelectionMap[4] = IMAGE_CDRDAO_TOC; d->imageTypeSelectionMap[5] = IMAGE_CDRECORD_CLONE; d->imageTypeSelectionMap[6] = IMAGE_RAW; d->imageTypeSelectionMapRev[IMAGE_ISO] = 1; d->imageTypeSelectionMapRev[IMAGE_CUE_BIN] = 2; d->imageTypeSelectionMapRev[IMAGE_AUDIO_CUE] = 3; d->imageTypeSelectionMapRev[IMAGE_CDRDAO_TOC] = 4; d->imageTypeSelectionMapRev[IMAGE_CDRECORD_CLONE] = 5; d->imageTypeSelectionMapRev[IMAGE_RAW] = 6; // image info // ----------------------------------------------------------------------- d->infoView = new QTreeWidget( frame ); d->infoView->setColumnCount( 2 ); d->infoView->headerItem()->setText( 0, "key" ); d->infoView->headerItem()->setText( 1, "value" ); d->infoView->setHeaderHidden( true ); d->infoView->setSelectionMode( QAbstractItemView::NoSelection ); d->infoView->setItemsExpandable( false ); d->infoView->setRootIsDecorated( false ); d->infoView->header()->setSectionResizeMode( 0, QHeaderView::ResizeToContents ); d->infoView->setFocusPolicy( Qt::NoFocus ); d->infoView->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel ); d->infoView->setContextMenuPolicy( Qt::CustomContextMenu ); //d->infoView->setNoItemText( i18n("No image file selected") ); //d->infoView->setSorting( -1 ); //d->infoView->setAlternateBackground( QColor() ); //d->infoView->setFullWidth(true); //d->infoView->setSelectionMode( Q3ListView::NoSelection ); //d->infoView->setHScrollBarMode( Q3ScrollView::AlwaysOff ); connect( d->infoView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenuRequested(QPoint)) ); d->writerSelectionWidget = new K3b::WriterSelectionWidget( frame ); d->writerSelectionWidget->setWantedMediumType( K3b::Device::MEDIA_WRITABLE ); d->writerSelectionWidget->setWantedMediumState( K3b::Device::STATE_EMPTY ); // options // ----------------------------------------------------------------------- d->optionTabbed = new QTabWidget( frame ); QWidget* optionTab = new QWidget( d->optionTabbed ); QGridLayout* optionTabLayout = new QGridLayout( optionTab ); optionTabLayout->setAlignment( Qt::AlignTop ); QGroupBox* writingModeGroup = new QGroupBox( i18n("Writing Mode"), optionTab ); d->writingModeWidget = new K3b::WritingModeWidget( writingModeGroup ); QHBoxLayout* writingModeGroupLayout = new QHBoxLayout( writingModeGroup ); writingModeGroupLayout->addWidget( d->writingModeWidget ); // copies -------- QGroupBox* groupCopies = new QGroupBox( i18n("Copies"), optionTab ); QLabel* pixLabel = new QLabel( groupCopies ); pixLabel->setPixmap( SmallIcon( "tools-media-optical-copy", KIconLoader::SizeMedium ) ); pixLabel->setScaledContents( false ); d->spinCopies = new QSpinBox( groupCopies ); d->spinCopies->setMinimum( 1 ); d->spinCopies->setMaximum( 999 ); QHBoxLayout* groupCopiesLayout = new QHBoxLayout( groupCopies ); groupCopiesLayout->addWidget( pixLabel ); groupCopiesLayout->addWidget( d->spinCopies ); // -------- copies QGroupBox* optionGroup = new QGroupBox( i18n("Settings"), optionTab ); d->checkDummy = K3b::StdGuiItems::simulateCheckbox( optionGroup ); d->checkCacheImage = K3b::StdGuiItems::createCacheImageCheckbox( optionGroup ); d->checkVerify = K3b::StdGuiItems::verifyCheckBox( optionGroup ); QVBoxLayout* optionGroupLayout = new QVBoxLayout( optionGroup ); optionGroupLayout->addWidget( d->checkDummy ); optionGroupLayout->addWidget( d->checkCacheImage ); optionGroupLayout->addWidget( d->checkVerify ); optionGroupLayout->addStretch( 1 ); optionTabLayout->addWidget( writingModeGroup, 0, 0 ); optionTabLayout->addWidget( groupCopies, 1, 0 ); optionTabLayout->addWidget( optionGroup, 0, 1, 2, 1 ); optionTabLayout->setRowStretch( 1, 1 ); optionTabLayout->setColumnStretch( 1, 1 ); d->optionTabbed->addTab( optionTab, i18n("Settings") ); // image tab ------------------------------------ d->tempPathTab = new QWidget( d->optionTabbed ); QGridLayout* imageTabGrid = new QGridLayout( d->tempPathTab ); d->tempDirSelectionWidget = new K3b::TempDirSelectionWidget( d->tempPathTab ); imageTabGrid->addWidget( d->tempDirSelectionWidget, 0, 0 ); d->tempPathTabIndex = d->optionTabbed->addTab( d->tempPathTab, i18n("&Image") ); d->tempPathTabVisible = true; // ------------------------------------------------------------- // advanced --------------------------------- d->advancedTab = new QWidget( d->optionTabbed ); QGridLayout* advancedTabLayout = new QGridLayout( d->advancedTab ); advancedTabLayout->setAlignment( Qt::AlignTop ); d->dataModeWidget = new K3b::DataModeWidget( d->advancedTab ); d->checkNoFix = K3b::StdGuiItems::startMultisessionCheckBox( d->advancedTab ); advancedTabLayout->addWidget( new QLabel( i18n("Data mode:"), d->advancedTab ), 0, 0 ); advancedTabLayout->addWidget( d->dataModeWidget, 0, 1 ); advancedTabLayout->addWidget( d->checkNoFix, 1, 0, 1, 3 ); advancedTabLayout->setRowStretch( 2, 1 ); advancedTabLayout->setColumnStretch( 2, 1 ); d->advancedTabIndex = d->optionTabbed->addTab( d->advancedTab, i18n("Advanced") ); d->advancedTabVisible = true; // ----------------------------------------------------------------------- QGridLayout* grid = new QGridLayout( frame ); grid->setContentsMargins( 0, 0, 0, 0 ); grid->addWidget( groupImageUrl, 0, 0 ); grid->addWidget( groupImageType, 0, 1 ); grid->setColumnStretch( 0, 1 ); grid->addWidget( d->infoView, 1, 0, 1, 2 ); grid->addWidget( d->writerSelectionWidget, 2, 0, 1, 2 ); grid->addWidget( d->optionTabbed, 3, 0, 1, 2 ); grid->setRowStretch( 1, 1 ); d->comboImageType->setWhatsThis( i18n("

Image types supported by K3b:

" "

Plain image
" "Plain images are written as is to the medium using " "a single data track. Typical plain images are iso " "images as created by K3b's data project." "

Cue/bin images
" "Cue/bin images consist of a cue file describing the " "table of contents of the medium and an image file " "which contains the actual data. The data will be " "written to the medium according to the cue file." "

Audio Cue image
" "Audio cue images are a special kind of cue/bin image " "containing an image of an audio CD. The actual audio " "data can be encoded using any audio format supported " "by K3b. Audio cue files can also be imported into " - "K3b audio projects which allows to change the order " + "K3b audio projects which allows one to change the order " "and add or remove tracks." "

Cdrecord clone images
" "K3b creates a cdrecord clone image of a single-session " "CD when copying a CD in clone mode. These images can " "be reused here." "

Cdrdao TOC files
" "K3b supports writing cdrdao's own image format, the toc " "files.") ); } void K3b::ImageWritingDialog::slotStartClicked() { d->md5Job->cancel(); // save the path KConfigGroup grp( KSharedConfig::openConfig(), configGroup() ); grp.writePathEntry( "last written image", d->imagePath() ); if( d->imageFile.isEmpty() ) d->imageFile = d->imagePath(); if( d->tocFile.isEmpty() ) d->tocFile = d->imagePath(); // create a progresswidget K3b::BurnProgressDialog dlg( parentWidget() ); // create the job K3b::BurnJob* job = 0; switch( d->currentImageType() ) { case IMAGE_CDRECORD_CLONE: { K3b::CloneJob* _job = new K3b::CloneJob( &dlg, this ); _job->setWriterDevice( d->writerSelectionWidget->writerDevice() ); _job->setImagePath( d->imageFile ); _job->setSimulate( d->checkDummy->isChecked() ); _job->setWriteSpeed( d->writerSelectionWidget->writerSpeed() ); _job->setCopies( d->checkDummy->isChecked() ? 1 : d->spinCopies->value() ); _job->setOnlyBurnExistingImage( true ); job = _job; } break; case IMAGE_AUDIO_CUE: { K3b::AudioCueFileWritingJob* job_ = new K3b::AudioCueFileWritingJob( &dlg, this ); job_->setBurnDevice( d->writerSelectionWidget->writerDevice() ); job_->setSpeed( d->writerSelectionWidget->writerSpeed() ); job_->setSimulate( d->checkDummy->isChecked() ); job_->setWritingMode( d->writingModeWidget->writingMode() ); job_->setCueFile( d->tocFile ); job_->setCopies( d->checkDummy->isChecked() ? 1 : d->spinCopies->value() ); job_->setOnTheFly( !d->checkCacheImage->isChecked() ); job_->setTempDir( d->tempDirSelectionWidget->tempPath() ); job = job_; } break; case IMAGE_CUE_BIN: // for now the K3b::BinImageWritingJob decides if it's a toc or a cue file case IMAGE_CDRDAO_TOC: { K3b::BinImageWritingJob* job_ = new K3b::BinImageWritingJob( &dlg, this ); job_->setWriter( d->writerSelectionWidget->writerDevice() ); job_->setSpeed( d->writerSelectionWidget->writerSpeed() ); job_->setTocFile( d->tocFile ); job_->setSimulate(d->checkDummy->isChecked()); job_->setMulti( false /*d->checkNoFix->isChecked()*/ ); job_->setCopies( d->checkDummy->isChecked() ? 1 : d->spinCopies->value() ); job = job_; } break; case IMAGE_RAW: case IMAGE_ISO: { if (d->currentImageType() == IMAGE_ISO) { K3b::Iso9660 isoFs(d->imageFile); if (isoFs.open()) { if (K3b::filesize(QUrl::fromLocalFile(d->imageFile)) < Private::volumeSpaceSize(isoFs)) { if (KMessageBox::questionYesNo(this, i18n("

The actual file size does not match the size declared in the file header. " "If it has been downloaded make sure the download is complete.

" "

Only continue if you know what you are doing.

"), i18n("Warning"), KStandardGuiItem::cont(), KStandardGuiItem::cancel() ) == KMessageBox::No ) return; } } } // TODO: it needs a NON ISO 9660 images testcase K3b::Iso9660ImageWritingJob* job_ = new K3b::Iso9660ImageWritingJob( &dlg ); job_->setBurnDevice( d->writerSelectionWidget->writerDevice() ); job_->setSpeed( d->writerSelectionWidget->writerSpeed() ); job_->setSimulate( d->checkDummy->isChecked() ); job_->setWritingMode( d->writingModeWidget->writingMode() ); job_->setVerifyData( d->checkVerify->isChecked() ); job_->setNoFix( d->checkNoFix->isChecked() ); job_->setDataMode( d->dataModeWidget->dataMode() ); job_->setImagePath( d->imageFile ); job_->setCopies( d->checkDummy->isChecked() ? 1 : d->spinCopies->value() ); job = job_; } break; default: qDebug() << "(K3b::ImageWritingDialog) this should really not happen!"; break; } if( job ) { job->setWritingApp( d->writerSelectionWidget->writingApp() ); hide(); dlg.startJob(job); delete job; if( KConfigGroup( KSharedConfig::openConfig(), "General Options" ).readEntry( "keep action dialogs open", false ) ) show(); else close(); } } void K3b::ImageWritingDialog::slotUpdateImage( const QString& ) { QString path = d->imagePath(); // check the image types d->haveMd5Sum = false; d->md5Job->cancel(); d->infoView->clear(); //d->infoView->header()->resizeSection( 0, 20 ); d->md5SumItem = 0; d->foundImageType = IMAGE_UNKNOWN; d->tocFile.truncate(0); d->imageFile.truncate(0); QFileInfo info( path ); if( info.isFile() ) { // ------------------------------------------------ // Test for iso9660 image // ------------------------------------------------ K3b::Iso9660 isoF( path ); if( isoF.open() ) { #ifdef K3B_DEBUG isoF.debug(); #endif d->createIso9660InfoItems( &isoF ); isoF.close(); calculateMd5Sum( path ); d->foundImageType = IMAGE_ISO; d->imageFile = path; } if( d->foundImageType == IMAGE_UNKNOWN ) { // check for cdrecord clone image // try both path and path.toc as tocfiles K3b::CloneTocReader cr; if( path.right(4) == ".toc" ) { cr.openFile( path ); if( cr.isValid() ) { d->tocFile = path; d->imageFile = cr.imageFilename(); } } if( d->imageFile.isEmpty() ) { cr.openFile( path + ".toc" ); if( cr.isValid() ) { d->tocFile = cr.filename(); d->imageFile = cr.imageFilename(); } } if( !d->imageFile.isEmpty() ) { // we have a cdrecord clone image d->createCdrecordCloneItems( d->tocFile, d->imageFile ); calculateMd5Sum( d->imageFile ); d->foundImageType = IMAGE_CDRECORD_CLONE; } } if( d->foundImageType == IMAGE_UNKNOWN ) { // check for cue/bin stuff // once again we try both path and path.cue K3b::CueFileParser cp; if( path.right(4).toLower() == ".cue" ) cp.openFile( path ); else if( path.right(4).toLower() == ".bin" ) cp.openFile( path.left( path.length()-3) + "cue" ); if( cp.isValid() ) { d->tocFile = cp.filename(); d->imageFile = cp.imageFilename(); } if( d->imageFile.isEmpty() ) { cp.openFile( path + ".cue" ); if( cp.isValid() ) { d->tocFile = cp.filename(); d->imageFile = cp.imageFilename(); } } if( !d->imageFile.isEmpty() ) { // we have a cue file if( cp.toc().contentType() == K3b::Device::AUDIO ) { d->foundImageType = IMAGE_AUDIO_CUE; d->createAudioCueItems( cp ); } else { d->foundImageType = IMAGE_CUE_BIN; // we cannot be sure if writing will work... :( d->createCueBinItems( d->tocFile, d->imageFile ); calculateMd5Sum( d->imageFile ); } } } if( d->foundImageType == IMAGE_UNKNOWN ) { // TODO: check for cdrdao tocfile } // TODO: treat unusable image to opaque if (d->foundImageType == IMAGE_UNKNOWN) { if (KMessageBox::questionYesNo(this, i18n("Type of image file is not recognizable. Do you want to burn it anyway?"), i18n("Unknown image type")) == KMessageBox::Yes) { d->foundImageType = IMAGE_RAW; d->imageFile = path; } } if( d->foundImageType == IMAGE_UNKNOWN ) { QTreeWidgetItem* item = new QTreeWidgetItem( d->infoView ); if ( !info.isReadable() ) { item->setText( 0, i18n("Unable to read image file") ); } else { item->setText( 0, i18n("Seems not to be a usable image") ); } item->setForeground( 0, d->negativeTextColor ); item->setIcon( 0, QIcon::fromTheme( "dialog-error") ); } else { // remember as recent image int i = 0; while ( i < d->comboRecentImages->count() && d->comboRecentImages->itemText(i) != path ) ++i; if ( i == d->comboRecentImages->count() ) d->comboRecentImages->insertItem( 0, path ); } } else { QTreeWidgetItem* item = new QTreeWidgetItem( d->infoView ); item->setText( 0, i18n("File not found") ); item->setForeground( 0, d->negativeTextColor ); item->setIcon( 0, QIcon::fromTheme( "dialog-error") ); } slotToggleAll(); } void K3b::ImageWritingDialog::toggleAll() { K3b::Medium medium = k3bappcore->mediaCache()->medium( d->writerSelectionWidget->writerDevice() ); // set usable writing apps // for now we only restrict ourselves in case of CD images switch( d->currentImageType() ) { case IMAGE_CDRDAO_TOC: d->writerSelectionWidget->setSupportedWritingApps( K3b::WritingAppCdrdao ); break; case IMAGE_CDRECORD_CLONE: d->writerSelectionWidget->setSupportedWritingApps( K3b::WritingAppCdrecord ); break; default: { K3b::WritingApps apps = K3b::WritingAppCdrecord; if (d->currentImageType() == IMAGE_ISO || d->currentImageType() == IMAGE_RAW) { // DVD/BD is always ISO here apps |= K3b::WritingAppGrowisofs; } if ( K3b::Device::isCdMedia( medium.diskInfo().mediaType() ) ) apps |= K3b::WritingAppCdrdao; d->writerSelectionWidget->setSupportedWritingApps( apps ); break; } } // set a wanted media type // some image types can be put on any medium, some only on CD if (d->currentImageType() == IMAGE_ISO || d->currentImageType() == IMAGE_RAW || d->currentImageType() == IMAGE_UNKNOWN) { d->writerSelectionWidget->setWantedMediumType( K3b::Device::MEDIA_WRITABLE ); } else { d->writerSelectionWidget->setWantedMediumType( K3b::Device::MEDIA_WRITABLE_CD ); } // set wanted image size if (d->currentImageType() == IMAGE_ISO || d->currentImageType() == IMAGE_RAW) d->writerSelectionWidget->setWantedMediumSize( K3b::filesize( QUrl::fromLocalFile(d->imagePath()) )/2048 ); else d->writerSelectionWidget->setWantedMediumSize( Msf() ); // cdrecord clone and cue both need DAO if( d->writerSelectionWidget->writingApp() != K3b::WritingAppCdrdao && ( d->currentImageType() == IMAGE_ISO || d->currentImageType() == IMAGE_AUDIO_CUE ) ) d->writingModeWidget->determineSupportedModesFromMedium( medium ); else d->writingModeWidget->setSupportedModes( K3b::WritingModeSao ); // enable the Write-Button if we found a valid image or the user forced an image type setButtonEnabled( START_BUTTON, d->writerSelectionWidget->writerDevice() && d->currentImageType() != IMAGE_UNKNOWN && QFile::exists( d->imagePath() ) ); // some stuff is only available for iso and opaque images if (d->currentImageType() == IMAGE_ISO || d->currentImageType() == IMAGE_RAW) { d->checkVerify->show(); if( !d->advancedTabVisible ) { d->advancedTabIndex = d->optionTabbed->addTab( d->advancedTab, i18n("Advanced") ); } d->advancedTabVisible = true; if( d->checkDummy->isChecked() ) { d->checkVerify->setEnabled( false ); d->checkVerify->setChecked( false ); } else d->checkVerify->setEnabled( true ); } else { if( d->advancedTabVisible ) { d->optionTabbed->removeTab( d->advancedTabIndex ); } d->advancedTabVisible = false; d->checkVerify->hide(); } // and some other stuff only makes sense for audio cues if( d->currentImageType() == IMAGE_AUDIO_CUE ) { if( !d->tempPathTabVisible ) d->tempPathTabIndex = d->optionTabbed->addTab( d->tempPathTab, i18n("&Image") ); d->tempPathTabVisible = true; d->tempDirSelectionWidget->setDisabled( !d->checkCacheImage->isChecked() ); } else { if( d->tempPathTabVisible ) { d->optionTabbed->removeTab( d->tempPathTabIndex ); } d->tempPathTabVisible = false; } d->checkCacheImage->setVisible( d->currentImageType() == IMAGE_AUDIO_CUE ); d->spinCopies->setEnabled( !d->checkDummy->isChecked() ); if( QTreeWidgetItem* item = d->infoView->topLevelItem( 0 ) ) { item->setForeground( 1, d->currentImageType() != d->foundImageType ? d->negativeTextColor : d->normalTextColor ); } } void K3b::ImageWritingDialog::setImage( const QUrl& url ) { d->imageForced = true; d->editImagePath->setUrl( url ); } void K3b::ImageWritingDialog::calculateMd5Sum( const QString& file ) { d->haveMd5Sum = false; if( !d->md5SumItem ) { d->md5SumItem = new QTreeWidgetItem( d->infoView ); } d->md5SumItem->setText( 0, i18n("MD5 Sum:") ); d->md5SumItem->setForeground( 0, d->infoTextColor ); d->md5SumItem->setTextAlignment( 0, Qt::AlignRight ); if( file != d->lastCheckedFile ) { QProgressBar* progress = new QProgressBar( d->infoView ); progress->setMaximumHeight( fontMetrics().height() ); progress->setRange( 0, 100 ); progress->setValue( 0 ); d->infoView->setItemWidget( d->md5SumItem, 1, progress ); d->lastCheckedFile = file; d->md5Job->setFile( file ); d->md5Job->start(); } else slotMd5JobFinished( true ); } void K3b::ImageWritingDialog::slotMd5JobPercent( int p ) { QWidget* widget = d->infoView->itemWidget( d->md5SumItem, 1 ); if( QProgressBar* progress = qobject_cast( widget ) ) { progress->setValue( p ); } } void K3b::ImageWritingDialog::slotMd5JobFinished( bool success ) { if( success ) { d->md5SumItem->setText( 1, d->md5Job->hexDigest() ); d->md5SumItem->setIcon( 1, QIcon::fromTheme("dialog-information") ); d->haveMd5Sum = true; } else { d->md5SumItem->setForeground( 1, d->negativeTextColor ); if( d->md5Job->hasBeenCanceled() ) d->md5SumItem->setText( 1, i18n("Calculation canceled") ); else d->md5SumItem->setText( 1, i18n("Calculation failed") ); d->md5SumItem->setIcon( 1, QIcon::fromTheme("dialog-error") ); d->lastCheckedFile.truncate(0); } // Hide progress bar d->infoView->setItemWidget( d->md5SumItem, 1, 0 ); } void K3b::ImageWritingDialog::slotContextMenuRequested( const QPoint& pos ) { if( !d->haveMd5Sum ) return; QMenu popup; QAction *copyItem = popup.addAction( i18n("Copy checksum to clipboard") ); QAction *compareItem = popup.addAction( i18n("Compare checksum...") ); QAction *act = popup.exec( d->infoView->mapToGlobal( pos ) ); if( act == compareItem ) { bool ok; QString md5sumToCompare = QInputDialog::getText( this, i18n("MD5 Sum Check"), i18n("Please insert the MD5 Sum to compare:"), QLineEdit::Normal, QString(), &ok ); if( ok ) { if( md5sumToCompare.toLower().toUtf8() == d->md5Job->hexDigest().toLower() ) KMessageBox::information( this, i18n("The MD5 Sum of %1 equals that specified.",d->imagePath()), i18n("MD5 Sums Equal") ); else KMessageBox::sorry( this, i18n("The MD5 Sum of %1 differs from that specified.",d->imagePath()), i18n("MD5 Sums Differ") ); } } else if( act == copyItem ) { QApplication::clipboard()->setText( d->md5Job->hexDigest().toLower(), QClipboard::Clipboard ); } } void K3b::ImageWritingDialog::loadSettings( const KConfigGroup& c ) { d->writingModeWidget->loadConfig( c ); d->checkDummy->setChecked( c.readEntry("simulate", false ) ); d->checkNoFix->setChecked( c.readEntry("multisession", false ) ); d->checkCacheImage->setChecked( !c.readEntry("on_the_fly", true ) ); d->dataModeWidget->loadConfig(c); d->spinCopies->setValue( c.readEntry( "copies", 1 ) ); d->checkVerify->setChecked( c.readEntry( "verify_data", false ) ); d->writerSelectionWidget->loadConfig( c ); if( !d->imageForced ) { QString image = c.readPathEntry( "image path", c.readPathEntry( "last written image", QString() ) ); if( QFile::exists( image ) ) d->editImagePath->setUrl( QUrl::fromLocalFile( image ) ); } QString imageType = c.readEntry( "image type", "auto" ); int x = 0; if( imageType == "iso9660" ) x = d->imageTypeSelectionMapRev[IMAGE_ISO]; else if( imageType == "cue-bin" ) x = d->imageTypeSelectionMapRev[IMAGE_CUE_BIN]; else if( imageType == "audio-cue" ) x = d->imageTypeSelectionMapRev[IMAGE_AUDIO_CUE]; else if( imageType == "cdrecord-clone" ) x = d->imageTypeSelectionMapRev[IMAGE_CDRECORD_CLONE]; else if( imageType == "cdrdao-toc" ) x = d->imageTypeSelectionMapRev[IMAGE_CDRDAO_TOC]; else if (imageType == "opaque") x = d->imageTypeSelectionMapRev[IMAGE_RAW]; d->comboImageType->setCurrentIndex( x ); d->tempDirSelectionWidget->setTempPath( K3b::defaultTempPath() ); slotToggleAll(); } void K3b::ImageWritingDialog::saveSettings( KConfigGroup c ) { d->writingModeWidget->saveConfig( c ), c.writeEntry( "simulate", d->checkDummy->isChecked() ); c.writeEntry( "multisession", d->checkNoFix->isChecked() ); c.writeEntry( "on_the_fly", !d->checkCacheImage->isChecked() ); d->dataModeWidget->saveConfig(c); c.writeEntry( "verify_data", d->checkVerify->isChecked() ); d->writerSelectionWidget->saveConfig( c ); c.writePathEntry( "image path", d->imagePath() ); c.writeEntry( "copies", d->spinCopies->value() ); QString imageType; if( d->comboImageType->currentIndex() == 0 ) imageType = "auto"; else { switch( d->imageTypeSelectionMap[d->comboImageType->currentIndex()] ) { case IMAGE_ISO: imageType = "iso9660"; break; case IMAGE_CUE_BIN: imageType = "cue-bin"; break; case IMAGE_AUDIO_CUE: imageType = "audio-cue"; break; case IMAGE_CDRECORD_CLONE: imageType = "cdrecord-clone"; break; case IMAGE_CDRDAO_TOC: imageType = "cdrdao-toc"; break; case IMAGE_RAW: imageType = "opaque"; break; } } c.writeEntry( "image type", imageType ); if( d->tempDirSelectionWidget->isEnabled() ) d->tempDirSelectionWidget->saveConfig(); } void K3b::ImageWritingDialog::dragEnterEvent( QDragEnterEvent* e ) { e->setAccepted( e->mimeData()->hasUrls() ); } void K3b::ImageWritingDialog::dropEvent( QDropEvent* e ) { QList urls = e->mimeData()->urls(); if( !urls.isEmpty() ) { d->editImagePath->setUrl( urls.first() ); } } diff --git a/src/projects/k3bdirproxymodel.h b/src/projects/k3bdirproxymodel.h index cc79a3b87..eaa616d86 100644 --- a/src/projects/k3bdirproxymodel.h +++ b/src/projects/k3bdirproxymodel.h @@ -1,53 +1,53 @@ /* * Copyright (C) 2009 Gustavo Pichorim Boiko * Copyright (C) 2011 Michal Malek * * This file is part of the K3b project. * Copyright (C) 1998-2009 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef K3BDIRPROXYMODEL_H #define K3BDIRPROXYMODEL_H #include /** * This class is used to show only directories from a specific model. * It is used in the dir panel (of StandardView) to show a directory * tree. * * @author Gustavo Pichorim Boiko */ namespace K3b { class DirProxyModel : public QSortFilterProxyModel { Q_OBJECT public: explicit DirProxyModel( QObject *parent = 0 ); ~DirProxyModel() override; protected: /** - * This function (reimplemented from QSortFilterProxyModel) allows to decide + * This function (reimplemented from QSortFilterProxyModel) allows one to decide * which rows to show. In this specific model we only allow directories to * be shown. */ bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const override; /** * Reimplemented method from QSortFilterProxyModel. Prevents from sorting * top-level elements. Sorting top-level elements is not desirable in MixedView as * we need fixed order of items there (first audio part, second data part) */ bool lessThan( const QModelIndex& left, const QModelIndex& right ) const override; }; } #endif diff --git a/src/projects/k3bvcdburndialog.cpp b/src/projects/k3bvcdburndialog.cpp index 1fe82778a..169c47f3c 100644 --- a/src/projects/k3bvcdburndialog.cpp +++ b/src/projects/k3bvcdburndialog.cpp @@ -1,997 +1,997 @@ /* * * Copyright (C) 2003-2004 Christian Kvasny * Copyright (C) 2008-2009 Sebastian Trueg * * This file is part of the K3b project. * Copyright (C) 1998-2007 Sebastian Trueg * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "k3bvcdburndialog.h" #include "k3bvcddoc.h" #include "k3bvcdoptions.h" #include "k3bdevice.h" #include "k3bcore.h" #include "k3bwriterselectionwidget.h" #include "k3btempdirselectionwidget.h" #include "k3bstdguiitems.h" #include "k3bglobals.h" #include "k3bwritingmodewidget.h" #include "k3bexternalbinmanager.h" #include "k3bvalidators.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include K3b::VcdBurnDialog::VcdBurnDialog( K3b::VcdDoc* _doc, QWidget *parent ) : K3b::ProjectBurnDialog( _doc, parent ) { m_vcdDoc = _doc; prepareGui(); QString vcdType; switch (m_vcdDoc->vcdType()) { case K3b::VcdDoc::VCD11: vcdType = i18n("Video CD (Version 1.1)"); break; case K3b::VcdDoc::VCD20: vcdType = i18n("Video CD (Version 2.0)"); break; case K3b::VcdDoc::SVCD10: vcdType = i18n("Super Video CD"); break; case K3b::VcdDoc::HQVCD: vcdType = i18n("High-Quality Video CD"); break; default: vcdType = i18n("Video CD"); } setTitle( vcdType, i18np( "1 MPEG (%2)", "%1 MPEGs (%2)", m_vcdDoc->tracks() ->count() , KIO::convertSize( m_vcdDoc->size() ) ) ); const K3b::ExternalBin* cdrecordBin = k3bcore->externalBinManager() ->binObject( "cdrecord" ); if ( cdrecordBin && cdrecordBin->hasFeature( "cuefile" ) ) m_writerSelectionWidget->setSupportedWritingApps( K3b::WritingAppCdrdao | K3b::WritingAppCdrecord ); else m_writerSelectionWidget->setSupportedWritingApps( K3b::WritingAppCdrdao ); m_checkCacheImage->hide(); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); m_optionGroupLayout->addItem( spacer ); setupVideoCdTab(); setupLabelTab(); setupAdvancedTab(); connect( m_spinVolumeCount, SIGNAL(valueChanged(int)), this, SLOT(slotSpinVolumeCount()) ); connect( m_buttonGroupVcdFormat, SIGNAL(buttonClicked(int)), this, SLOT(slotVcdTypeClicked(int)) ); connect( m_checkCdiSupport, SIGNAL(toggled(bool)), this, SLOT(slotCdiSupportChecked(bool)) ); connect( m_checkAutoDetect, SIGNAL(toggled(bool)), this, SLOT(slotAutoDetect(bool)) ); connect( m_checkGaps, SIGNAL(toggled(bool)), this, SLOT(slotGapsChecked(bool)) ); // ToolTips // ------------------------------------------------------------------------- m_radioVcd11->setToolTip( i18n( "Select Video CD type %1", QString("(VCD 1.1)") ) ); m_radioVcd20->setToolTip( i18n( "Select Video CD type %1" , QString("(VCD 2.0)" )) ); m_radioSvcd10->setToolTip( i18n( "Select Video CD type %1" , QString("(SVCD 1.0)" )) ); m_radioHqVcd10->setToolTip( i18n( "Select Video CD type %1" , QString("(HQ-VCD 1.0)" )) ); m_checkAutoDetect->setToolTip( i18n( "Automatic video type recognition." ) ); m_checkNonCompliant->setToolTip( i18n( "Non-compliant compatibility mode for broken devices" ) ); m_checkVCD30interpretation->setToolTip( i18n( "Chinese VCD3.0 track interpretation" ) ); m_check2336->setToolTip( i18n( "Use 2336 byte sectors for output" ) ); m_editVolumeId->setToolTip( i18n( "Specify ISO volume label for Video CD" ) ); m_editAlbumId->setToolTip( i18n( "Specify album id for Video CD set" ) ); m_spinVolumeNumber->setToolTip( i18n( "Specify album set sequence number ( <= volume-count )" ) ); m_spinVolumeCount->setToolTip( i18n( "Specify number of volumes in album set" ) ); m_checkCdiSupport->setToolTip( i18n( "Enable CD-i Application Support for Video CD Type 1.1 & 2.0" ) ); m_editCdiCfg->setToolTip( i18n( "Configuration parameters (only for VCD 2.0)" ) ); m_checkPbc->setToolTip( i18n( "Playback control, PBC, is available for Video CD 2.0 and Super Video CD 1.0 disc formats." ) ); m_checkSegmentFolder->setToolTip( i18n( "Add always an empty `/SEGMENT' folder" ) ); m_checkRelaxedAps->setToolTip( i18n( "This controls whether APS constraints are strict or relaxed. " ) ); m_checkUpdateScanOffsets->setToolTip( i18n( "This controls whether to update the scan data information contained in the MPEG-2 video streams." ) ); - m_labelRestriction->setToolTip( i18n( "This element allows to set viewing restrictions which may be interpreted by the playing device." ) ); + m_labelRestriction->setToolTip( i18n( "This element allows one to set viewing restrictions which may be interpreted by the playing device." ) ); m_checkGaps->setToolTip( i18n( "This option allows customization of Gaps and Margins." ) ); m_labelPreGapLeadout->setToolTip( i18n( "Used to set the number of empty sectors added before the lead-out area begins." ) ); m_labelPreGapTrack->setToolTip( i18n( "Used to set the track pre-gap for all tracks in sectors globally." ) ); m_labelFrontMarginTrack->setToolTip( i18n( "Sets the front margin for sequence items." ) ); m_labelRearMarginTrack->setToolTip( i18n( "Sets the rear margin for sequence items." ) ); // What's This info // ------------------------------------------------------------------------- m_radioVcd11->setWhatsThis( i18n( "

This is the most basic Video CD specification dating back to 1993, which has the following characteristics:" "

  • One mode2 mixed form ISO 9660 track containing file pointers to the information areas.
  • " "
  • Up to 98 multiplex-ed MPEG-1 audio/video streams or CD-DA audio tracks.
  • " "
  • Up to 500 MPEG sequence entry points used as chapter divisions.
" "

The Video CD specification requires the multiplex-ed MPEG-1 stream to have a CBR of less than 174300 bytes (1394400 bits) per second in order to accommodate single speed CD-ROM drives.
" "The specification allows for the following two resolutions:" "

  • 352 x 240 @ 29.97 Hz (NTSC SIF).
  • " "
  • 352 x 240 @ 23.976 Hz (FILM SIF).
" "

The CBR MPEG-1, layer II audio stream is fixed at 224 kbps with 1 stereo or 2 mono channels." "

It is recommended to keep the video bit-rate under 1151929.1 bps." ) ); m_radioVcd20->setWhatsThis( i18n( "

About two years after the Video CD 1.1 specification came out, an improved Video CD 2.0 standard was published in 1995." "

This one added the following items to the features already available in the Video CD 1.1 specification:" "

  • Support for MPEG segment play items (\"SPI\"), consisting of still pictures, motion pictures and/or audio (only) streams was added.
  • " "
  • Note Segment Items::.
  • " "
  • Support for interactive playback control (\"PBC\") was added.
  • " "
  • Support for playing related access by providing a scan point index file was added. (\"/EXT/SCANDATA.DAT\")
  • " "
  • Support for closed captions.
  • " "
  • Support for mixing NTSC and PAL content.
" "

By adding PAL support to the Video CD 1.1 specification, the following resolutions became available:" "

  • 352 x 240 @ 29.97 Hz (NTSC SIF).
  • " "
  • 352 x 240 @ 23.976 Hz (FILM SIF).
  • " "
  • 352 x 288 @ 25 Hz (PAL SIF).
" "

For segment play items the following audio encodings became available:" "

  • Joint stereo, stereo or dual channel audio streams at 128, 192, 224 or 384 kbit/sec bit-rate.
  • " "
  • Mono audio streams at 64, 96 or 192 kbit/sec bit-rate.
" "

Also the possibility to have audio only streams and still pictures was provided." "

The bit-rate of multiplex-ed streams should be kept under 174300 bytes/sec (except for single still picture items) in order to accommodate single speed drives." ) ); m_radioSvcd10->setWhatsThis( i18n( "

With the upcoming of the DVD-V media, a new VCD standard had to be published in order to be able to keep up with technology, so the Super Video CD specification was called into life 1999." "

In the midst of 2000 a full subset of this Super Video CD specification was published as IEC-62107." "

As the most notable change over Video CD 2.0 is a switch from MPEG-1 CBR to MPEG-2 VBR encoding for the video stream was performed." "

The following new features--building upon the Video CD 2.0 specification--are:" "

  • Use of MPEG-2 encoding instead of MPEG-1 for the video stream.
  • " "
  • Allowed VBR encoding of MPEG-1 audio stream.
  • " "
  • Higher resolutions (see below) for video stream resolution.
  • " "
  • Up to 4 overlay graphics and text (\"OGT\") sub-channels for user switchable subtitle displaying in addition to the already existing closed caption facility.
  • " "
  • Command lists for controlling the SVCD virtual machine.
" "

For the Super Video CD, only the following two resolutions are supported for motion video and (low resolution) still pictures:" "

  • 480 x 480 @ 29.97 Hz (NTSC 2/3 D-2).
  • " "
  • 480 x 576 @ 25 Hz (PAL 2/3 D-2).
" ) ); m_radioHqVcd10->setWhatsThis( i18n( "

This is actually just a minor variation defined in IEC-62107 on the Super Video CD 1.0 format for compatibility with current products in the market." "

It differs from the Super Video CD 1.0 format in the following items:" "

  • The system profile tag field in /SVCD/INFO.SVD is set to 1 instead of 0.
  • " "
  • The system identification field value in /SVCD/INFO.SVD is set to HQ-VCD instead of SUPERVCD.
  • " "
  • /EXT/SCANDATA.DAT is mandatory instead of being optional.
  • " "
  • /SVCD/SEARCH.DAT is optional instead of being mandatory.
" ) ); m_checkAutoDetect->setWhatsThis( i18n( "

If Autodetect is:

" "
  • ON then K3b will set the correct Video CD type.
  • " "
  • OFF then the correct Video CD type needs to be set by the user.
" "

If you are not sure about the correct Video CD type, it is best to turn Autodetect ON.

" "

If you want to force the Video CD type, you must turn Autodetect OFF. This is useful for some standalone DVD players without SVCD support.

" ) ); m_checkNonCompliant->setWhatsThis( i18n( "
  • Rename \"/MPEG2\" folder on SVCDs to (non-compliant) \"/MPEGAV\".
  • " "
  • Enables the use of the (deprecated) signature \"ENTRYSVD\" instead of \"ENTRYVCD\" for the file \"/SVCD/ENTRY.SVD\".
" ) ); m_checkVCD30interpretation->setWhatsThis( i18n( "
  • Enables the use of the (deprecated) Chinese \"/SVCD/TRACKS.SVD\" format which differs from the format defined in the IEC-62107 specification.
" "

The differences are most exposed on SVCDs containing more than one video track." ) ); m_check2336->setWhatsThis( i18n( "

though most devices will have problems with such an out-of-specification media." "

You may want use this option for images longer than 80 minutes" ) ); m_checkCdiSupport->setWhatsThis( i18n( "

To allow the play of Video-CDs on a CD-i player, the Video-CD standard requires that a CD-i application program must be present." "

This program is designed to:" "

  • provide full play back control as defined in the PSD of the standard
  • " "
  • be extremely simple to use and easy-to-learn for the end-user
" "

The program runs on CD-i players equipped with the CDRTOS 1.1(.1) operating system and a Digital Video extension cartridge." ) ); m_editCdiCfg->setWhatsThis( i18n( "

Configuration parameters only available for Video CD 2.0" "

The engine works perfectly well when used as-is." "

You have the option to configure the VCD application." "

You can adapt the color and/or the shape of the cursor and lots more." ) ); m_checkPbc->setWhatsThis( i18n( "

Playback control, PBC, is available for Video CD 2.0 and Super Video CD 1.0 disc formats." "

PBC allows control of the playback of play items and the possibility of interaction with the user through the remote control or some other input device available." ) ); m_checkSegmentFolder->setWhatsThis( i18n( "

Here you can specify that the folder SEGMENT should always be present." "

Some DVD players need the folder to give a faultless rendition." ) ); m_checkRelaxedAps->setWhatsThis( i18n( "

An Access Point Sector, APS, is an MPEG video sector on the VCD/SVCD which is suitable to be jumped to directly." "

APS are required for entry points and scantables. APS have to fulfil the requirement to precede every I-frame by a GOP header which shall be preceded by a sequence header in its turn." "

The start codes of these 3 items are required to be contained all in the same MPEG pack/sector, thus forming a so-called access point sector." "

This requirement can be relaxed by enabling the relaxed aps option, i.e. every sector containing an I-frame will be regarded as an APS." "

Warning: The sequence header is needed for a playing device to figure out display parameters, such as display resolution and frame rate, relaxing the aps requirement may lead to non-working entry points." ) ); m_checkUpdateScanOffsets->setWhatsThis( i18n( "

According to the specification, it is mandatory for Super Video CDs to encode scan information data into user data blocks in the picture layer of all intra coded picture." "

It can be used by playing devices for implementing fast forward & fast reverse scanning." "

The already existing scan information data can be updated by enabling the update scan offsets option." ) ); m_labelRestriction->setWhatsThis( i18n( "

Viewing Restriction may be interpreted by the playing device." "

The allowed range goes from 0 to 3." "

  • 0 = unrestricted, free to view for all
  • " "
  • 3 = restricted, content not suitable for ages under 18
" "

Actually, the exact meaning is not defined and is player dependant." "

Most players ignore that value." ) ); m_checkGaps->setWhatsThis( i18n( "

This option allows customization of Gaps and Margins." ) ); - m_labelPreGapLeadout->setWhatsThis( i18n( "

This option allows to set the number of empty sectors added before the lead-out area begins, i.e. the number of post-gap sectors." + m_labelPreGapLeadout->setWhatsThis( i18n( "

This option allows one to set the number of empty sectors added before the lead-out area begins, i.e. the number of post-gap sectors." "

The ECMA-130 specification requires the last data track before the lead-out to carry a post-gap of at least 150 sectors, which is used as default for this parameter." "

Some operating systems may encounter I/O errors due to read-ahead issues when reading the last MPEG track if this parameter is set too low." "

Allowed value content: [0..300]. Default: 150." ) ); m_labelPreGapTrack->setWhatsThis( i18n( "

Used to set the track pre-gap for all tracks in sectors globally." "

The specification requires the pre-gaps to be at least 150 sectors long." "

Allowed value content: [0..300]. Default: 150." ) ); m_labelFrontMarginTrack->setWhatsThis( i18n( "Margins are used to compensate for inaccurate sector-addressing issues on CD-ROM media. Interestingly, they have been abandoned for Super Video CDs." "

For Video CD 1.0/1.1/2.0 this margin should be at least 15 sectors long." "

Allowed value content: [0..150]. Default: 30 for Video CD 1.0/1.1/2.0, otherwise (i.e. Super Video CD 1.0 and HQ-VCD 1.0) 0." ) ); m_labelRearMarginTrack->setWhatsThis( i18n( "

Margins are used to compensate for inaccurate sector-addressing issues on CD-ROM media. Interestingly, they have been abandoned for Super Video CDs." "

For Video CD 1.0/1.1/2.0 this margin should be at least 15 sectors long." "

Allowed value content: [0..150]. Default: 45 for Video CD 1.0/1.1/2.0, otherwise 0." ) ); } K3b::VcdBurnDialog::~VcdBurnDialog() {} void K3b::VcdBurnDialog::setupAdvancedTab() { QWidget * w = new QWidget( this ); // ---------------------------------------------------- generic group ---- m_groupGeneric = new QGroupBox( i18n( "Generic" ), w ); m_checkPbc = new QCheckBox( i18n( "Playback Control (PBC)" ), m_groupGeneric ); m_checkSegmentFolder = new QCheckBox( i18n( "SEGMENT Folder must always be present" ), m_groupGeneric ); m_checkRelaxedAps = new QCheckBox( i18n( "Relaxed aps" ), m_groupGeneric ); m_checkUpdateScanOffsets = new QCheckBox( i18n( "Update scan offsets" ), m_groupGeneric ); m_checkUpdateScanOffsets->setEnabled( false ); QVBoxLayout* groupGenericLayout = new QVBoxLayout( m_groupGeneric ); groupGenericLayout->addWidget( m_checkPbc ); groupGenericLayout->addWidget( m_checkSegmentFolder ); groupGenericLayout->addWidget( m_checkRelaxedAps ); groupGenericLayout->addWidget( m_checkUpdateScanOffsets ); // -------------------------------------------- gaps & margins group ---- m_groupGaps = new QGroupBox( i18n( "Gaps" ), w ); QGridLayout* groupGapsLayout = new QGridLayout( m_groupGaps ); groupGapsLayout->setAlignment( Qt::AlignTop ); m_checkGaps = new QCheckBox( i18n( "Customize gaps and margins" ), m_groupGaps ); m_labelPreGapLeadout = new QLabel( i18n( "Leadout pre gap (0..300):" ), m_groupGaps ); m_spinPreGapLeadout = new QSpinBox( m_groupGaps ); m_spinPreGapLeadout->setMinimum( 0 ); m_spinPreGapLeadout->setMaximum( 300 ); m_labelPreGapTrack = new QLabel( i18n( "Track pre gap (0..300):" ), m_groupGaps ); m_spinPreGapTrack = new QSpinBox( m_groupGaps ); m_spinPreGapTrack->setMinimum( 0 ); m_spinPreGapTrack->setMaximum( 300 ); m_labelFrontMarginTrack = new QLabel( i18n( "Track front margin (0..150):" ), m_groupGaps ); m_spinFrontMarginTrack = new QSpinBox( m_groupGaps ); m_spinFrontMarginTrack->setMinimum( 0 ); m_spinFrontMarginTrack->setMaximum( 150 ); m_spinFrontMarginTrackSVCD = new QSpinBox( m_groupGaps ); m_spinFrontMarginTrackSVCD->setMinimum( 0 ); m_spinFrontMarginTrackSVCD->setMaximum( 150 ); m_spinFrontMarginTrackSVCD->setHidden( true ); m_labelRearMarginTrack = new QLabel( i18n( "Track rear margin (0..150):" ), m_groupGaps ); m_spinRearMarginTrack = new QSpinBox( m_groupGaps ); m_spinRearMarginTrack->setMinimum( 0 ); m_spinRearMarginTrack->setMaximum( 150 ); m_spinRearMarginTrackSVCD = new QSpinBox( m_groupGaps ); m_spinRearMarginTrackSVCD->setMinimum( 0 ); m_spinRearMarginTrackSVCD->setMaximum( 150 ); m_spinRearMarginTrackSVCD->setHidden( true ); groupGapsLayout->addWidget( m_checkGaps, 1, 0, 1, 5 ); groupGapsLayout->addWidget( m_labelPreGapLeadout, 2, 0 ); groupGapsLayout->addWidget( m_spinPreGapLeadout, 2, 1 ); groupGapsLayout->addWidget( m_labelPreGapTrack, 2, 3 ); groupGapsLayout->addWidget( m_spinPreGapTrack, 2, 4 ); groupGapsLayout->addWidget( m_labelFrontMarginTrack, 3, 0 ); groupGapsLayout->addWidget( m_spinFrontMarginTrack, 3, 1 ); groupGapsLayout->addWidget( m_spinFrontMarginTrackSVCD, 3, 1 ); groupGapsLayout->addWidget( m_labelRearMarginTrack, 3, 3 ); groupGapsLayout->addWidget( m_spinRearMarginTrack, 3, 4 ); groupGapsLayout->addWidget( m_spinRearMarginTrackSVCD, 3, 4 ); groupGapsLayout->setRowStretch( 4, 0 ); groupGapsLayout->addWidget( m_checkGaps, 1, 0, 1, 5 ); groupGapsLayout->addWidget( m_labelPreGapLeadout, 2, 0 ); groupGapsLayout->addWidget( m_spinPreGapLeadout, 2, 1 ); groupGapsLayout->addWidget( m_labelPreGapTrack, 2, 3 ); groupGapsLayout->addWidget( m_spinPreGapTrack, 2, 4 ); groupGapsLayout->addWidget( m_labelFrontMarginTrack, 3, 0 ); groupGapsLayout->addWidget( m_spinFrontMarginTrack, 3, 1 ); groupGapsLayout->addWidget( m_spinFrontMarginTrackSVCD, 3, 1 ); groupGapsLayout->addWidget( m_labelRearMarginTrack, 3, 3 ); groupGapsLayout->addWidget( m_spinRearMarginTrack, 3, 4 ); groupGapsLayout->addWidget( m_spinRearMarginTrackSVCD, 3, 4 ); groupGapsLayout->setRowStretch( 4, 0 ); groupGapsLayout->addWidget( m_checkGaps, 1, 0, 1, 5 ); groupGapsLayout->addWidget( m_labelPreGapLeadout, 2, 0 ); groupGapsLayout->addWidget( m_spinPreGapLeadout, 2, 1 ); groupGapsLayout->addWidget( m_labelPreGapTrack, 2, 3 ); groupGapsLayout->addWidget( m_spinPreGapTrack, 2, 4 ); groupGapsLayout->addWidget( m_labelFrontMarginTrack, 3, 0 ); groupGapsLayout->addWidget( m_spinFrontMarginTrack, 3, 1 ); groupGapsLayout->addWidget( m_spinFrontMarginTrackSVCD, 3, 1 ); groupGapsLayout->addWidget( m_labelRearMarginTrack, 3, 3 ); groupGapsLayout->addWidget( m_spinRearMarginTrack, 3, 4 ); groupGapsLayout->addWidget( m_spinRearMarginTrackSVCD, 3, 4 ); groupGapsLayout->setRowStretch( 4, 0 ); groupGapsLayout->addWidget( m_checkGaps, 1, 0, 1, 5 ); groupGapsLayout->addWidget( m_labelPreGapLeadout, 2, 0 ); groupGapsLayout->addWidget( m_spinPreGapLeadout, 2, 1 ); groupGapsLayout->addWidget( m_labelPreGapTrack, 2, 3 ); groupGapsLayout->addWidget( m_spinPreGapTrack, 2, 4 ); groupGapsLayout->addWidget( m_labelFrontMarginTrack, 3, 0 ); groupGapsLayout->addWidget( m_spinFrontMarginTrack, 3, 1 ); groupGapsLayout->addWidget( m_spinFrontMarginTrackSVCD, 3, 1 ); groupGapsLayout->addWidget( m_labelRearMarginTrack, 3, 3 ); groupGapsLayout->addWidget( m_spinRearMarginTrack, 3, 4 ); groupGapsLayout->addWidget( m_spinRearMarginTrackSVCD, 3, 4 ); groupGapsLayout->setRowStretch( 4, 0 ); // ------------------------------------------------------- misc group ---- m_groupMisc = new QGroupBox( i18n( "Misc" ), w ); QGridLayout* groupMiscLayout = new QGridLayout( m_groupMisc ); groupMiscLayout->setAlignment( Qt::AlignTop ); m_labelRestriction = new QLabel( i18n( "Restriction category (0..3):" ), m_groupMisc ); m_spinRestriction = new QSpinBox( m_groupMisc ); m_spinRestriction->setMinimum( 0 ); m_spinRestriction->setMaximum( 3 ); groupMiscLayout->addWidget( m_labelRestriction, 1, 0 ); groupMiscLayout->addWidget( m_spinRestriction, 1, 1, 1, 4 ); groupMiscLayout->setRowStretch( 2, 0 ); // ---------------------------------------------------------------------- QGridLayout* grid = new QGridLayout( w ); grid->addWidget( m_groupGeneric, 0, 0 ); grid->addWidget( m_groupGaps, 1, 0 ); grid->addWidget( m_groupMisc, 2, 0 ); addPage( w, i18n( "Advanced" ) ); } void K3b::VcdBurnDialog::setupVideoCdTab() { QWidget * w = new QWidget( this ); // ---------------------------------------------------- Format group ---- m_groupVcdFormat = new QGroupBox( i18n( "Type" ), w ); m_radioVcd11 = new QRadioButton( i18n( "Video CD 1.1" ), m_groupVcdFormat ); m_radioVcd20 = new QRadioButton( i18n( "Video CD 2.0" ), m_groupVcdFormat ); m_radioSvcd10 = new QRadioButton( i18n( "Super Video CD" ), m_groupVcdFormat ); m_radioHqVcd10 = new QRadioButton( i18n( "HQ Video CD" ), m_groupVcdFormat ); m_buttonGroupVcdFormat = new QButtonGroup( m_groupVcdFormat ); m_buttonGroupVcdFormat->setExclusive( true ); m_buttonGroupVcdFormat->addButton( m_radioVcd11, K3b::VcdDoc::VCD11); m_buttonGroupVcdFormat->addButton( m_radioVcd20, K3b::VcdDoc::VCD20 ); m_buttonGroupVcdFormat->addButton( m_radioSvcd10, K3b::VcdDoc::SVCD10); m_buttonGroupVcdFormat->addButton( m_radioHqVcd10,K3b::VcdDoc::HQVCD ); QVBoxLayout* groupVcdFormatLayout = new QVBoxLayout( m_groupVcdFormat ); groupVcdFormatLayout->addWidget( m_radioVcd11 ); groupVcdFormatLayout->addWidget( m_radioVcd20 ); groupVcdFormatLayout->addWidget( m_radioSvcd10 ); groupVcdFormatLayout->addWidget( m_radioHqVcd10 ); // ---------------------------------------------------- Options group --- m_groupOptions = new QGroupBox( i18n( "Settings" ), w ); m_checkAutoDetect = new QCheckBox( i18n( "Autodetect Video CD type" ), m_groupOptions ); m_checkNonCompliant = new QCheckBox( i18n( "Enable broken SVCD mode" ), m_groupOptions ); // Only available on SVCD Type m_checkNonCompliant->setEnabled( false ); m_checkNonCompliant->setChecked( false ); m_checkVCD30interpretation = new QCheckBox( i18n( "Enable %1 track interpretation" , QString("VCD 3.0") ), m_groupOptions ); // Only available on SVCD Type m_checkVCD30interpretation->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_check2336 = new QCheckBox( i18n( "Use 2336 byte sectors" ), m_groupOptions ); m_checkCdiSupport = new QCheckBox( i18n( "Enable CD-i support" ), m_groupOptions ); QVBoxLayout* groupOptionsLayout = new QVBoxLayout( m_groupOptions ); groupOptionsLayout->addWidget( m_checkAutoDetect ); groupOptionsLayout->addWidget( m_checkNonCompliant ); groupOptionsLayout->addWidget( m_checkVCD30interpretation ); groupOptionsLayout->addWidget( m_check2336 ); groupOptionsLayout->addWidget( m_checkCdiSupport ); // ------------------------------------------------- CD-i Application --- m_groupCdi = new QGroupBox( i18n( "Video CD on CD-i" ), w ); m_editCdiCfg = new QTextEdit( m_groupCdi ); m_editCdiCfg->setFrameShape( QFrame::NoFrame ); QVBoxLayout* groupCdiLayout = new QVBoxLayout( m_groupCdi ); groupCdiLayout->addWidget( m_editCdiCfg ); // ---------------------------------------------------------------------- QGridLayout* grid = new QGridLayout( w ); grid->addWidget( m_groupVcdFormat, 0, 0, 2, 1 ); grid->addWidget( m_groupOptions, 0, 1 ); grid->addWidget( m_groupCdi, 1, 1 ); addPage( w, i18n( "Settings" ) ); } void K3b::VcdBurnDialog::setupLabelTab() { QWidget * w = new QWidget( this ); // ---------------------------------------------------------------------- // noEdit QLabel* labelSystemId = new QLabel( i18n( "System:" ), w ); QLabel* labelApplicationId = new QLabel( i18n( "Application:" ), w ); QLabel* labelInfoSystemId = new QLabel( vcdDoc() ->vcdOptions() ->systemId(), w ); QLabel* labelInfoApplicationId = new QLabel( vcdDoc() ->vcdOptions() ->applicationId(), w ); labelInfoSystemId->setFrameShape( QLabel::StyledPanel ); labelInfoSystemId->setFrameShadow( QLabel::Sunken ); labelInfoApplicationId->setFrameShape( QLabel::StyledPanel ); labelInfoApplicationId->setFrameShadow( QLabel::Sunken ); labelInfoApplicationId->setToolTip( i18n( "ISO application identifier for Video CD" ) ); // ---------------------------------------------------------------------- QLabel* labelVolumeId = new QLabel( i18n( "&Volume name:" ), w ); QLabel* labelAlbumId = new QLabel( i18n( "Volume &set name:" ), w ); QLabel* labelVolumeCount = new QLabel( i18n( "Volume set s&ize:" ), w ); QLabel* labelVolumeNumber = new QLabel( i18n( "Volume set &number:" ), w ); QLabel* labelPublisher = new QLabel( i18n( "&Publisher:" ), w ); m_editVolumeId = new QLineEdit( w ); m_editAlbumId = new QLineEdit( w ); m_spinVolumeNumber = new QSpinBox( w ); m_spinVolumeCount = new QSpinBox( w ); m_editPublisher = new QLineEdit( w ); // only ISO646 d-Characters m_editVolumeId->setValidator( K3b::Validators::iso646Validator( K3b::Validators::Iso646_d, true, m_editVolumeId ) ); m_editAlbumId->setValidator( K3b::Validators::iso646Validator( K3b::Validators::Iso646_d, true, m_editVolumeId ) ); m_editVolumeId->setMaxLength( 32 ); m_editAlbumId->setMaxLength( 16 ); // only ISO646 a-Characters m_editPublisher->setValidator( K3b::Validators::iso646Validator( K3b::Validators::Iso646_a, true, m_editVolumeId ) ); m_editPublisher->setMaxLength( 128 ); m_spinVolumeNumber->setMinimum( 1 ); m_spinVolumeNumber->setMaximum( 1 ); m_spinVolumeCount->setMinimum( 1 ); QFrame* line = new QFrame( w ); line->setFrameShape( QFrame::HLine ); line->setFrameShadow( QFrame::Sunken ); line->setFrameShape( QFrame::HLine ); // ---------------------------------------------------------------------- QGridLayout* grid = new QGridLayout( w ); grid->addWidget( labelVolumeId, 1, 0 ); grid->addWidget( m_editVolumeId, 1, 1, 1, 3 ); grid->addWidget( labelAlbumId, 2, 0 ); grid->addWidget( m_editAlbumId, 2, 1, 1, 3 ); grid->addWidget( labelVolumeCount, 3, 0 ); grid->addWidget( m_spinVolumeCount, 3, 1 ); grid->addWidget( labelVolumeNumber, 3, 2 ); grid->addWidget( m_spinVolumeNumber, 3, 3 ); grid->addWidget( labelPublisher, 4, 0 ); grid->addWidget( m_editPublisher, 4, 1, 1, 3 ); grid->addWidget( line, 5, 0, 1, 4 ); grid->addWidget( labelSystemId, 6, 0 ); grid->addWidget( labelInfoSystemId, 6, 1, 1, 3 ); grid->addWidget( labelApplicationId, 7, 0 ); grid->addWidget( labelInfoApplicationId, 7, 1, 1, 3 ); // grid->addRowSpacing( 5, 15 ); grid->setRowStretch( 8, 1 ); // buddies labelVolumeId->setBuddy( m_editVolumeId ); labelPublisher->setBuddy( m_editPublisher ); labelAlbumId->setBuddy( m_editAlbumId ); labelVolumeCount->setBuddy( m_spinVolumeCount ); labelVolumeNumber->setBuddy( m_spinVolumeNumber ); // tab order setTabOrder( m_editVolumeId, m_editAlbumId ); setTabOrder( m_editAlbumId, m_spinVolumeCount ); setTabOrder( m_spinVolumeCount, m_spinVolumeNumber ); setTabOrder( m_spinVolumeNumber, m_editPublisher ); addPage( w, i18n( "Volume Descriptor" ) ); } void K3b::VcdBurnDialog::slotStartClicked() { if ( QFile::exists( vcdDoc() ->vcdImage() ) ) { if ( KMessageBox::warningContinueCancel( this, i18n( "Do you want to overwrite %1?" , vcdDoc() ->vcdImage() ), i18n( "File Exists" ), KStandardGuiItem::overwrite() ) != KMessageBox::Continue ) return; } K3b::ProjectBurnDialog::slotStartClicked(); } void K3b::VcdBurnDialog::saveSettingsToProject() { K3b::ProjectBurnDialog::saveSettingsToProject(); // set VolumeID if empty setVolumeID(); doc() ->setTempDir( m_tempDirSelectionWidget->tempPath() ); doc() ->setOnTheFly( false ); // save image file & path (.bin) vcdDoc() ->setVcdImage( m_tempDirSelectionWidget->tempPath() + '/' + m_editVolumeId->text() + ".bin" ); vcdDoc() ->setVcdType( m_radioVcd11->group()->id( m_radioVcd11->group()->checkedButton() ) ); vcdDoc() ->vcdOptions() ->setVolumeId( m_editVolumeId->text() ); vcdDoc() ->vcdOptions() ->setPublisher( m_editPublisher->text() ); vcdDoc() ->vcdOptions() ->setAlbumId( m_editAlbumId->text() ); vcdDoc() ->vcdOptions() ->setAutoDetect( m_checkAutoDetect->isChecked() ); vcdDoc() ->vcdOptions() ->setNonCompliantMode( m_checkNonCompliant->isChecked() ); vcdDoc() ->vcdOptions() ->setVCD30interpretation( m_checkVCD30interpretation->isChecked() ); vcdDoc() ->vcdOptions() ->setSector2336( m_check2336->isChecked() ); vcdDoc() ->vcdOptions() ->setCdiSupport( m_checkCdiSupport->isChecked() ); // vcdDoc() ->setOnlyCreateImages( m_checkOnlyCreateImage->isChecked() ); vcdDoc() ->vcdOptions() ->setVolumeNumber( m_spinVolumeNumber->value() ); vcdDoc() ->vcdOptions() ->setVolumeCount( m_spinVolumeCount->value() ); vcdDoc() ->vcdOptions() ->setPbcEnabled( m_checkPbc->isChecked() ); if ( m_checkPbc->isChecked() ) vcdDoc() -> setPbcTracks(); vcdDoc() ->vcdOptions() ->setSegmentFolder( m_checkSegmentFolder->isChecked() ); vcdDoc() ->vcdOptions() ->setRelaxedAps( m_checkRelaxedAps->isChecked() ); vcdDoc() ->vcdOptions() ->setUpdateScanOffsets( m_checkUpdateScanOffsets->isChecked() ); vcdDoc() ->vcdOptions() ->setRestriction( m_spinRestriction->value() ); vcdDoc() ->vcdOptions() ->setUseGaps( m_checkGaps->isChecked() ); vcdDoc() ->vcdOptions() ->setPreGapLeadout( m_spinPreGapLeadout->value() ); vcdDoc() ->vcdOptions() ->setPreGapTrack( m_spinPreGapTrack->value() ); vcdDoc() ->vcdOptions() ->setFrontMarginTrack( m_spinFrontMarginTrack->value() ); vcdDoc() ->vcdOptions() ->setRearMarginTrack( m_spinRearMarginTrack->value() ); vcdDoc() ->vcdOptions() ->setFrontMarginTrackSVCD( m_spinFrontMarginTrackSVCD->value() ); vcdDoc() ->vcdOptions() ->setRearMarginTrackSVCD( m_spinRearMarginTrackSVCD->value() ); if ( m_editCdiCfg->document()->isModified() ) saveCdiConfig(); } void K3b::VcdBurnDialog::readSettingsFromProject() { K3b::ProjectBurnDialog::readSettingsFromProject(); m_checkNonCompliant->setEnabled( false ); m_checkVCD30interpretation->setEnabled( false ); // read vcdType switch ( ( ( K3b::VcdDoc* ) doc() ) ->vcdType() ) { case K3b::VcdDoc::VCD11: m_radioVcd11->setChecked( true ); break; case K3b::VcdDoc::VCD20: m_radioVcd20->setChecked( true ); break; case K3b::VcdDoc::SVCD10: m_radioSvcd10->setChecked( true ); m_checkNonCompliant->setEnabled( true ); m_checkVCD30interpretation->setEnabled( true ); break; case K3b::VcdDoc::HQVCD: m_radioHqVcd10->setChecked( true ); break; default: m_radioVcd20->setChecked( true ); break; } m_spinVolumeCount->setValue( vcdDoc() ->vcdOptions() ->volumeCount() ); m_spinVolumeNumber->setMaximum( vcdDoc() ->vcdOptions() ->volumeCount() ); m_spinVolumeNumber->setValue( vcdDoc() ->vcdOptions() ->volumeNumber() ); m_checkAutoDetect->setChecked( vcdDoc() ->vcdOptions() ->AutoDetect() ); m_groupVcdFormat->setDisabled( vcdDoc() ->vcdOptions() ->AutoDetect() ); m_check2336->setChecked( vcdDoc() ->vcdOptions() ->Sector2336() ); m_checkCdiSupport->setEnabled( false ); m_checkCdiSupport->setChecked( false ); m_groupCdi->setEnabled( false ); if ( m_radioSvcd10->isChecked() ) { m_checkNonCompliant->setChecked( vcdDoc() ->vcdOptions() ->NonCompliantMode() ); m_checkUpdateScanOffsets->setEnabled( true ); m_checkVCD30interpretation->setChecked( vcdDoc() ->vcdOptions() ->VCD30interpretation() ); } else if ( m_radioHqVcd10->isChecked() ) { // NonCompliant only for SVCD m_checkNonCompliant->setChecked( false ); m_checkNonCompliant->setEnabled( false ); m_checkUpdateScanOffsets->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkVCD30interpretation->setEnabled( false ); } else { // NonCompliant only for SVCD m_checkNonCompliant->setChecked( false ); m_checkNonCompliant->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkUpdateScanOffsets->setEnabled( false ); m_checkVCD30interpretation->setEnabled( false ); // CD-I only for VCD and CD-i application was found :) if ( vcdDoc() ->vcdOptions() ->checkCdiFiles() ) { m_checkCdiSupport->setEnabled( true ); m_checkCdiSupport->setChecked( vcdDoc() ->vcdOptions() ->CdiSupport() ); } } // set VolumeID if empty setVolumeID(); // m_editVolumeId->setText( vcdDoc() ->vcdOptions() ->volumeId() ); m_editPublisher->setText( vcdDoc() ->vcdOptions() ->publisher() ); m_editAlbumId->setText( vcdDoc() ->vcdOptions() ->albumId() ); m_checkPbc->setChecked( vcdDoc() ->vcdOptions() ->PbcEnabled() ); m_checkSegmentFolder->setChecked( vcdDoc() ->vcdOptions() ->SegmentFolder() ); m_checkRelaxedAps->setChecked( vcdDoc() ->vcdOptions() ->RelaxedAps() ); m_checkUpdateScanOffsets->setChecked( vcdDoc() ->vcdOptions() ->UpdateScanOffsets() ); m_spinRestriction->setValue( vcdDoc() ->vcdOptions() ->Restriction() ); m_checkGaps->setChecked( vcdDoc() ->vcdOptions() ->UseGaps() ); slotGapsChecked( m_checkGaps->isChecked() ) ; m_spinPreGapLeadout->setValue( vcdDoc() ->vcdOptions() ->PreGapLeadout() ); m_spinPreGapTrack->setValue( vcdDoc() ->vcdOptions() ->PreGapTrack() ); m_spinFrontMarginTrack->setValue( vcdDoc() ->vcdOptions() ->FrontMarginTrack() ); m_spinRearMarginTrack->setValue( vcdDoc() ->vcdOptions() ->RearMarginTrack() ); m_spinFrontMarginTrackSVCD->setValue( vcdDoc() ->vcdOptions() ->FrontMarginTrackSVCD() ); m_spinRearMarginTrackSVCD->setValue( vcdDoc() ->vcdOptions() ->RearMarginTrackSVCD() ); if ( !doc() ->tempDir().isEmpty() ) m_tempDirSelectionWidget->setTempPath( doc() ->tempDir() ); loadCdiConfig(); } void K3b::VcdBurnDialog::loadSettings( const KConfigGroup& c ) { K3b::ProjectBurnDialog::loadSettings( c ); K3b::VcdOptions o = K3b::VcdOptions::load( c ); m_checkAutoDetect->setChecked( o.AutoDetect() ); m_check2336->setChecked( o.Sector2336() ); m_checkCdiSupport->setChecked( false ); m_checkCdiSupport->setEnabled( false ); m_groupCdi->setEnabled( false ); if ( m_radioSvcd10->isChecked() ) { m_checkNonCompliant->setChecked( o.NonCompliantMode() ); m_checkVCD30interpretation->setChecked( o.VCD30interpretation() ); } else { m_checkNonCompliant->setChecked( false ); m_checkNonCompliant->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkVCD30interpretation->setEnabled( false ); if ( vcdDoc() ->vcdOptions() ->checkCdiFiles() ) { m_checkCdiSupport->setEnabled( true ); m_checkCdiSupport->setChecked( o.CdiSupport() ); } } m_spinVolumeCount->setValue( o.volumeCount() ); m_spinVolumeNumber->setMaximum( o.volumeCount() ); m_spinVolumeNumber->setValue( o.volumeNumber() ); m_editVolumeId->setText( o.volumeId() ); m_editPublisher->setText( o.publisher() ); m_editAlbumId->setText( o.albumId() ); m_checkPbc->setChecked( o.PbcEnabled() ); m_checkSegmentFolder->setChecked( o.SegmentFolder() ); m_checkRelaxedAps->setChecked( o.RelaxedAps() ); m_checkUpdateScanOffsets->setChecked( o.UpdateScanOffsets() ); m_spinRestriction->setValue( o.Restriction() ); m_checkGaps->setChecked( o.UseGaps() ); m_spinPreGapLeadout->setValue( o.PreGapLeadout() ); m_spinPreGapTrack->setValue( o.PreGapTrack() ); m_spinFrontMarginTrack->setValue( o.FrontMarginTrack() ); m_spinRearMarginTrack->setValue( o.RearMarginTrack() ); m_spinFrontMarginTrackSVCD->setValue( o.FrontMarginTrackSVCD() ); m_spinRearMarginTrackSVCD->setValue( o.RearMarginTrackSVCD() ); loadCdiConfig(); } void K3b::VcdBurnDialog::saveSettings( KConfigGroup c ) { K3b::ProjectBurnDialog::saveSettings( c ); K3b::VcdOptions o; o.setVolumeId( m_editVolumeId->text() ); o.setPublisher( m_editPublisher->text() ); o.setAlbumId( m_editAlbumId->text() ); o.setAutoDetect( m_checkAutoDetect->isChecked() ); o.setNonCompliantMode( m_checkNonCompliant->isChecked() ); o.setVCD30interpretation( m_checkVCD30interpretation->isChecked() ); o.setSector2336( m_check2336->isChecked() ); o.setVolumeCount( m_spinVolumeCount->value() ); o.setVolumeNumber( m_spinVolumeNumber->value() ); o.setCdiSupport( m_checkCdiSupport->isChecked() ); o.setPbcEnabled( m_checkPbc->isChecked() ); o.setSegmentFolder( m_checkSegmentFolder->isChecked() ); o.setRelaxedAps( m_checkRelaxedAps->isChecked() ); o.setUpdateScanOffsets( m_checkUpdateScanOffsets->isChecked() ); o.setRestriction( m_spinRestriction->value() ); o.setUseGaps( m_checkGaps->isChecked() ); o.setPreGapLeadout( m_spinPreGapLeadout->value() ); o.setPreGapTrack( m_spinPreGapTrack->value() ); o.setFrontMarginTrack( m_spinFrontMarginTrack->value() ); o.setRearMarginTrack( m_spinRearMarginTrack->value() ); o.setFrontMarginTrackSVCD( m_spinFrontMarginTrackSVCD->value() ); o.setRearMarginTrackSVCD( m_spinRearMarginTrackSVCD->value() ); o.save( c ); saveCdiConfig(); } void K3b::VcdBurnDialog::saveCdiConfig() { QString dirPath = QStandardPaths::writableLocation( QStandardPaths::DataLocation ) + "/cdi"; QDir().mkpath( dirPath ); QString filename = dirPath + "/cdi_vcd.cfg"; if ( QFile::exists( filename ) ) QFile::remove ( filename ); QFile cdi( filename ); if ( cdi.open( QIODevice::WriteOnly ) ) { QTextStream s( &cdi ); s << m_editCdiCfg->toPlainText(); m_editCdiCfg->document()->setModified( false ); } } void K3b::VcdBurnDialog::loadCdiConfig() { QString filename = QStandardPaths::writableLocation( QStandardPaths::DataLocation ) + "/cdi/cdi_vcd.cfg"; if ( QFile::exists( filename ) ) { QFile cdi( filename ); if ( cdi.open( QIODevice::ReadOnly ) ) { QTextStream s( &cdi ); m_editCdiCfg->setPlainText( s.readAll() ); m_editCdiCfg->document()->setModified( false ); m_groupCdi->setEnabled( m_checkCdiSupport->isChecked() ); } else { loadDefaultCdiConfig(); } } else { loadDefaultCdiConfig(); } } void K3b::VcdBurnDialog::loadDefaultCdiConfig() { QString filename = QStandardPaths::locate( QStandardPaths::GenericDataLocation, "k3b/cdi/cdi_vcd.cfg" ); if ( QFile::exists( filename ) ) { QFile cdi( filename ); if ( cdi.open( QIODevice::ReadOnly ) ) { QTextStream s( &cdi ); m_editCdiCfg->setPlainText( s.readAll() ); m_editCdiCfg->document()->setModified( false ); m_groupCdi->setEnabled( m_checkCdiSupport->isChecked() ); } else { m_checkCdiSupport->setChecked( false ); m_checkCdiSupport->setEnabled( false ); } } } void K3b::VcdBurnDialog::setVolumeID() { if ( m_editVolumeId->text().length() < 1 ) { if ( m_radioSvcd10->isChecked() ) m_editVolumeId->setText( "SUPER_VIDEOCD" ); else if ( m_radioHqVcd10->isChecked() ) m_editVolumeId->setText( "HQ_VIDEOCD" ); else m_editVolumeId->setText( "VIDEOCD" ); } } void K3b::VcdBurnDialog::slotSpinVolumeCount() { m_spinVolumeNumber->setMaximum( m_spinVolumeCount->value() ); } void K3b::VcdBurnDialog::slotVcdTypeClicked( K3b::VcdOptions::MPEGVersion i ) { switch ( i ) { case K3b::VcdOptions::VCD11: // vcd 1.1 no support for version 3.x. // v4 work also for vcd 1.1 but without CD-i menus. // Do anybody use vcd 1.1 with cd-i???? m_checkCdiSupport->setEnabled( vcdDoc() ->vcdOptions() ->checkCdiFiles() ); m_checkCdiSupport->setChecked( false ); m_checkNonCompliant->setEnabled( false ); m_checkNonCompliant->setChecked( false ); m_checkVCD30interpretation->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkUpdateScanOffsets->setEnabled( false ); m_checkUpdateScanOffsets->setChecked( false ); break; case K3b::VcdOptions::VCD20: //vcd 2.0 m_checkCdiSupport->setEnabled( vcdDoc() ->vcdOptions() ->checkCdiFiles() ); m_groupCdi->setEnabled( m_checkCdiSupport->isChecked() ); m_checkNonCompliant->setEnabled( false ); m_checkNonCompliant->setChecked( false ); m_checkVCD30interpretation->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkUpdateScanOffsets->setEnabled( false ); m_checkUpdateScanOffsets->setChecked( false ); break; case K3b::VcdOptions::SVCD10: //svcd 1.0 m_checkCdiSupport->setEnabled( false ); m_checkCdiSupport->setChecked( false ); m_groupCdi->setEnabled( false ); m_checkNonCompliant->setEnabled( true ); m_checkVCD30interpretation->setEnabled( true ); m_checkUpdateScanOffsets->setEnabled( true ); break; case K3b::VcdOptions::HQVCD10: //hqvcd 1.0 m_checkCdiSupport->setEnabled( false ); m_checkCdiSupport->setChecked( false ); m_groupCdi->setEnabled( false ); m_checkNonCompliant->setEnabled( false ); m_checkNonCompliant->setChecked( false ); m_checkVCD30interpretation->setEnabled( false ); m_checkVCD30interpretation->setChecked( false ); m_checkUpdateScanOffsets->setEnabled( true ); break; } MarginChecked( m_checkGaps->isChecked() ); } void K3b::VcdBurnDialog::slotGapsChecked( bool b ) { m_labelPreGapLeadout->setEnabled( b ); m_spinPreGapLeadout->setEnabled( b ); m_labelPreGapTrack->setEnabled( b ); m_spinPreGapTrack->setEnabled( b ); MarginChecked( b ); } void K3b::VcdBurnDialog::MarginChecked( bool b ) { if ( m_radioSvcd10->isChecked() || m_radioHqVcd10->isChecked() ) { m_spinFrontMarginTrack->setHidden( true ); m_spinFrontMarginTrackSVCD->setHidden( false ); m_spinRearMarginTrack->setHidden( true ); m_spinRearMarginTrackSVCD->setHidden( false ); } else { m_spinFrontMarginTrack->setHidden( false ); m_spinFrontMarginTrackSVCD->setHidden( true ); m_spinRearMarginTrack->setHidden( false ); m_spinRearMarginTrackSVCD->setHidden( true ); } m_labelFrontMarginTrack->setEnabled( b ); m_spinFrontMarginTrack->setEnabled( b ); m_spinFrontMarginTrackSVCD->setEnabled( b ); m_labelRearMarginTrack->setEnabled( b ); m_spinRearMarginTrack->setEnabled( b ); m_spinRearMarginTrackSVCD->setEnabled( b ); } void K3b::VcdBurnDialog::slotCdiSupportChecked( bool b ) { m_groupCdi->setEnabled( b ); } void K3b::VcdBurnDialog::slotAutoDetect( bool b ) { if ( b ) { switch( vcdDoc() ->vcdOptions() ->mpegVersion() ) { case K3b::VcdOptions::VCD11: m_radioVcd11->setChecked( true ); break; case K3b::VcdOptions::VCD20: m_radioVcd20->setChecked( true ); break; case K3b::VcdOptions::SVCD10: m_radioSvcd10->setChecked( true ); break; case K3b::VcdOptions::HQVCD10: m_radioHqVcd10->setChecked( true ); break; } slotVcdTypeClicked( vcdDoc() ->vcdOptions() ->mpegVersion() ); } m_groupVcdFormat->setDisabled( b ); } void K3b::VcdBurnDialog::toggleAll() { K3b::ProjectBurnDialog::toggleAll(); m_writingModeWidget->setSupportedModes( K3b::WritingModeSao ); m_checkRemoveBufferFiles->setDisabled( m_checkOnlyCreateImage->isChecked() ); } diff --git a/src/rip/base_k3baudiorippingoptionwidget.ui b/src/rip/base_k3baudiorippingoptionwidget.ui index 861fa884a..64d5588a1 100644 --- a/src/rip/base_k3baudiorippingoptionwidget.ui +++ b/src/rip/base_k3baudiorippingoptionwidget.ui @@ -1,289 +1,289 @@ Sebastian Trueg base_K3bAudioRippingOptionWidget 0 0 436 189 Filetype 1 0 Configure Plugin ... Options Create playlist for the ripped files <p>If this option is checked K3b will create a playlist of the ripped files which can be used with programs like Amarok or JuK. <p>You may use the special strings to give the playlist a unique filename. Create m&3u playlist Qt::Horizontal QSizePolicy::Fixed 20 1 false Use relative paths instead of absolute <p>If this option is checked, the entries in the playlist will be relative to its location. <p>Example: If your playlist is located in <em>/home/myself/music</em> and your audio files are in <em>/home/myself/music/cool</em>; then the entries in the playlist will look something like: <em>cool/track1.ogg</em>. &Use relative paths Rip all tracks to a single file <p>If this option is checked K3b will create only one audio file no matter how many tracks are ripped. This file will contain all tracks one after the other. <p>This might be useful to rip a live album or a radio play. <p><b>Caution:</b> The file will have the name made from playlist pattern. Create si&ngle file Qt::Horizontal QSizePolicy::Fixed 20 1 false Write a cuefile - <p>If this option is checked K3b will create a CDRWIN cue file which allows to easily write a copy of the audio CD on other systems. + <p>If this option is checked K3b will create a CDRWIN cue file which allows one to easily write a copy of the audio CD on other systems. Write &cue file Qt::Vertical 1 1 0 1 Target Folder Free space in directory: false - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Space needed: false - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false KUrlRequester QFrame

kurlrequester.h
KComboBox QComboBox
kcombobox.h
kurlrequester.h m_checkCreatePlaylist toggled(bool) m_checkPlaylistRelative setEnabled(bool) 20 20 20 20 m_checkSingleFile toggled(bool) m_checkWriteCueFile setEnabled(bool) 20 20 20 20