/[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 2553 by schoenebeck, Wed May 14 19:57:56 2014 UTC revision 2560 by schoenebeck, Sun May 18 18:55:29 2014 UTC
# Line 1058  void MainWindow::on_action_help_about() Line 1058  void MainWindow::on_action_help_about()
1058  }  }
1059    
1060  PropDialog::PropDialog()  PropDialog::PropDialog()
1061      : eName(_("Name")),      : eFileFormat(_("File Format")),
1062          eName(_("Name")),
1063        eCreationDate(_("Creation date")),        eCreationDate(_("Creation date")),
1064        eComments(_("Comments")),        eComments(_("Comments")),
1065        eProduct(_("Product")),        eProduct(_("Product")),
# Line 1075  PropDialog::PropDialog() Line 1076  PropDialog::PropDialog()
1076        eCommissioned(_("Commissioned")),        eCommissioned(_("Commissioned")),
1077        eSubject(_("Subject")),        eSubject(_("Subject")),
1078        quitButton(Gtk::Stock::CLOSE),        quitButton(Gtk::Stock::CLOSE),
1079        table(2, 1)        table(2, 1),
1080          m_file(NULL)
1081  {  {
1082      set_title(_("File Properties"));      set_title(_("File Properties"));
1083      eName.set_width_chars(50);      eName.set_width_chars(50);
# Line 1097  PropDialog::PropDialog() Line 1099  PropDialog::PropDialog()
1099      connect(eCommissioned, &DLS::Info::Commissioned);      connect(eCommissioned, &DLS::Info::Commissioned);
1100      connect(eSubject, &DLS::Info::Subject);      connect(eSubject, &DLS::Info::Subject);
1101    
1102        table.add(eFileFormat);
1103      table.add(eName);      table.add(eName);
1104      table.add(eCreationDate);      table.add(eCreationDate);
1105      table.add(eComments);      table.add(eComments);
# Line 1127  PropDialog::PropDialog() Line 1130  PropDialog::PropDialog()
1130      quitButton.grab_focus();      quitButton.grab_focus();
1131      quitButton.signal_clicked().connect(      quitButton.signal_clicked().connect(
1132          sigc::mem_fun(*this, &PropDialog::hide));          sigc::mem_fun(*this, &PropDialog::hide));
1133        eFileFormat.signal_value_changed().connect(
1134            sigc::mem_fun(*this, &PropDialog::onFileFormatChanged));
1135    
1136      quitButton.show();      quitButton.show();
1137      vbox.show();      vbox.show();
1138      show_all_children();      show_all_children();
1139  }  }
1140    
1141    void PropDialog::set_file(gig::File* file)
1142    {
1143        m_file = file;
1144    
1145        // update file format version combo box
1146        const std::string sGiga = "Gigasampler/GigaStudio v";
1147        const int major = file->pVersion->major;
1148        std::vector<std::string> txts;
1149        std::vector<int> values;
1150        txts.push_back(sGiga + "2"); values.push_back(2);
1151        txts.push_back(sGiga + "3"); values.push_back(3);
1152        if (major != 2 && major != 3) {
1153            txts.push_back(sGiga + ToString(major)); values.push_back(major);
1154        }
1155        std::vector<const char*> texts;
1156        for (int i = 0; i < txts.size(); ++i) texts.push_back(txts[i].c_str());
1157        texts.push_back(NULL); values.push_back(NULL);
1158        eFileFormat.set_choices(&texts[0], &values[0]);
1159        eFileFormat.set_value(major);
1160    }
1161    
1162    void PropDialog::onFileFormatChanged() {
1163        const int major = eFileFormat.get_value();
1164        if (m_file) m_file->pVersion->major = major;
1165    }
1166    
1167  void PropDialog::set_info(DLS::Info* info)  void PropDialog::set_info(DLS::Info* info)
1168  {  {
1169      update(info);      update(info);
# Line 1274  void MainWindow::load_gig(gig::File* gig Line 1305  void MainWindow::load_gig(gig::File* gig
1305      file_has_name = filename;      file_has_name = filename;
1306      file_is_changed = false;      file_is_changed = false;
1307    
1308        propDialog.set_file(gig);
1309      propDialog.set_info(gig->pInfo);      propDialog.set_info(gig->pInfo);
1310    
1311      instrument_name_connection.block();      instrument_name_connection.block();

Legend:
Removed from v.2553  
changed lines
  Added in v.2560

  ViewVC Help
Powered by ViewVC