]> git.lyx.org Git - features.git/blobdiff - development/lyxserver/server_monitor.cpp
Add a server_monitor.pro file.
[features.git] / development / lyxserver / server_monitor.cpp
index 36dbb24de9b89b4f63729007c510d707d8bbeab7..39b479ee0e1d5edc41ee7946777717f8389b0175 100644 (file)
  * 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:
        ///
@@ -87,7 +92,7 @@ LyXServerMonitor::LyXServerMonitor()
        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);
@@ -106,7 +111,7 @@ LyXServerMonitor::~LyXServerMonitor()
 void LyXServerMonitor::createGridGroupBox()
 {
        gridGB = new QGroupBox;
-       QGridLayout *layout = new QGridLayout;
+       QGridLayout * layout = new QGridLayout;
 
        labels[0] = new QLabel("Pipe name");
        pipeNameLE = new QLineEdit;
@@ -151,7 +156,7 @@ void LyXServerMonitor::createGridGroupBox()
 void LyXServerMonitor::createCmdsGroupBox()
 {
        horizontalGB = new QGroupBox;
-       QHBoxLayout *layout = new QHBoxLayout;
+       QHBoxLayout * layout = new QHBoxLayout;
 
        openPipesPB = new QPushButton("&Open pipes");
        layout->addWidget(openPipesPB);
@@ -338,7 +343,7 @@ void LyXServerMonitor::closePipes()
                                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';
@@ -377,7 +382,7 @@ void LyXServerMonitor::submitCommand()
 }
 
 
-int main(int argc, char *argv[])
+int main(int argc, char * argv[])
 {
        QApplication app(argc, argv);
        LyXServerMonitor dialog;