]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/FormVCLog.C
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / xforms / FormVCLog.C
index 997cdcf792c1817102fd9472a1f6663479c41c4a..08f7b94b86dce0c6e63acb4d96b50bd0db030115 100644 (file)
@@ -1,52 +1,37 @@
-/* FormVCLog.C
- * (C) 2001 LyX Team
- * John Levon, moz@compsoc.man.ac.uk
+/**
+ * \file FormVCLog.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include FORMS_H_LOCATION
+#include "FormVCLog.h"
+#include "ControlVCLog.h"
+#include "forms/form_browser.h"
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "xformsBC.h"
 
-#include "gettext.h" 
-#include "FormVCLog.h"
-#include "form_browser.h"
-#include "LyXView.h"
-#include "Dialogs.h"
-#include "lyxrc.h"
-#include "buffer.h"
-
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::slot;
-#endif
-
-FormVCLog::FormVCLog(LyXView * lv, Dialogs * d)
-       : FormBrowser(lv, d, _("Version Control Log"))
-{
-       // 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->showVCLogFile.connect(slot(this, &FormVCLog::show));
-}
+#include "lyx_forms.h"
+
+#include "support/std_sstream.h"
+
+
+FormVCLog::FormVCLog(Dialog & parent)
+       : FormController<ControlVCLog, FormBrowser>(parent, _("Version Control Log"))
+{}
 
-FormVCLog::~FormVCLog()
-{
-}
 
 void FormVCLog::update()
 {
-       if (!dialog_ || !lv_->view()->available())
-               return;
-       const string logfile = lv_->view()->buffer()->lyxvc.getLogFile();
-
        fl_clear_browser(dialog_->browser);
 
-       if (logfile=="" || !fl_load_browser(dialog_->browser, logfile.c_str()))
-               fl_add_browser_line(dialog_->browser, _("No version control log file available"));
+       ostringstream ss;
+       controller().getVCLogFile(ss);
 
-       lyx::unlink(logfile); 
+       fl_add_browser_line(dialog_->browser, ss.str().c_str());
 }