1 |
/* |
/* |
2 |
* Copyright (C) 2006-2015 Andreas Persson |
* Copyright (C) 2006-2016 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
20 |
#include <iostream> |
#include <iostream> |
21 |
#include <cstring> |
#include <cstring> |
22 |
|
|
23 |
|
#include <glibmmconfig.h> |
24 |
|
// threads.h must be included first to be able to build with |
25 |
|
// G_DISABLE_DEPRECATED |
26 |
|
#if (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION == 31 && GLIBMM_MICRO_VERSION >= 2) || \ |
27 |
|
(GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION > 31) || GLIBMM_MAJOR_VERSION > 2 |
28 |
|
#include <glibmm/threads.h> |
29 |
|
#endif |
30 |
|
|
31 |
#include <glibmm/convert.h> |
#include <glibmm/convert.h> |
32 |
#include <glibmm/dispatcher.h> |
#include <glibmm/dispatcher.h> |
33 |
#include <glibmm/miscutils.h> |
#include <glibmm/miscutils.h> |
35 |
#include <gtkmm/aboutdialog.h> |
#include <gtkmm/aboutdialog.h> |
36 |
#include <gtkmm/filechooserdialog.h> |
#include <gtkmm/filechooserdialog.h> |
37 |
#include <gtkmm/messagedialog.h> |
#include <gtkmm/messagedialog.h> |
|
#include <gtkmm/stock.h> |
|
38 |
#include <gtkmm/targetentry.h> |
#include <gtkmm/targetentry.h> |
39 |
#include <gtkmm/main.h> |
#include <gtkmm/main.h> |
40 |
#include <gtkmm/toggleaction.h> |
#include <gtkmm/toggleaction.h> |
117 |
actionGroup = Gtk::ActionGroup::create(); |
actionGroup = Gtk::ActionGroup::create(); |
118 |
|
|
119 |
actionGroup->add(Gtk::Action::create("MenuFile", _("_File"))); |
actionGroup->add(Gtk::Action::create("MenuFile", _("_File"))); |
120 |
actionGroup->add(Gtk::Action::create("New", Gtk::Stock::NEW), |
actionGroup->add(Gtk::Action::create("New", _("_New")), |
121 |
|
Gtk::AccelKey("<control>n"), |
122 |
sigc::mem_fun( |
sigc::mem_fun( |
123 |
*this, &MainWindow::on_action_file_new)); |
*this, &MainWindow::on_action_file_new)); |
124 |
Glib::RefPtr<Gtk::Action> action = |
actionGroup->add(Gtk::Action::create("Open", _("_Open...")), |
125 |
Gtk::Action::create("Open", Gtk::Stock::OPEN); |
Gtk::AccelKey("<control>o"), |
|
action->property_label() = action->property_label() + "..."; |
|
|
actionGroup->add(action, |
|
126 |
sigc::mem_fun( |
sigc::mem_fun( |
127 |
*this, &MainWindow::on_action_file_open)); |
*this, &MainWindow::on_action_file_open)); |
128 |
actionGroup->add(Gtk::Action::create("Save", Gtk::Stock::SAVE), |
actionGroup->add(Gtk::Action::create("Save", _("_Save")), |
129 |
|
Gtk::AccelKey("<control>s"), |
130 |
sigc::mem_fun( |
sigc::mem_fun( |
131 |
*this, &MainWindow::on_action_file_save)); |
*this, &MainWindow::on_action_file_save)); |
132 |
action = Gtk::Action::create("SaveAs", Gtk::Stock::SAVE_AS); |
actionGroup->add(Gtk::Action::create("SaveAs", _("Save _As...")), |
|
action->property_label() = action->property_label() + "..."; |
|
|
actionGroup->add(action, |
|
133 |
Gtk::AccelKey("<shift><control>s"), |
Gtk::AccelKey("<shift><control>s"), |
134 |
sigc::mem_fun( |
sigc::mem_fun( |
135 |
*this, &MainWindow::on_action_file_save_as)); |
*this, &MainWindow::on_action_file_save_as)); |
136 |
actionGroup->add(Gtk::Action::create("Properties", |
actionGroup->add(Gtk::Action::create("Properties", |
137 |
Gtk::Stock::PROPERTIES), |
_("_Properties")), |
138 |
sigc::mem_fun( |
sigc::mem_fun( |
139 |
*this, &MainWindow::on_action_file_properties)); |
*this, &MainWindow::on_action_file_properties)); |
140 |
actionGroup->add(Gtk::Action::create("InstrProperties", |
actionGroup->add(Gtk::Action::create("InstrProperties", |
141 |
Gtk::Stock::PROPERTIES), |
_("_Properties")), |
142 |
sigc::mem_fun( |
sigc::mem_fun( |
143 |
*this, &MainWindow::show_instr_props)); |
*this, &MainWindow::show_instr_props)); |
144 |
actionGroup->add(Gtk::Action::create("MidiRules", |
actionGroup->add(Gtk::Action::create("MidiRules", |
149 |
_("_Script Slots...")), |
_("_Script Slots...")), |
150 |
sigc::mem_fun( |
sigc::mem_fun( |
151 |
*this, &MainWindow::show_script_slots)); |
*this, &MainWindow::show_script_slots)); |
152 |
actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT), |
actionGroup->add(Gtk::Action::create("Quit", _("_Quit")), |
153 |
|
Gtk::AccelKey("<control>q"), |
154 |
sigc::mem_fun( |
sigc::mem_fun( |
155 |
*this, &MainWindow::on_action_quit)); |
*this, &MainWindow::on_action_quit)); |
156 |
actionGroup->add( |
actionGroup->add( |
197 |
sigc::mem_fun(*this, &MainWindow::on_action_refresh_all) |
sigc::mem_fun(*this, &MainWindow::on_action_refresh_all) |
198 |
); |
); |
199 |
|
|
200 |
action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP); |
actionGroup->add(Gtk::Action::create("MenuHelp", _("_Help"))); |
201 |
actionGroup->add(Gtk::Action::create("MenuHelp", |
actionGroup->add(Gtk::Action::create("About", _("_About")), |
|
action->property_label())); |
|
|
actionGroup->add(Gtk::Action::create("About", Gtk::Stock::ABOUT), |
|
202 |
sigc::mem_fun( |
sigc::mem_fun( |
203 |
*this, &MainWindow::on_action_help_about)); |
*this, &MainWindow::on_action_help_about)); |
204 |
actionGroup->add( |
actionGroup->add( |
210 |
sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument) |
sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument) |
211 |
); |
); |
212 |
actionGroup->add( |
actionGroup->add( |
213 |
Gtk::Action::create("RemoveInstrument", Gtk::Stock::REMOVE), |
Gtk::Action::create("RemoveInstrument", _("_Remove")), |
214 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument) |
215 |
); |
); |
216 |
|
|
257 |
|
|
258 |
// sample right-click popup actions |
// sample right-click popup actions |
259 |
actionGroup->add( |
actionGroup->add( |
260 |
Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES), |
Gtk::Action::create("SampleProperties", _("_Properties")), |
261 |
sigc::mem_fun(*this, &MainWindow::on_action_sample_properties) |
sigc::mem_fun(*this, &MainWindow::on_action_sample_properties) |
262 |
); |
); |
263 |
actionGroup->add( |
actionGroup->add( |
269 |
sigc::mem_fun(*this, &MainWindow::on_action_add_sample) |
sigc::mem_fun(*this, &MainWindow::on_action_add_sample) |
270 |
); |
); |
271 |
actionGroup->add( |
actionGroup->add( |
272 |
Gtk::Action::create("RemoveSample", Gtk::Stock::REMOVE), |
Gtk::Action::create("RemoveSample", _("_Remove")), |
273 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_sample) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_sample) |
274 |
); |
); |
275 |
actionGroup->add( |
actionGroup->add( |
305 |
sigc::mem_fun(*this, &MainWindow::on_action_edit_script) |
sigc::mem_fun(*this, &MainWindow::on_action_edit_script) |
306 |
); |
); |
307 |
actionGroup->add( |
actionGroup->add( |
308 |
Gtk::Action::create("RemoveScript", Gtk::Stock::REMOVE), |
Gtk::Action::create("RemoveScript", _("_Remove")), |
309 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_script) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_script) |
310 |
); |
); |
311 |
|
|
800 |
|
|
801 |
void Loader::thread_function() |
void Loader::thread_function() |
802 |
{ |
{ |
803 |
printf("thread_function self=%x\n", Glib::Threads::Thread::self()); |
printf("thread_function self=%p\n", |
804 |
|
static_cast<void*>(Glib::Threads::Thread::self())); |
805 |
printf("Start %s\n", filename.c_str()); |
printf("Start %s\n", filename.c_str()); |
806 |
try { |
try { |
807 |
RIFF::File* riff = new RIFF::File(filename); |
RIFF::File* riff = new RIFF::File(filename); |
823 |
} |
} |
824 |
|
|
825 |
Loader::Loader(const char* filename) |
Loader::Loader(const char* filename) |
826 |
: filename(filename), thread(0), progress(0.f) |
: filename(filename), gig(0), thread(0), progress(0.f) |
827 |
{ |
{ |
828 |
} |
} |
829 |
|
|
834 |
#else |
#else |
835 |
thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Loader::thread_function)); |
thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Loader::thread_function)); |
836 |
#endif |
#endif |
837 |
printf("launch thread=%x\n", thread); |
printf("launch thread=%p\n", static_cast<void*>(thread)); |
838 |
} |
} |
839 |
|
|
840 |
float Loader::get_progress() |
float Loader::get_progress() |
879 |
|
|
880 |
void Saver::thread_function() |
void Saver::thread_function() |
881 |
{ |
{ |
882 |
printf("thread_function self=%x\n", Glib::Threads::Thread::self()); |
printf("thread_function self=%p\n", |
883 |
|
static_cast<void*>(Glib::Threads::Thread::self())); |
884 |
printf("Start %s\n", filename.c_str()); |
printf("Start %s\n", filename.c_str()); |
885 |
try { |
try { |
886 |
gig::progress_t progress; |
gig::progress_t progress; |
917 |
#else |
#else |
918 |
thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Saver::thread_function)); |
thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Saver::thread_function)); |
919 |
#endif |
#endif |
920 |
printf("launch thread=%x\n", thread); |
printf("launch thread=%p\n", static_cast<void*>(thread)); |
921 |
} |
} |
922 |
|
|
923 |
float Saver::get_progress() |
float Saver::get_progress() |
1014 |
g_free(msg); |
g_free(msg); |
1015 |
dialog.set_secondary_text(_("If you close without saving, your changes will be lost.")); |
dialog.set_secondary_text(_("If you close without saving, your changes will be lost.")); |
1016 |
dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO); |
dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO); |
1017 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
1018 |
dialog.add_button(file_has_name ? Gtk::Stock::SAVE : Gtk::Stock::SAVE_AS, Gtk::RESPONSE_YES); |
dialog.add_button(file_has_name ? _("_Save") : _("Save _As"), Gtk::RESPONSE_YES); |
1019 |
dialog.set_default_response(Gtk::RESPONSE_YES); |
dialog.set_default_response(Gtk::RESPONSE_YES); |
1020 |
int response = dialog.run(); |
int response = dialog.run(); |
1021 |
dialog.hide(); |
dialog.hide(); |
1046 |
"used by the sampler until you tell the sampler explicitly to " |
"used by the sampler until you tell the sampler explicitly to " |
1047 |
"load it.")); |
"load it.")); |
1048 |
dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES); |
dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES); |
1049 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
1050 |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
1051 |
int response = dialog.run(); |
int response = dialog.run(); |
1052 |
dialog.hide(); |
dialog.hide(); |
1060 |
if (file_is_shared && !leaving_shared_mode_dialog()) return; |
if (file_is_shared && !leaving_shared_mode_dialog()) return; |
1061 |
|
|
1062 |
Gtk::FileChooserDialog dialog(*this, _("Open file")); |
Gtk::FileChooserDialog dialog(*this, _("Open file")); |
1063 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
1064 |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); |
1065 |
dialog.set_default_response(Gtk::RESPONSE_OK); |
dialog.set_default_response(Gtk::RESPONSE_OK); |
1066 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
1067 |
Gtk::FileFilter filter; |
Gtk::FileFilter filter; |
1077 |
if (dialog.run() == Gtk::RESPONSE_OK) { |
if (dialog.run() == Gtk::RESPONSE_OK) { |
1078 |
std::string filename = dialog.get_filename(); |
std::string filename = dialog.get_filename(); |
1079 |
printf("filename=%s\n", filename.c_str()); |
printf("filename=%s\n", filename.c_str()); |
1080 |
printf("on_action_file_open self=%x\n", Glib::Threads::Thread::self()); |
printf("on_action_file_open self=%p\n", |
1081 |
|
static_cast<void*>(Glib::Threads::Thread::self())); |
1082 |
load_file(filename.c_str()); |
load_file(filename.c_str()); |
1083 |
current_gig_dir = Glib::path_get_dirname(filename); |
current_gig_dir = Glib::path_get_dirname(filename); |
1084 |
} |
} |
1148 |
void MainWindow::on_loader_finished() |
void MainWindow::on_loader_finished() |
1149 |
{ |
{ |
1150 |
printf("Loader finished!\n"); |
printf("Loader finished!\n"); |
1151 |
printf("on_loader_finished self=%x\n", Glib::Threads::Thread::self()); |
printf("on_loader_finished self=%p\n", |
1152 |
|
static_cast<void*>(Glib::Threads::Thread::self())); |
1153 |
load_gig(loader->gig, loader->filename.c_str()); |
load_gig(loader->gig, loader->filename.c_str()); |
1154 |
progress_dialog->hide(); |
progress_dialog->hide(); |
1155 |
} |
} |
1256 |
|
|
1257 |
bool MainWindow::file_save_as() |
bool MainWindow::file_save_as() |
1258 |
{ |
{ |
1259 |
Gtk::FileChooserDialog dialog(*this, _("Save as"), Gtk::FILE_CHOOSER_ACTION_SAVE); |
Gtk::FileChooserDialog dialog(*this, _("Save As"), Gtk::FILE_CHOOSER_ACTION_SAVE); |
1260 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
1261 |
dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); |
dialog.add_button(_("_Save"), Gtk::RESPONSE_OK); |
1262 |
dialog.set_default_response(Gtk::RESPONSE_OK); |
dialog.set_default_response(Gtk::RESPONSE_OK); |
1263 |
dialog.set_do_overwrite_confirmation(); |
dialog.set_do_overwrite_confirmation(); |
1264 |
|
|
1289 |
// show warning in the dialog |
// show warning in the dialog |
1290 |
Gtk::HBox descriptionArea; |
Gtk::HBox descriptionArea; |
1291 |
descriptionArea.set_spacing(15); |
descriptionArea.set_spacing(15); |
1292 |
Gtk::Image warningIcon(Gtk::Stock::DIALOG_WARNING, Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); |
Gtk::Image warningIcon; |
1293 |
|
warningIcon.set_from_icon_name("dialog-warning", |
1294 |
|
Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); |
1295 |
descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); |
descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); |
1296 |
#if GTKMM_MAJOR_VERSION < 3 |
#if GTKMM_MAJOR_VERSION < 3 |
1297 |
view::WrapLabel description; |
view::WrapLabel description; |
1343 |
void MainWindow::__import_queued_samples() { |
void MainWindow::__import_queued_samples() { |
1344 |
std::cout << "Starting sample import\n" << std::flush; |
std::cout << "Starting sample import\n" << std::flush; |
1345 |
Glib::ustring error_files; |
Glib::ustring error_files; |
1346 |
printf("Samples to import: %d\n", m_SampleImportQueue.size()); |
printf("Samples to import: %d\n", int(m_SampleImportQueue.size())); |
1347 |
for (std::list<SampleImportItem>::iterator iter = m_SampleImportQueue.begin(); |
for (std::list<SampleImportItem>::iterator iter = m_SampleImportQueue.begin(); |
1348 |
iter != m_SampleImportQueue.end(); ) { |
iter != m_SampleImportQueue.end(); ) { |
1349 |
printf("Importing sample %s\n",(*iter).sample_path.c_str()); |
printf("Importing sample %s\n",(*iter).sample_path.c_str()); |
1463 |
dialog.set_name("Gigedit"); |
dialog.set_name("Gigedit"); |
1464 |
#endif |
#endif |
1465 |
dialog.set_version(VERSION); |
dialog.set_version(VERSION); |
1466 |
dialog.set_copyright("Copyright (C) 2006-2015 Andreas Persson"); |
dialog.set_copyright("Copyright (C) 2006-2016 Andreas Persson"); |
1467 |
const std::string sComment = |
const std::string sComment = |
1468 |
_("Built " __DATE__ "\nUsing ") + |
_("Built " __DATE__ "\nUsing ") + |
1469 |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
1500 |
eSourceForm(_("Source form")), |
eSourceForm(_("Source form")), |
1501 |
eCommissioned(_("Commissioned")), |
eCommissioned(_("Commissioned")), |
1502 |
eSubject(_("Subject")), |
eSubject(_("Subject")), |
1503 |
quitButton(Gtk::Stock::CLOSE), |
quitButton(_("_Close"), true), |
1504 |
table(2, 1), |
table(2, 1), |
1505 |
m_file(NULL) |
m_file(NULL) |
1506 |
{ |
{ |
1623 |
} |
} |
1624 |
|
|
1625 |
InstrumentProps::InstrumentProps() : |
InstrumentProps::InstrumentProps() : |
1626 |
quitButton(Gtk::Stock::CLOSE), |
quitButton(_("_Close"), true), |
1627 |
table(2,1), |
table(2,1), |
1628 |
eName(_("Name")), |
eName(_("Name")), |
1629 |
eIsDrum(_("Is drum")), |
eIsDrum(_("Is drum")), |
2436 |
|
|
2437 |
// show 'browse for file' dialog |
// show 'browse for file' dialog |
2438 |
Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)")); |
Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)")); |
2439 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
2440 |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); |
2441 |
dialog.set_select_multiple(!replace); // allow multi audio file selection only when adding new samples, does not make sense when replacing a specific sample |
dialog.set_select_multiple(!replace); // allow multi audio file selection only when adding new samples, does not make sense when replacing a specific sample |
2442 |
|
|
2443 |
// matches all file types supported by libsndfile |
// matches all file types supported by libsndfile |
2637 |
dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK); |
dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK); |
2638 |
description.show(); |
description.show(); |
2639 |
entryArea.show_all(); |
entryArea.show_all(); |
2640 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
2641 |
dialog.add_button(_("Select"), Gtk::RESPONSE_OK); |
dialog.add_button(_("Select"), Gtk::RESPONSE_OK); |
2642 |
dialog.set_select_multiple(false); |
dialog.set_select_multiple(false); |
2643 |
if (current_sample_dir != "") { |
if (current_sample_dir != "") { |
2661 |
try |
try |
2662 |
{ |
{ |
2663 |
if (!hFile) throw std::string(_("could not open file")); |
if (!hFile) throw std::string(_("could not open file")); |
|
int bitdepth; |
|
2664 |
switch (info.format & 0xff) { |
switch (info.format & 0xff) { |
2665 |
case SF_FORMAT_PCM_S8: |
case SF_FORMAT_PCM_S8: |
2666 |
case SF_FORMAT_PCM_16: |
case SF_FORMAT_PCM_16: |
2667 |
case SF_FORMAT_PCM_U8: |
case SF_FORMAT_PCM_U8: |
|
bitdepth = 16; |
|
|
break; |
|
2668 |
case SF_FORMAT_PCM_24: |
case SF_FORMAT_PCM_24: |
2669 |
case SF_FORMAT_PCM_32: |
case SF_FORMAT_PCM_32: |
2670 |
case SF_FORMAT_FLOAT: |
case SF_FORMAT_FLOAT: |
2671 |
case SF_FORMAT_DOUBLE: |
case SF_FORMAT_DOUBLE: |
|
bitdepth = 24; |
|
2672 |
break; |
break; |
2673 |
default: |
default: |
2674 |
sf_close(hFile); |
sf_close(hFile); |
3257 |
} |
} |
3258 |
|
|
3259 |
Gtk::FileChooserDialog dialog(*this, _("Merge .gig files")); |
Gtk::FileChooserDialog dialog(*this, _("Merge .gig files")); |
3260 |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
3261 |
dialog.add_button(_("Merge"), Gtk::RESPONSE_OK); |
dialog.add_button(_("Merge"), Gtk::RESPONSE_OK); |
3262 |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
3263 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
3276 |
// show warning in the file picker dialog |
// show warning in the file picker dialog |
3277 |
Gtk::HBox descriptionArea; |
Gtk::HBox descriptionArea; |
3278 |
descriptionArea.set_spacing(15); |
descriptionArea.set_spacing(15); |
3279 |
Gtk::Image warningIcon(Gtk::Stock::DIALOG_WARNING, Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); |
Gtk::Image warningIcon; |
3280 |
|
warningIcon.set_from_icon_name("dialog-warning", |
3281 |
|
Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); |
3282 |
descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); |
descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); |
3283 |
#if GTKMM_MAJOR_VERSION < 3 |
#if GTKMM_MAJOR_VERSION < 3 |
3284 |
view::WrapLabel description; |
view::WrapLabel description; |
3301 |
descriptionArea.show_all(); |
descriptionArea.show_all(); |
3302 |
|
|
3303 |
if (dialog.run() == Gtk::RESPONSE_OK) { |
if (dialog.run() == Gtk::RESPONSE_OK) { |
3304 |
printf("on_action_merge_files self=%x\n", Glib::Threads::Thread::self()); |
printf("on_action_merge_files self=%p\n", |
3305 |
|
static_cast<void*>(Glib::Threads::Thread::self())); |
3306 |
std::vector<std::string> filenames = dialog.get_filenames(); |
std::vector<std::string> filenames = dialog.get_filenames(); |
3307 |
|
|
3308 |
// merge the selected files to the currently open .gig file |
// merge the selected files to the currently open .gig file |