1 /*
2     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "k3bstdguiitems.h"
8 #include "k3b_i18n.h"
9 
10 #include <QPalette>
11 #include <QCheckBox>
12 #include <QComboBox>
13 #include <QFrame>
14 #include <QToolTip>
15 
16 
simulateCheckbox(QWidget * parent)17 QCheckBox* K3b::StdGuiItems::simulateCheckbox( QWidget* parent )
18 {
19     QCheckBox* c = new QCheckBox( i18n("Simulate"), parent );
20     c->setWhatsThis( i18n("<p>If this option is checked K3b will perform all writing steps with the "
21                           "laser turned off."
22                           "<p>This is useful, for example, to test a higher writing speed "
23                           "or whether your system is able to write on-the-fly."
24                           "<p><b>Caution:</b> DVD+R(W) does not support simulated writing.") );
25     c->setToolTip( i18n("Only simulate the writing process") );
26     return c;
27 }
28 
daoCheckbox(QWidget * parent)29 QCheckBox* K3b::StdGuiItems::daoCheckbox( QWidget* parent )
30 {
31     QCheckBox* c = new QCheckBox( i18n("Disk at once"), parent );
32     c->setWhatsThis( i18n("<p>If this option is checked, K3b will write the CD in 'disk at once' mode as "
33                           "compared to 'track at once' (TAO)."
34                           "<p>It is always recommended to use DAO where possible."
35                           "<p><b>Caution:</b> Track pregaps with a length other than 2 seconds are only supported "
36                           "in DAO mode.") );
37     c->setToolTip( i18n("Write in disk at once mode") );
38     return c;
39 }
40 
burnproofCheckbox(QWidget * parent)41 QCheckBox* K3b::StdGuiItems::burnproofCheckbox( QWidget* parent )
42 {
43     QCheckBox* c = new QCheckBox( i18n("Use Burnfree"), parent );
44     c->setToolTip( i18n("Enable Burnfree (or Just Link) to avoid buffer underruns") );
45     c->setWhatsThis( i18n("<p>If this option is checked, K3b enables <em>Burnfree</em> "
46                           "(or <em>Just Link</em>). This is "
47                           "a feature of the CD writer which avoids buffer underruns."
48                           "<p>Without <em>burnfree</em>, if the writer cannot get any more "
49                           "data a buffer underrun would occur, since the writer needs "
50                           "a constant stream of data to write the CD."
51                           "<p>With <em>burnfree</em> the writer can <em>mark</em> the current "
52                           "position of the laser and get back to it when the buffer is filled again; "
53                           "but, since this means having little data gaps on the CD, <b>it is "
54                           "highly recommended to always choose an appropriate writing "
55                           "speed to prevent the usage of burnfree, especially for audio CDs</b> "
56                           "(in the worst case one would hear the gap)."
57                           "<p><em>Burnfree</em> was formerly known as <em>Burnproof</em>, "
58                           "but has since been renamed when it became part of the MMC standard.") );
59     return c;
60 }
61 
onlyCreateImagesCheckbox(QWidget * parent)62 QCheckBox* K3b::StdGuiItems::onlyCreateImagesCheckbox( QWidget* parent )
63 {
64     QCheckBox* c = new QCheckBox( i18n("Only create image"), parent );
65     c->setWhatsThis( i18n("<p>If this option is checked, K3b will only create an "
66                           "image and not do any actual writing."
67                           "<p>The image can later be written to a CD/DVD with most current writing "
68                           "programs (including K3b of course).") );
69     c->setToolTip( i18n("Only create an image") );
70     return c;
71 }
72 
createCacheImageCheckbox(QWidget * parent)73 QCheckBox* K3b::StdGuiItems::createCacheImageCheckbox( QWidget* parent )
74 {
75     QCheckBox* c = new QCheckBox( i18n("Create image"), parent );
76     c->setWhatsThis( i18n("<p>If this option is checked, K3b will create an image before writing "
77                           "the files to the CD/DVD. Otherwise the data will be written <em>on-the-fly</em>, "
78                           "i.e. no intermediate image will be created."
79                           "<p><b>Caution:</b> Although writing on-the-fly should work on most systems, make sure "
80                           "the data is sent to the writer fast enough.")
81                      + i18n("<p>It is recommended to try a simulation first.") );
82     c->setToolTip( i18n("Cache the data to be written on the harddisk") );
83     return c;
84 }
85 
removeImagesCheckbox(QWidget * parent)86 QCheckBox* K3b::StdGuiItems::removeImagesCheckbox( QWidget* parent )
87 {
88     QCheckBox* c = new QCheckBox( i18n("Remove image"), parent );
89     c->setWhatsThis( i18n("<p>If this option is checked, K3b will remove any created images after the "
90                           "writing has finished."
91                           "<p>Uncheck this if you want to keep the images.") );
92     c->setToolTip( i18n("Remove images from disk when finished") );
93     return c;
94 }
95 
onTheFlyCheckbox(QWidget * parent)96 QCheckBox* K3b::StdGuiItems::onTheFlyCheckbox( QWidget* parent )
97 {
98     QCheckBox* c = new QCheckBox( i18n("On the fly"), parent );
99     c->setWhatsThis( i18n("<p>If this option is checked, K3b will not create an image first but write "
100                           "the files directly to the CD/DVD."
101                           "<p><b>Caution:</b> Although this should work on most systems, make sure "
102                           "the data is sent to the writer fast enough.")
103                      + i18n("<p>It is recommended to try a simulation first.") );
104     c->setToolTip( i18n("Write files directly to CD/DVD without creating an image") );
105     return c;
106 }
107 
cdTextCheckbox(QWidget * parent)108 QCheckBox* K3b::StdGuiItems::cdTextCheckbox( QWidget* parent )
109 {
110     QCheckBox* c = new QCheckBox( i18n("Write CD-Text"), parent );
111     c->setToolTip( i18n("Create CD-Text entries") );
112     c->setWhatsThis( i18n("<p>If this option is checked K3b uses some otherwise-unused space on the audio "
113                           "CD to store additional information, such as the artist's name, or the CD title."
114                           "<p>CD-Text is an extension to the audio CD standard introduced by Sony."
115                           "<p>CD-Text will only be usable on CD players that support this extension "
116                           "(mostly car CD players)."
117                           "<p>Since a CD-Text-enhanced CD will work in any CD player it is never a bad "
118                           "idea to enable this (if you specify CD-Text data.)") );
119     return c;
120 }
121 
122 
paranoiaModeComboBox(QWidget * parent)123 QComboBox* K3b::StdGuiItems::paranoiaModeComboBox( QWidget* parent )
124 {
125     QComboBox* c = new QComboBox( parent );
126     c->addItem( "0" );
127     c->addItem( "1" );
128     c->addItem( "2" );
129     c->addItem( "3" );
130     c->setCurrentIndex( 3 );
131     c->setToolTip( i18n("Set the paranoia level for reading audio CDs") );
132     c->setWhatsThis( i18n("<p>Sets the correction mode for digital audio extraction."
133                           "<ul><li>0: No checking, data is copied directly from the drive. "
134                           "<li>1: Perform overlapped reading to avoid jitter.</li>"
135                           "<li>2: Like 1 but with additional checks of the read audio data.</li>"
136                           "<li>3: Like 2 but with additional scratch detection and repair.</li></ul>"
137                           "<p><b>The extraction speed reduces from 0 to 3.</b>") );
138     return c;
139 }
140 
141 
startMultisessionCheckBox(QWidget * parent)142 QCheckBox* K3b::StdGuiItems::startMultisessionCheckBox( QWidget* parent )
143 {
144     QCheckBox* c = new QCheckBox( i18n("Start multisession CD"), parent );
145     c->setToolTip( i18n("Do not close the disk to allow additional sessions to be added later") );
146     c->setWhatsThis( i18n("<p>If this option is checked K3b will not close the CD, and will write "
147                           "a temporary table of contents.</p>"
148                           "<p>This allows further sessions to be appended to the CD later.</p>") );
149     return c;
150 }
151 
152 
normalizeCheckBox(QWidget * parent)153 QCheckBox* K3b::StdGuiItems::normalizeCheckBox( QWidget* parent )
154 {
155     QCheckBox* c = new QCheckBox( i18n("Normalize volume levels"), parent );
156     c->setToolTip( i18n("Adjust the volume levels of all tracks") );
157     c->setWhatsThis( i18n("<p>If this option is checked K3b will adjust the volume of all tracks "
158                           "to a standard level. This is useful for things like creating mixes, "
159                           "where different recording levels on different albums can cause the volume "
160                           "to vary greatly from song to song."
161                           "<p><b>Be aware that K3b currently does not support normalizing when writing "
162                           "on the fly.</b>") );
163     return c;
164 }
165 
166 
verifyCheckBox(QWidget * parent)167 QCheckBox* K3b::StdGuiItems::verifyCheckBox( QWidget* parent )
168 {
169     QCheckBox* c = new QCheckBox( i18n("Verify written data"), parent );
170     c->setToolTip( i18n("Compare original with written data") );
171     c->setWhatsThis( i18n("<p>If this option is checked, then after successfully "
172                           "writing the disk K3b will compare the original source data "
173                           "with the written data to verify that the disk has been written "
174                           "correctly.") );
175     return c;
176 }
177 
178 
ignoreAudioReadErrorsCheckBox(QWidget * parent)179 QCheckBox* K3b::StdGuiItems::ignoreAudioReadErrorsCheckBox( QWidget* parent )
180 {
181     QCheckBox* c = new QCheckBox( i18n("Ignore read errors"), parent );
182     c->setToolTip( i18n("Skip unreadable audio sectors") );
183     c->setWhatsThis( i18n("<p>If this option is checked and K3b is not able to read an "
184                           "audio sector from the source CD it will be replaced with zeros "
185                           "on the resulting copy."
186                           "<p>Since audio CD Player are able to interpolate small errors "
187                           "in the data it is no problem to let K3b skip unreadable sectors.") );
188     return c;
189 }
190 
191 
horizontalLine(QWidget * parent)192 QFrame* K3b::StdGuiItems::horizontalLine( QWidget* parent )
193 {
194     QFrame* line = new QFrame( parent );
195     line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
196     return line;
197 }
198 
verticalLine(QWidget * parent)199 QFrame* K3b::StdGuiItems::verticalLine( QWidget* parent )
200 {
201     QFrame* line = new QFrame( parent );
202     line->setFrameStyle( QFrame::VLine | QFrame::Sunken );
203     return line;
204 }
205