/[svn]/gigedit/trunk/src/gigedit/mainwindow.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/mainwindow.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3450 by schoenebeck, Wed Jan 2 16:39:20 2019 UTC revision 3469 by persson, Tue Feb 12 18:54:58 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2017 Andreas Persson   * Copyright (C) 2006-2019 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
# Line 1516  MainWindow::MainWindow() : Line 1516  MainWindow::MainWindow() :
1516          sigc::hide(          sigc::hide(
1517              sigc::bind(              sigc::bind(
1518                  file_structure_to_be_changed_signal.make_slot(),                  file_structure_to_be_changed_signal.make_slot(),
1519    #if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8)
1520                    std::ref(this->file)
1521    #else
1522                  sigc::ref(this->file)                  sigc::ref(this->file)
1523    #endif
1524              )              )
1525          )          )
1526      );      );
# Line 1524  MainWindow::MainWindow() : Line 1528  MainWindow::MainWindow() :
1528          sigc::hide(          sigc::hide(
1529              sigc::bind(              sigc::bind(
1530                  file_structure_changed_signal.make_slot(),                  file_structure_changed_signal.make_slot(),
1531    #if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8)
1532                    std::ref(this->file)
1533    #else
1534                  sigc::ref(this->file)                  sigc::ref(this->file)
1535    #endif
1536              )              )
1537          )          )
1538      );      );
# Line 1546  MainWindow::MainWindow() : Line 1554  MainWindow::MainWindow() :
1554          sigc::mem_fun(*this, &MainWindow::update_dimregs));          sigc::mem_fun(*this, &MainWindow::update_dimregs));
1555    
1556      m_searchText.signal_changed().connect(      m_searchText.signal_changed().connect(
1557          sigc::mem_fun(m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter)          sigc::mem_fun(*m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter)
1558      );      );
1559    
1560      file = 0;      file = 0;
# Line 2669  void MainWindow::on_action_help_about() Line 2677  void MainWindow::on_action_help_about()
2677      dialog.set_name("Gigedit");      dialog.set_name("Gigedit");
2678  #endif  #endif
2679      dialog.set_version(VERSION);      dialog.set_version(VERSION);
2680      dialog.set_copyright("Copyright (C) 2006-2017 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2019 Andreas Persson");
2681      const std::string sComment =      const std::string sComment =
2682          _("Built " __DATE__ "\nUsing ") +          _("Built " __DATE__ "\nUsing ") +
2683          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
# Line 2723  PropDialog::PropDialog() Line 2731  PropDialog::PropDialog()
2731      set_title(_("File Properties"));      set_title(_("File Properties"));
2732      eName.set_width_chars(50);      eName.set_width_chars(50);
2733    
2734        connect(eFileFormat, &PropDialog::set_FileFormat);
2735      connect(eName, &DLS::Info::Name);      connect(eName, &DLS::Info::Name);
2736      connect(eCreationDate, &DLS::Info::CreationDate);      connect(eCreationDate, &DLS::Info::CreationDate);
2737      connect(eComments, &DLS::Info::Comments);      connect(eComments, &DLS::Info::Comments);
# Line 2784  PropDialog::PropDialog() Line 2793  PropDialog::PropDialog()
2793      quitButton.grab_focus();      quitButton.grab_focus();
2794      quitButton.signal_clicked().connect(      quitButton.signal_clicked().connect(
2795          sigc::mem_fun(*this, &PropDialog::hide));          sigc::mem_fun(*this, &PropDialog::hide));
     eFileFormat.signal_value_changed().connect(  
         sigc::mem_fun(*this, &PropDialog::onFileFormatChanged));  
