/[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 3158 by schoenebeck, Mon May 8 18:05:35 2017 UTC revision 3180 by schoenebeck, Sun May 14 13:17:03 2017 UTC
# Line 914  void MainWindow::updateMacroMenu() { Line 914  void MainWindow::updateMacroMenu() {
914          );          );
915          menuMacro->append(*item);          menuMacro->append(*item);
916          item->set_accel_path("<Macros>/macro_" + ToString(iMacro));          item->set_accel_path("<Macros>/macro_" + ToString(iMacro));
917            Glib::ustring comment = macro.comment();
918            if (!comment.empty())
919                item->set_tooltip_text(comment);
920      }      }
921      // if there are no macros configured at all, then show a dummy entry instead      // if there are no macros configured at all, then show a dummy entry instead
922      if (m_macros.empty()) {      if (m_macros.empty()) {
# Line 957  void MainWindow::onMacroSelected(int iMa Line 960  void MainWindow::onMacroSelected(int iMa
960    
961  void MainWindow::setupMacros() {  void MainWindow::setupMacros() {
962      MacrosSetup* setup = new MacrosSetup();      MacrosSetup* setup = new MacrosSetup();
963      setup->setMacros(m_macros);      gig::DimensionRegion* pDimRgn = m_DimRegionChooser.get_main_dimregion();
964        setup->setMacros(m_macros, &m_serializationArchive, pDimRgn);
965      setup->signal_macros_changed().connect(      setup->signal_macros_changed().connect(
966          sigc::mem_fun(*this, &MainWindow::onMacrosSetupChanged)          sigc::mem_fun(*this, &MainWindow::onMacrosSetupChanged)
967      );      );
# Line 1200  void Saver::thread_function() Line 1204  void Saver::thread_function()
1204                  // save the file as separate temporary file first,                  // save the file as separate temporary file first,
1205                  // then move the saved file over the old file                  // then move the saved file over the old file
1206                  // (may result in performance speedup during save)                  // (may result in performance speedup during save)
1207                  String tmpname = filename + ".TMP";                  gig::String tmpname = filename + ".TMP";
1208                  gig->Save(tmpname, &progress);                  gig->Save(tmpname, &progress);
1209                  #if defined(WIN32)                  #if defined(WIN32)
1210                  if (!DeleteFile(filename.c_str())) {                  if (!DeleteFile(filename.c_str())) {
# Line 1208  void Saver::thread_function() Line 1212  void Saver::thread_function()
1212                  }                  }
1213                  #else // POSIX ...                  #else // POSIX ...
1214                  if (unlink(filename.c_str())) {                  if (unlink(filename.c_str())) {
1215                      throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + String(strerror(errno)));                      throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + gig::String(strerror(errno)));
1216                  }                  }
1217                  #endif                  #endif
1218                  if (rename(tmpname.c_str(), filename.c_str())) {                  if (rename(tmpname.c_str(), filename.c_str())) {
1219                      #if defined(WIN32)                      #if defined(WIN32)
1220                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");
1221                      #else                      #else
1222                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + String(strerror(errno)));                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + gig::String(strerror(errno)));
1223                      #endif                      #endif
1224                  }                  }
1225              }              }
# Line 3869  void MainWindow::paste_copied_dimrgn() { Line 3873  void MainWindow::paste_copied_dimrgn() {
3873    
3874  void MainWindow::adjust_clipboard_content() {  void MainWindow::adjust_clipboard_content() {
3875      MacroEditor* editor = new MacroEditor();      MacroEditor* editor = new MacroEditor();
3876      editor->setMacro(&m_serializationArchive);      editor->setMacro(&m_serializationArchive, true);
3877      editor->show();      editor->show();
3878  }  }
3879    
# Line 3919  void MainWindow::applyMacro(Serializatio Line 3923  void MainWindow::applyMacro(Serializatio
3923           itDimReg != dimreg_edit.dimregs.end(); ++itDimReg)           itDimReg != dimreg_edit.dimregs.end(); ++itDimReg)
3924      {      {
3925          gig::DimensionRegion* pDimRgn = *itDimReg;          gig::DimensionRegion* pDimRgn = *itDimReg;
3926          dimreg_to_be_changed_signal.emit(pDimRgn);          DimRegionChangeGuard(this, pDimRgn);
3927          m_serializationArchive.deserialize(pDimRgn);          macro.deserialize(pDimRgn);
         dimreg_changed_signal.emit(pDimRgn);  
3928      }      }
3929      //region_changed()      //region_changed()
3930      file_changed();      file_changed();

Legend:
Removed from v.3158  
changed lines
  Added in v.3180

  ViewVC Help
Powered by ViewVC