add citation reminder

This commit is contained in:
Axel Kohlmeyer
2025-04-30 12:17:31 -04:00
parent 2fa9cc7ae1
commit f9ba063c4a
2 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,7 @@
Add option to visualize molecules defined through the molecule command Add option to visualize molecules defined through the molecule command
Add text fields for editing plot title and axis labels for charts Add text fields for editing plot title and axis labels for charts
Add option to automatically open tutorial websites (enabled by default) Add option to automatically open tutorial websites (enabled by default)
Add citation reminder comment to empty documents and the About dialog currently pointing to arXiv.
Add preferences tab for charts to set default for title, plot colors, smooth/raw plot, smooth params Add preferences tab for charts to set default for title, plot colors, smooth/raw plot, smooth params
Highlight error URLs with pointers to additional explanations in log window Highlight error URLs with pointers to additional explanations in log window
Double-click on highlighted URL opens it in web browser. Also available via context menu. Double-click on highlighted URL opens it in web browser. Also available via context menu.

View File

@ -68,6 +68,8 @@
static const QString blank(" "); static const QString blank(" ");
static constexpr int BUFLEN = 256; static constexpr int BUFLEN = 256;
static const QString citeme("# When using LAMMPS-GUI in your project, please cite: "
"https://arxiv.org/abs/2503.14020\n");
LammpsGui::LammpsGui(QWidget *parent, const QString &filename) : LammpsGui::LammpsGui(QWidget *parent, const QString &filename) :
QMainWindow(parent), ui(new Ui::LammpsGui), highlighter(nullptr), capturer(nullptr), QMainWindow(parent), ui(new Ui::LammpsGui), highlighter(nullptr), capturer(nullptr),
@ -78,6 +80,8 @@ LammpsGui::LammpsGui(QWidget *parent, const QString &filename) :
{ {
docver = ""; docver = "";
ui->setupUi(this); ui->setupUi(this);
ui->textEdit->document()->setPlainText(citeme);
ui->textEdit->document()->setModified(false);
this->setCentralWidget(ui->textEdit); this->setCentralWidget(ui->textEdit);
highlighter = new Highlighter(ui->textEdit->document()); highlighter = new Highlighter(ui->textEdit->document());
capturer = new StdCapture; capturer = new StdCapture;
@ -413,7 +417,8 @@ LammpsGui::~LammpsGui()
void LammpsGui::new_document() void LammpsGui::new_document()
{ {
current_file.clear(); current_file.clear();
ui->textEdit->document()->setPlainText(QString()); ui->textEdit->document()->setPlainText(citeme);
ui->textEdit->document()->setModified(false);
if (lammps.is_running()) { if (lammps.is_running()) {
stop_run(); stop_run();
@ -1487,10 +1492,10 @@ void LammpsGui::about()
info = std::string(info, start, end - start); info = std::string(info, start, end - start);
} }
info += citeme.toStdString();
to_clipboard += info.c_str(); to_clipboard += info.c_str();
#if QT_CONFIG(clipboard) #if QT_CONFIG(clipboard)
QGuiApplication::clipboard()->setText(to_clipboard); QGuiApplication::clipboard()->setText(to_clipboard);
info += "(Note: this text has been copied to the clipboard)\n";
#endif #endif
QMessageBox msg; QMessageBox msg;