17 |
* 02110-1301 USA. |
* 02110-1301 USA. |
18 |
*/ |
*/ |
19 |
|
|
|
#include <libintl.h> |
|
20 |
#include <iostream> |
#include <iostream> |
21 |
|
|
22 |
#include <gtkmm/filechooserdialog.h> |
#include <gtkmm/filechooserdialog.h> |
25 |
#include <gtkmm/targetentry.h> |
#include <gtkmm/targetentry.h> |
26 |
#include <gtkmm/main.h> |
#include <gtkmm/main.h> |
27 |
|
|
28 |
|
#include "global.h" |
29 |
|
|
30 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6) || GTKMM_MAJOR_VERSION > 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6) || GTKMM_MAJOR_VERSION > 2 |
31 |
#define ABOUT_DIALOG |
#define ABOUT_DIALOG |
32 |
#include <gtkmm/aboutdialog.h> |
#include <gtkmm/aboutdialog.h> |
49 |
|
|
50 |
#include "mainwindow.h" |
#include "mainwindow.h" |
51 |
|
|
52 |
#define _(String) gettext(String) |
#include "../../gfx/status_attached.xpm" |
53 |
|
#include "../../gfx/status_detached.xpm" |
54 |
|
|
55 |
template<class T> inline std::string ToString(T o) { |
template<class T> inline std::string ToString(T o) { |
56 |
std::stringstream ss; |
std::stringstream ss; |
213 |
m_VBox.pack_start(m_HPaned); |
m_VBox.pack_start(m_HPaned); |
214 |
m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK); |
m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK); |
215 |
m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK); |
m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK); |
216 |
|
m_VBox.pack_start(m_StatusBar, Gtk::PACK_SHRINK); |
217 |
|
|
218 |
|
// Status Bar: |
219 |
|
m_StatusBar.pack_start(m_AttachedStateLabel, Gtk::PACK_SHRINK); |
220 |
|
m_StatusBar.pack_start(m_AttachedStateImage, Gtk::PACK_SHRINK); |
221 |
|
m_StatusBar.show(); |
222 |
|
|
223 |
m_RegionChooser.signal_region_selected().connect( |
m_RegionChooser.signal_region_selected().connect( |
224 |
sigc::mem_fun(*this, &MainWindow::region_changed) ); |
sigc::mem_fun(*this, &MainWindow::region_changed) ); |
303 |
|
|
304 |
file = 0; |
file = 0; |
305 |
file_is_changed = false; |
file_is_changed = false; |
306 |
file_is_shared = false; |
set_file_is_shared(false); |
307 |
|
|
308 |
show_all_children(); |
show_all_children(); |
309 |
|
|
438 |
// free libgig's gig::File instance |
// free libgig's gig::File instance |
439 |
if (file && !file_is_shared) delete file; |
if (file && !file_is_shared) delete file; |
440 |
file = NULL; |
file = NULL; |
441 |
file_is_shared = false; |
set_file_is_shared(false); |
442 |
} |
} |
443 |
|
|
444 |
void MainWindow::on_action_file_new() |
void MainWindow::on_action_file_new() |
967 |
void MainWindow::load_gig(gig::File* gig, const char* filename, bool isSharedInstrument) |
void MainWindow::load_gig(gig::File* gig, const char* filename, bool isSharedInstrument) |
968 |
{ |
{ |
969 |
file = 0; |
file = 0; |
970 |
file_is_shared = isSharedInstrument; |
set_file_is_shared(isSharedInstrument); |
971 |
|
|
972 |
this->filename = filename ? filename : _("Unsaved Gig File"); |
this->filename = filename ? filename : _("Unsaved Gig File"); |
973 |
set_title(Glib::filename_display_basename(this->filename)); |
set_title(Glib::filename_display_basename(this->filename)); |
1511 |
} |
} |
1512 |
} |
} |
1513 |
|
|
1514 |
|
void MainWindow::set_file_is_shared(bool b) { |
1515 |
|
this->file_is_shared = b; |
1516 |
|
|
1517 |
|
if (file_is_shared) { |
1518 |
|
m_AttachedStateLabel.set_label(_("live-mode")); |
1519 |
|
m_AttachedStateImage.set( |
1520 |
|
Gdk::Pixbuf::create_from_xpm_data(status_attached_xpm) |
1521 |
|
); |
1522 |
|
} else { |
1523 |
|
m_AttachedStateLabel.set_label(_("stand-alone")); |
1524 |
|
m_AttachedStateImage.set( |
1525 |
|
Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm) |
1526 |
|
); |
1527 |
|
} |
1528 |
|
} |
1529 |
|
|
1530 |
sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_to_be_changed() { |
sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_to_be_changed() { |
1531 |
return file_structure_to_be_changed_signal; |
return file_structure_to_be_changed_signal; |
1532 |
} |
} |