mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
improved webui and jsonapi config pages
This commit is contained in:
parent
c877a6e5c8
commit
5251427cbf
@ -67,38 +67,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Token:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="tokenLineEdit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Tokens should spell as &quot;user:password&quot; where both user and password are alphanumeric strings.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addTokenPushButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeTokenPushButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
@ -141,6 +109,38 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Token:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="tokenLineEdit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Tokens should spell as &quot;user:password&quot; where both user and password are alphanumeric strings.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addTokenPushButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeTokenPushButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
|
@ -122,7 +122,10 @@ bool WebuiPage::restart()
|
||||
|
||||
rsWebUi->setUserPassword(ui.password_LE->text().toStdString());
|
||||
rsWebUi->setHtmlFilesDirectory(ui.webInterfaceFiles_LE->text().toStdString());
|
||||
|
||||
setCursor(Qt::WaitCursor) ;
|
||||
rsWebUi->restart();
|
||||
setCursor(Qt::ArrowCursor) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -140,7 +143,7 @@ void WebuiPage::loadParams()
|
||||
if(it != smap.end())
|
||||
whileBlocking(ui.password_LE)->setText(QString::fromStdString(it->second));
|
||||
|
||||
if(rsWebUi->isRunning() && rsJsonApi->isRunning())
|
||||
if(rsWebUi->isRunning())
|
||||
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDON)) ;
|
||||
else
|
||||
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDOFF)) ;
|
||||
@ -190,9 +193,23 @@ QString WebuiPage::helpText() const
|
||||
|
||||
void WebuiPage::onEnableCBClicked(bool checked)
|
||||
{
|
||||
ui.params_GB->setEnabled(checked);
|
||||
ui.startWebBrowser_PB->setEnabled(checked);
|
||||
QString S;
|
||||
QString errmsg;
|
||||
updateParams(errmsg);
|
||||
|
||||
ui.params_GB->setEnabled(checked);
|
||||
ui.startWebBrowser_PB->setEnabled(checked);
|
||||
ui.apply_PB->setEnabled(checked);
|
||||
|
||||
if(checked)
|
||||
{
|
||||
if(!restart())
|
||||
{
|
||||
QMessageBox::warning(0, tr("failed to start Webinterface"), "Failed to start the webinterface.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
checkShutdownWebui();
|
||||
}
|
||||
|
||||
void WebuiPage::onPortValueChanged(int /*value*/)
|
||||
@ -211,16 +228,8 @@ void WebuiPage::onApplyClicked()
|
||||
QString errmsg;
|
||||
updateParams(errmsg);
|
||||
|
||||
if(ui.enableWebUI_CB->isChecked())
|
||||
{
|
||||
if(!restart())
|
||||
{
|
||||
QMessageBox::warning(0, tr("failed to start Webinterface"), "Failed to start the webinterface.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
checkShutdownWebui();
|
||||
}
|
||||
restart();
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user