okButton.pressed.connect(this, "onClicked()");
userid = "sysrabt";
urlLabel = new QLabel("http://"+url +tr("/pub/") +userid + tr("/"));
QHBoxLayout urlLayout = new QHBoxLayout();
urlLayout.addWidget(urlLabel);
this.url = new QLineEdit();
this.url.textChanged.connect(this, "urlEdited()");
urlLayout.addWidget(this.url);
QVBoxLayout textEditLayout = new QVBoxLayout();
textEditLayout.addWidget(new QLabel(tr("Notebook: ") +n.getName()));
textEditLayout.addWidget(new QLabel(tr("Public URL")));
textEditLayout.addLayout(urlLayout);
textEditLayout.addWidget(new QLabel(tr("Description")));
description = new QTextEdit();
textEditLayout.addWidget(description);
sortedBy = new QComboBox(this);
sortOrder = new QComboBox(this);
QHBoxLayout orderLayout = new QHBoxLayout();
orderLayout.addWidget(new QLabel(tr("Sort By")));
Qt.Alignment right = new Qt.Alignment();
right.set(Qt.AlignmentFlag.AlignRight);
orderLayout.setAlignment(right);
orderLayout.addWidget(sortedBy);
orderLayout.addSpacing(50);
orderLayout.addWidget(new QLabel(tr("Sort Order")));
orderLayout.addWidget(sortOrder);
sortedBy.addItem(tr("Date Created"), NoteSortOrder.CREATED);
sortedBy.addItem(tr("Date Updated"), NoteSortOrder.UPDATED);
sortOrder.addItem(tr("Newest to oldest"), false);
sortOrder.addItem(tr("Oldest to newest"), true);
textEditLayout.addLayout(orderLayout);
cancelButton = new QPushButton();
cancelButton.setText(tr("Cancel"));
cancelButton.pressed.connect(this, "onCancel()");
stopButton = new QPushButton(tr("Stop Sharing"));
stopButton.setVisible(false);
stopButton.clicked.connect(this, "stopPublishing()");
QHBoxLayout buttonLayout = new QHBoxLayout();
buttonLayout.addStretch(1);
buttonLayout.addWidget(stopButton);
buttonLayout.addWidget(okButton);
buttonLayout.addWidget(cancelButton);
setWindowTitle(tr("Share A Notebook With The World"));
QVBoxLayout mainLayout = new QVBoxLayout();
mainLayout.addLayout(textEditLayout);
mainLayout.addSpacing(1);