]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/FormPrint.C
ws cleanup
[lyx.git] / src / frontends / gnome / FormPrint.C
index 4af90ad48f66d2a3bf30db2cd89d32578b5e9c45..e1309f0eaae381f4f05dc9234e6865ff3783c870 100644 (file)
@@ -1,8 +1,7 @@
-// -*- C++ -*-
 /* FormPrint.C
  * FormPrint Interface Class Implementation
  * This file is part of
- * ====================================================== 
+ * ======================================================
  *
  *           LyX, The Document Processor
  *
@@ -37,23 +36,16 @@ extern "C" {
 #include <gtk--/base.h>
 #include <gtk--/button.h>
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::slot;
-using SigC::bind;
-#endif
-
-#ifdef CXX_WORKING_NAMESPACES
 using Liason::printBuffer;
 using Liason::getPrinterParams;
-#endif
 
 FormPrint::FormPrint(LyXView * lv, Dialogs * d)
-  : dialog_(NULL), lv_(lv), d_(d), u_(0), h_(0)
+  : dialog_(0), lv_(lv), d_(d), u_(0), h_(0)
 {
   // let the dialog be shown
   // This is a permanent connection so we won't bother
   // storing a copy because we won't be disconnecting.
-  d->showPrint.connect(slot(this,&FormPrint::show));
+  d->showPrint.connect(SigC::slot(this,&FormPrint::show));
 }
 
 
@@ -97,18 +89,18 @@ void FormPrint::show()
       b_cancel = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_cancel") ) );
 
       // setting up connections
-      b_ok->clicked.connect(slot(this, &FormPrint::apply));
+      b_ok->clicked.connect(SigC::slot(this, &FormPrint::apply));
       b_ok->clicked.connect(dialog_->destroy.slot());
       b_cancel->clicked.connect(dialog_->destroy.slot());
-      dialog_->destroy.connect(slot(this, &FormPrint::free));
+      dialog_->destroy.connect(SigC::slot(this, &FormPrint::free));
 
-      u_ = d_->updateBufferDependent.connect(slot(this,
-                                                 &FormPrint::update));
+      u_ = d_->updateBufferDependent.connect(SigC::slot(this,
+                                                 &FormPrint::updateSlot));
       h_ = d_->hideBufferDependent.connect(dialog_->destroy.slot());
 
       if (!dialog_->is_visible()) dialog_->show_all();
 
-      update();  // make sure its up-to-date
+      updateSlot();  // make sure its up-to-date
     }
   else
     {
@@ -119,14 +111,14 @@ void FormPrint::show()
 
 void FormPrint::hide()
 {
-  if (dialog_!=NULL) dialog_->destroy();
+  if (dialog_!=0) dialog_->destroy();
 }
 
 void FormPrint::free()
 {
-  if (dialog_!=NULL)
+  if (dialog_!=0)
     {
-      dialog_ = NULL;
+      dialog_ = 0;
       u_.disconnect();
       h_.disconnect();
     }
@@ -148,10 +140,10 @@ void FormPrint::apply()
       from = print_from_->get_text();
       to = print_to_->get_value_as_int();
     }
-  
+
   PrinterParams::Target t(PrinterParams::PRINTER);
   if (printto_file_->get_active()) t = PrinterParams::FILE;
-  
+
   // we really should use the return value here I think.
   if (!printBuffer(lv_->buffer(),
                   PrinterParams(t,
@@ -162,7 +154,7 @@ void FormPrint::apply()
                                 copies_unsorted_->get_active(),
                                 copies_count_->get_value_as_int())))
     {
-      WriteAlert(_("Error:"),
+      Alert::alert(_("Error:"),
                 _("Unable to print"),
                 _("Check that your parameters are correct"));
     }
@@ -170,9 +162,9 @@ void FormPrint::apply()
 
 
 // we can safely ignore the parameter because we can always update
-void FormPrint::update(bool)
+void FormPrint::updateSlot(bool)
 {
-  if (dialog_ != NULL &&
+  if (dialog_ != 0 &&
       lv_->view()->available())
     {
       PrinterParams pp(getPrinterParams(lv_->buffer()));
@@ -191,17 +183,17 @@ void FormPrint::update(bool)
        case PrinterParams::ODD:
          print_odd_->set_active(true);
          break;
-         
+
        case PrinterParams::EVEN:
          print_even_->set_active(true);
          break;
-         
+
        case PrinterParams::ALL:
        default:
          print_all_->set_active(true);
          break;
        }
-      
+
       // hmmm... maybe a bit weird but maybe not
       // we might just be remembering the last
       // time this was printed.