* 3) Compile using the following command:
* g++ server_monitor.cpp -o monitor -I. `pkg-config --cflags --libs QtGui`
*
+ * Alternatively, you can create a Makefile with qmake and then build
+ * the executable by running make (or nmake, if you use msvc):
+ * qmake
+ * make
+ *
* Usage:
* 1) Set the LyXserver pipe path in the LyX preferences (on *nix you can use
* any path, for example ~/.lyx/lyxpipe, whereas on Windows the path has
* push the button labeled "Open pipes" and then try issuing some commands.
*/
-#include "server_monitor.h"
-
#include <QApplication>
#include <QtGui>
#include <QtDebug>
+#include "server_monitor.h"
+
class ReadPipe : public QThread {
public:
///
connect(submitCommandPB, SIGNAL(clicked()), this, SLOT(submitCommand()));
connect(donePB, SIGNAL(clicked()), this, SLOT(reject()));
- QVBoxLayout *mainLayout = new QVBoxLayout;
+ QVBoxLayout * mainLayout = new QVBoxLayout;
mainLayout->addWidget(gridGB);
mainLayout->addWidget(horizontalGB);
setLayout(mainLayout);
void LyXServerMonitor::createGridGroupBox()
{
gridGB = new QGroupBox;
- QGridLayout *layout = new QGridLayout;
+ QGridLayout * layout = new QGridLayout;
labels[0] = new QLabel("Pipe name");
pipeNameLE = new QLineEdit;
void LyXServerMonitor::createCmdsGroupBox()
{
horizontalGB = new QGroupBox;
- QHBoxLayout *layout = new QHBoxLayout;
+ QHBoxLayout * layout = new QHBoxLayout;
openPipesPB = new QPushButton("&Open pipes");
layout->addWidget(openPipesPB);
buffer[BUFSIZE - 1] = '\0';
::write(pipein, buffer, strlen(buffer));
}
- /* Say goodbye */
+ // Say goodbye
snprintf(buffer, BUFSIZE - 1, "LYXSRV:%s:bye\n",
clientname.toUtf8().constData());
buffer[BUFSIZE - 1] = '\0';
}
-int main(int argc, char *argv[])
+int main(int argc, char * argv[])
{
QApplication app(argc, argv);
LyXServerMonitor dialog;