2796    
2797      quitButton.show();      quitButton.show();
2798      vbox.show();      vbox.show();
# Line 2797  PropDialog::PropDialog() Line 2804  PropDialog::PropDialog()
2804  void PropDialog::set_file(gig::File* file)  void PropDialog::set_file(gig::File* file)
2805  {  {
2806      m_file = file;      m_file = file;
2807        update(file->pInfo);
2808    
2809      // update file format version combo box      // update file format version combo box
2810      const std::string sGiga = "Gigasampler/GigaStudio v";      const std::string sGiga = "Gigasampler/GigaStudio v";
# Line 2812  void PropDialog::set_file(gig::File* fil Line 2820  void PropDialog::set_file(gig::File* fil
2820      std::vector<const char*> texts;      std::vector<const char*> texts;
2821      for (int i = 0; i < txts.size(); ++i) texts.push_back(txts[i].c_str());      for (int i = 0; i < txts.size(); ++i) texts.push_back(txts[i].c_str());
2822      texts.push_back(NULL); values.push_back(0);      texts.push_back(NULL); values.push_back(0);
2823    
2824        update_model++;
2825      eFileFormat.set_choices(&texts[0], &values[0]);      eFileFormat.set_choices(&texts[0], &values[0]);
2826      eFileFormat.set_value(major);      eFileFormat.set_value(major);
2827        update_model--;
2828  }  }
2829    
2830  void PropDialog::onFileFormatChanged() {  void PropDialog::set_FileFormat(int value)
     const int major = eFileFormat.get_value();  
     if (m_file) m_file->pVersion->major = major;  
 }  
   
 void PropDialog::set_info(DLS::Info* info)  
2831  {  {
2832      update(info);      m_file->pVersion->major = value;
2833  }  }
2834    
2835    
# Line 2998  void MainWindow::updateSampleRefCountMap Line 3004  void MainWindow::updateSampleRefCountMap
3004    
3005  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {
3006      Gtk::TreeModel::iterator iter;      Gtk::TreeModel::iterator iter;
3007      m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter);      if (!m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter)) {
3008            return false;
3009        }
3010      Gtk::TreeModel::Path path(iter);      Gtk::TreeModel::Path path(iter);
3011      Gtk::TreeModel::Row row = *iter;      Gtk::TreeModel::Row row = *iter;
3012      Gtk::TreeViewColumn* pointedColumn = NULL;      Gtk::TreeViewColumn* pointedColumn = NULL;
# Line 3030  bool MainWindow::onQueryTreeViewTooltip( Line 3038  bool MainWindow::onQueryTreeViewTooltip(
3038  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {
3039      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));
3040      const int iScriptSlots = instrument->ScriptSlotCount();      const int iScriptSlots = instrument->ScriptSlotCount();
3041      Glib::ustring tooltip = "<u>(" + ToString(index) + ") „"  + name + "”</u>\n\n";      Glib::ustring tooltip = "<u>(" + ToString(index) + ") “"  + name + "”</u>\n\n";
3042      if (!iScriptSlots)      if (!iScriptSlots)
3043          tooltip += "<span foreground='red'><i>No script assigned</i></span>";          tooltip += "<span foreground='red'><i>No script assigned</i></span>";
3044      else {      else {
3045          for (int i = 0; i < iScriptSlots; ++i) {          for (int i = 0; i < iScriptSlots; ++i) {
3046              tooltip += "• " + ToString(i+1) + ". Script:  „<span foreground='#46DEFF'><b>" +              tooltip += "• " + ToString(i+1) + ". Script: “<span foreground='#46DEFF'><b>" +
3047                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";
3048              if (i + 1 < iScriptSlots) tooltip += "\n\n";              if (i + 1 < iScriptSlots) tooltip += "\n\n";
3049          }          }
# Line 3057  void MainWindow::load_gig(gig::File* gig Line 3065  void MainWindow::load_gig(gig::File* gig
3065      file_is_changed = false;      file_is_changed = false;
3066    
3067      propDialog.set_file(gig);      propDialog.set_file(gig);
     propDialog.set_info(gig->pInfo);  
3068    
3069      instrument_name_connection.block();      instrument_name_connection.block();
3070      int index = 0;      int index = 0;

Legend:
Removed from v.3450  
changed lines
  Added in v.3469

  ViewVC Help
Powered by ViewVC