/[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 2845 by persson, Sun Sep 20 10:18:22 2015 UTC revision 2918 by schoenebeck, Wed May 18 10:10:25 2016 UTC
# Line 1  Line 1 
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
# Line 192  MainWindow::MainWindow() : Line 192  MainWindow::MainWindow() :
192      actionGroup->add(toggle_action,      actionGroup->add(toggle_action,
193                       sigc::mem_fun(                       sigc::mem_fun(
194                           *this, &MainWindow::on_action_view_status_bar));                           *this, &MainWindow::on_action_view_status_bar));
195    
196        toggle_action =
197            Gtk::ToggleAction::create("AutoRestoreWinDim", _("_Auto Restore Window Dimension"));
198        toggle_action->set_active(Settings::singleton()->autoRestoreWindowDimension);
199        actionGroup->add(toggle_action,
200                         sigc::mem_fun(
201                             *this, &MainWindow::on_auto_restore_win_dim));
202    
203      actionGroup->add(      actionGroup->add(
204          Gtk::Action::create("RefreshAll", _("_Refresh All")),          Gtk::Action::create("RefreshAll", _("_Refresh All")),
205          sigc::mem_fun(*this, &MainWindow::on_action_refresh_all)          sigc::mem_fun(*this, &MainWindow::on_action_refresh_all)
# Line 364  MainWindow::MainWindow() : Line 372  MainWindow::MainWindow() :
372          "    </menu>"          "    </menu>"
373          "    <menu action='MenuView'>"          "    <menu action='MenuView'>"
374          "      <menuitem action='Statusbar'/>"          "      <menuitem action='Statusbar'/>"
375            "      <menuitem action='AutoRestoreWinDim'/>"
376          "      <separator/>"          "      <separator/>"
377          "      <menuitem action='RefreshAll'/>"          "      <menuitem action='RefreshAll'/>"
378          "    </menu>"          "    </menu>"
# Line 462  MainWindow::MainWindow() : Line 471  MainWindow::MainWindow() :
471      }      }
472      {      {
473          Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(          Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
474                uiManager->get_widget("/MenuBar/MenuView/AutoRestoreWinDim"));
475            item->set_tooltip_text(_("If checked, size and position of all windows will be saved and automatically restored next time."));
476        }
477        {
478            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
479              uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments"));              uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments"));
480          item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file."));          item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file."));
481      }      }
# Line 1463  void MainWindow::on_action_help_about() Line 1477  void MainWindow::on_action_help_about()
1477      dialog.set_name("Gigedit");      dialog.set_name("Gigedit");
1478  #endif  #endif
1479      dialog.set_version(VERSION);      dialog.set_version(VERSION);
1480      dialog.set_copyright("Copyright (C) 2006-2015 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2016 Andreas Persson");
1481      const std::string sComment =      const std::string sComment =
1482          _("Built " __DATE__ "\nUsing ") +          _("Built " __DATE__ "\nUsing ") +
1483          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
# Line 1918  void MainWindow::on_action_view_status_b Line 1932  void MainWindow::on_action_view_status_b
1932      else                    m_StatusBar.hide();      else                    m_StatusBar.hide();
1933  }  }
1934    
1935    void MainWindow::on_auto_restore_win_dim() {
1936        Gtk::CheckMenuItem* item =
1937            dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuView/AutoRestoreWinDim"));
1938        if (!item) {
1939            std::cerr << "/MenuBar/MenuView/AutoRestoreWinDim == NULL\n";
1940            return;
1941        }
1942        Settings::singleton()->autoRestoreWindowDimension = item->get_active();
1943    }
1944    
1945  bool MainWindow::is_copy_samples_unity_note_enabled() const {  bool MainWindow::is_copy_samples_unity_note_enabled() const {
1946      Gtk::CheckMenuItem* item =      Gtk::CheckMenuItem* item =
1947          dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleUnity"));          dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleUnity"));
# Line 2340  void MainWindow::on_action_edit_script() Line 2364  void MainWindow::on_action_edit_script()
2364      if (!script) return;      if (!script) return;
2365    
2366      ScriptEditor* editor = new ScriptEditor;      ScriptEditor* editor = new ScriptEditor;
2367        editor->signal_script_to_be_changed.connect(
2368            signal_script_to_be_changed.make_slot()
2369        );
2370        editor->signal_script_changed.connect(
2371            signal_script_changed.make_slot()
2372        );
2373      editor->setScript(script);      editor->setScript(script);
2374      //editor->reparent(*this);      //editor->reparent(*this);
2375      editor->show();      editor->show();
# Line 3082  void MainWindow::script_double_clicked(c Line 3112  void MainWindow::script_double_clicked(c
3112      if (!script) return;      if (!script) return;
3113    
3114      ScriptEditor* editor = new ScriptEditor;      ScriptEditor* editor = new ScriptEditor;
3115        editor->signal_script_to_be_changed.connect(
3116            signal_script_to_be_changed.make_slot()
3117        );
3118        editor->signal_script_changed.connect(
3119            signal_script_changed.make_slot()
3120        );
3121      editor->setScript(script);      editor->setScript(script);
3122      //editor->reparent(*this);      //editor->reparent(*this);
3123      editor->show();      editor->show();

Legend:
Removed from v.2845  
changed lines
  Added in v.2918

  ViewVC Help
Powered by ViewVC