38
40
void devices_add_device(const gchar *device_name, const gchar * /*device_id*/,
39
41
const gchar *device_node, const gint capabilities)
41
// нам нужны резаки DVD
42
if( capabilities & DC_WRITE_DVDR )
44
// - информация доступна об устройстве
46
if( device_name && (capabilities & DC_WRITE_DVDR) )
44
48
//io::cout << "model = " << device_name << ", dev = " << device_node
45
49
// << ", capabilities = " << capabilities << ", device_id = " << device_id << io::endl;
87
91
boost::regex WriteSpeed_RE("Write Speed #"RG_NUM":"RG_SPS RG_NUM"\\."RG_NUM "x1385");
89
93
RefPtr<Gtk::ListStore> sp_store;
90
Gtk::TreeModelColumn<double> dbl_cln;
91
Gtk::TreeModelColumn<std::string> str_cln;
92
const char* UpdateSpeedsEntry = "Update speeds ...";
97
setNONE = 0, // по умолчанию
98
setUPDATE = 1, // "Update speeds ..."
103
Gtk::TreeModelColumn<double> dbl_cln;
104
Gtk::TreeModelColumn<std::string> str_cln;
105
Gtk::TreeModelColumn<SpeedEntryType> type_cln;
108
SpeedFields(Gtk::TreeModelColumnRecord& rec)
116
static SpeedFields& SF()
118
return GetColumnFields<SpeedFields>();
94
121
bool SeparatorFunc(const RefPtr<Gtk::TreeModel>&, const Gtk::TreeIter& itr)
96
return itr->get_value(str_cln) == "separator";
123
return itr->get_value(SF().str_cln) == "separator";
99
126
static void SetupSpeeds(Gtk::ComboBox& speed_btn)
103
Gtk::TreeModelColumnRecord columns;
104
Gtk::TreeModelColumn<double> dbl_cln_;
106
Gtk::TreeModelColumn<std::string> str_cln_;
108
columns.add(dbl_cln);
109
columns.add(str_cln);
129
sp_store = Gtk::ListStore::create(GetColumnRecord<SpeedFields>());
111
sp_store = Gtk::ListStore::create(columns);
113
131
speed_btn.set_model(sp_store);
114
132
speed_btn.set_row_separator_func(&SeparatorFunc);
117
speed_btn.pack_start(str_cln);
135
speed_btn.pack_start(SF().str_cln);
120
138
bool IsBurnerSetup(std::string& dev_path)
173
191
ASSERT( sp_store );
175
193
sp_store->clear();
194
SpeedFields& sf = SF();
177
196
Gtk::TreeRow row = *sp_store->append();
178
row[str_cln] = "Auto";
197
row[sf.str_cln] = _("Auto");
179
198
speed_btn.set_active(row);
181
200
for( SpeedsArray::iterator itr = speeds.begin(), end = speeds.end(); itr != end; ++itr )
183
202
Gtk::TreeRow row = *sp_store->append();
185
row[str_cln] = boost::lexical_cast<std::string>(*itr) + "\303\227";
203
row[sf.dbl_cln] = *itr;
204
row[sf.str_cln] = boost::lexical_cast<std::string>(*itr) + "\303\227";
187
206
row = *sp_store->append();
188
row[str_cln] = "separator";
207
row[sf.str_cln] = "separator";
189
208
row = *sp_store->append();
190
row[str_cln] = UpdateSpeedsEntry;
209
row[sf.str_cln] = _("Update speeds ...");
210
row[sf.type_cln] = setUPDATE;
331
351
case dvdCD_DRIVE_ONLY:
332
352
try_again = Gtk::RESPONSE_OK ==
333
MessageBox("Selected burn drive is for CD discs only. Change to another burn drive.",
353
MessageBox(_("Selected burn drive is for CD discs only. Change to another burn drive."),
334
354
Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK_CANCEL, "", true);
337
357
try_again = Gtk::RESPONSE_OK ==
338
MessageBox("CD disc is found in the drive, not DVD. Change to DVD disc.",
358
MessageBox(_("CD disc is found in the drive, not DVD. Change to DVD disc."),
339
359
Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK_CANCEL, "", true);
341
361
case dvdEMPTY_DRIVE:
342
362
try_again = Gtk::RESPONSE_OK ==
343
MessageBox("No DVD disc in the drive. Load a clear one and press OK.",
363
MessageBox(_("No DVD disc in the drive. Load a clear one and press OK."),
344
364
Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK_CANCEL, "", true);
347
367
try_again = Gtk::RESPONSE_OK ==
348
MessageBox("Disc with type \"" + inf.name + "\" is found in the drive but "
368
MessageBox(BF_("Disc with type \"%1%\" is found in the drive but "
349
369
"for DVD-Video disc type should be one from: DVD-R, DVD+R, DVD-RW, DVD+RW. "
350
"Load a clear one with right type and press OK.",
370
"Load a clear one with right type and press OK.") % inf.name % bf::stop,
351
371
Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK_CANCEL, "", true);
354
374
ASSERT( (inf.typ == dvdR) || (inf.typ == dvdRW) );
355
375
if( inf.typ == dvdR && !inf.isBlank )
356
376
try_again = Gtk::RESPONSE_OK ==
357
MessageBox("Disc with type \"" + inf.name + "\" in the drive is not clear. Only clear recordable "
358
"discs can be used for burning DVD-Video. Load a clear one and press OK.",
377
MessageBox(BF_("Disc with type \"%1%\" in the drive is not clear. Only clear recordable "
378
"discs can be used for burning DVD-Video. Load a clear one and press OK.") % inf.name % bf::stop,
359
379
Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK_CANCEL, "", true);
362
382
if( inf.typ == dvdRW && !inf.isBlank )
364
std::string title = "Disc with type \"" + inf.name + "\" in the drive is not clear."
365
" We need to remove its contents before writing new one. Continue?";
384
std::string title = BF_("Disc with type \"%1%\" in the drive is not clear."
385
" We need to remove its contents before writing new one. Continue?") % inf.name % bf::stop;
366
386
Gtk::MessageDialog dlg(MakeMessageBoxTitle(title), true, Gtk::MESSAGE_INFO, Gtk::BUTTONS_NONE);
368
dlg.add_button("_Cancel", Gtk::RESPONSE_CANCEL);
369
dlg.add_button("_Try again", Gtk::RESPONSE_REJECT);
388
dlg.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);
389
dlg.add_button(_("_Try again"), Gtk::RESPONSE_REJECT);
370
390
dlg.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
371
391
dlg.set_default_response(Gtk::RESPONSE_OK);