mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-31 19:18:28 -04:00
improved webui and jsonapi config pages
This commit is contained in:
parent
c877a6e5c8
commit
5251427cbf
retroshare-gui/src/gui/settings
@ -67,38 +67,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
@ -141,6 +109,38 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -122,7 +122,10 @@ bool WebuiPage::restart()
|
|||||||
|
|
||||||
rsWebUi->setUserPassword(ui.password_LE->text().toStdString());
|
rsWebUi->setUserPassword(ui.password_LE->text().toStdString());
|
||||||
rsWebUi->setHtmlFilesDirectory(ui.webInterfaceFiles_LE->text().toStdString());
|
rsWebUi->setHtmlFilesDirectory(ui.webInterfaceFiles_LE->text().toStdString());
|
||||||
|
|
||||||
|
setCursor(Qt::WaitCursor) ;
|
||||||
rsWebUi->restart();
|
rsWebUi->restart();
|
||||||
|
setCursor(Qt::ArrowCursor) ;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -140,7 +143,7 @@ void WebuiPage::loadParams()
|
|||||||
if(it != smap.end())
|
if(it != smap.end())
|
||||||
whileBlocking(ui.password_LE)->setText(QString::fromStdString(it->second));
|
whileBlocking(ui.password_LE)->setText(QString::fromStdString(it->second));
|
||||||
|
|
||||||
if(rsWebUi->isRunning() && rsJsonApi->isRunning())
|
if(rsWebUi->isRunning())
|
||||||
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDON)) ;
|
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDON)) ;
|
||||||
else
|
else
|
||||||
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDOFF)) ;
|
ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDOFF)) ;
|
||||||
@ -190,9 +193,23 @@ QString WebuiPage::helpText() const
|
|||||||
|
|
||||||
void WebuiPage::onEnableCBClicked(bool checked)
|
void WebuiPage::onEnableCBClicked(bool checked)
|
||||||
{
|
{
|
||||||
ui.params_GB->setEnabled(checked);
|
QString errmsg;
|
||||||
ui.startWebBrowser_PB->setEnabled(checked);
|
updateParams(errmsg);
|
||||||
QString S;
|
|
||||||
|
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*/)
|
void WebuiPage::onPortValueChanged(int /*value*/)
|
||||||
@ -211,16 +228,8 @@ void WebuiPage::onApplyClicked()
|
|||||||
QString errmsg;
|
QString errmsg;
|
||||||
updateParams(errmsg);
|
updateParams(errmsg);
|
||||||
|
|
||||||
if(ui.enableWebUI_CB->isChecked())
|
restart();
|
||||||
{
|
|
||||||
if(!restart())
|
|
||||||
{
|
|
||||||
QMessageBox::warning(0, tr("failed to start Webinterface"), "Failed to start the webinterface.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
checkShutdownWebui();
|
|
||||||
}
|
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user