]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/FormError.C
Remove unneeded files, we have switched to use the libglade and there is no
[lyx.git] / src / frontends / gnome / FormError.C
index 0e6f8d999c98d2a99a0870d0580eb8eaab35a040..ae8635c75e93a2e7c39fe37ed05f26caec97138f 100644 (file)
@@ -36,7 +36,7 @@ extern GLyxAppWin * mainAppWin;
 
 
 FormError::FormError(LyXView * lv, Dialogs * d)
-       : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(NULL)
+       : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(0)
 {
   // let the dialog be shown
   // These are permanent connections so we won't bother
@@ -52,10 +52,10 @@ FormError::~FormError()
 
 void FormError::showInset( InsetError * const inset )
 {
-  if( dialog_!=NULL || inset == 0 ) return;
+  if( dialog_!=0 || inset == 0 ) return;
   
   inset_ = inset;
-  ih_ = inset_->hide.connect(slot(this, &FormError::hide));
+  ih_ = inset_->hideDialog.connect(slot(this, &FormError::hide));
 
   show();
 }
@@ -86,7 +86,7 @@ void FormError::show()
       
       // packing dialog to main window
       dialog_ = mbox;
-      mainAppWin->add_action(*dialog_, N_(" Error "));
+      mainAppWin->add_action(*dialog_, _(" Error "));
 
       // setting focus
       GTK_WIDGET_SET_FLAGS (GTK_WIDGET(b_close->gtkobj()), GTK_CAN_DEFAULT);
@@ -97,25 +97,26 @@ void FormError::show()
       b_close->clicked.connect(slot(mainAppWin, &GLyxAppWin::remove_action));
       dialog_->destroy.connect(slot(this, &FormError::free));
 
-      u_ = d_->updateBufferDependent.connect(slot(this, &FormError::update));
+      u_ = d_->updateBufferDependent.connect(slot(this, &FormError::updateSlot));
       h_ = d_->hideBufferDependent.connect(slot(this, &FormError::hide));
     }
 }
-      
-void FormError::update(bool)
+
+void FormError::updateSlot(bool buffchanged)
 {
+  if (buffchanged) hide();
 }
 
 void FormError::hide()
 {
-  if (dialog_!=NULL) mainAppWin->remove_action();
+  if (dialog_!=0) mainAppWin->remove_action();
 }
 
 void FormError::free()
 {
-  if (dialog_!=NULL)
+  if (dialog_!=0)
     {
-      dialog_ = NULL;
+      dialog_ = 0;
       u_.disconnect();
       h_.disconnect();
       inset_ = 0;