]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/mainapp.C
Remove unneeded files, we have switched to use the libglade and there is no
[lyx.git] / src / frontends / gnome / mainapp.C
index 7dd176e5ed0f870ebaaeea8e38525718ccbb08bf..f7d4d03639a0502055c8f340426af7a09bc0d7c4 100644 (file)
@@ -47,6 +47,8 @@ void GLyxAppWin::init()
 
   set_statusbar(status_);
 
+  accel_ = 0;
+
   // initial (dummy) menu
   vector<Gnome::UI::Info> menus, fm;
   fm.push_back(Gnome::MenuItems::Open());
@@ -63,7 +65,7 @@ void GLyxAppWin::init()
   // temporary main widget
   Gtk::HBox * h = manage( new Gtk::HBox() );
   Gnome::Pixmap * p;
-  p = Gtk::wrap( GNOME_PIXMAP( gnome_stock_pixmap_widget(NULL, GNOME_STOCK_PIXMAP_ABOUT) ) );
+  p = Gtk::wrap( GNOME_PIXMAP( gnome_stock_pixmap_widget(0, GNOME_STOCK_PIXMAP_ABOUT) ) );
 
   h->children().push_back( Gtk::Box_Helpers::Element( *p ) );
   h->children().push_back( *(manage(new Gtk::Label("Waiting for LyXView port"))) );
@@ -103,7 +105,7 @@ void GLyxAppWin::update_menu(string path, int noelms, Gnome::UI::Array &menu)
 }
   
 // clean up first, then add new action widget and finally, disable main view
-void GLyxAppWin::add_action(Gtk::Container &action, string title, bool expand)
+void GLyxAppWin::add_action(Gtk::Container &action, string title, bool expand, Gtk::AccelGroup * acgr)
 {
   remove_action();
 
@@ -115,17 +117,26 @@ void GLyxAppWin::add_action(Gtk::Container &action, string title, bool expand)
   box_.children().push_back( Gtk::Box_Helpers::Element( *frame, expand ) );
   box_.show_all();
 
+  accel_ = acgr;
+  if (accel_ != 0) add_accel_group(*accel_);
+  
   view_->set_sensitive(false);
   action_mode = true;
 }
 
 void GLyxAppWin::remove_action()
 {
+  if (accel_ != 0)
+    {
+      remove_accel_group(*accel_);
+      accel_ = 0;
+    }
+  
   while ( box_.children().size() > 2 )
     {
       box_.children().pop_back();
     }
-  
+
   view_->set_sensitive(true);  
   action_mode = false;
 }