#include "GuiErrorList.h"
+#include "qt_helpers.h"
+
#include "Buffer.h"
#include "BufferView.h"
-#include "support/debug.h"
-#include "support/gettext.h"
-#include "Text.h"
#include "ParIterator.h"
+#include "Text.h"
-#include "qt_helpers.h"
-
+#include "support/debug.h"
+#include "support/gettext.h"
#include "support/lstrings.h"
#include <QListWidget>
-#include <QTextBrowser>
#include <QPushButton>
-#include <QCloseEvent>
+#include <QShowEvent>
+#include <QTextBrowser>
using namespace std;
using namespace lyx::support;
connect(closePB, SIGNAL(clicked()),
this, SLOT(slotClose()));
- connect(errorsLW, SIGNAL(itemClicked(QListWidgetItem *)),
- this, SLOT(select(QListWidgetItem *)));
+ connect(errorsLW, SIGNAL(itemSelectionChanged()),
+ this, SLOT(select()));
bc().setPolicy(ButtonPolicy::OkCancelPolicy);
bc().setCancel(closePB);
}
-void GuiErrorList::closeEvent(QCloseEvent * e)
-{
- slotClose();
- e->accept();
-}
-
-
void GuiErrorList::showEvent(QShowEvent * e)
{
errorsLW->setCurrentRow(0);
- select(errorsLW->item(0));
+ select();
e->accept();
}
-void GuiErrorList::select(QListWidgetItem * wi)
+void GuiErrorList::select()
{
- int const item = errorsLW->row(wi);
+ int const item = errorsLW->row(errorsLW->currentItem());
goTo(item);
descriptionTB->setPlainText(toqstr(errorList()[item].description));
}