GUI: Add feature description into Wi-Fi Sharing tab

This commit is contained in:
Alexander Tkachev 2019-07-19 20:06:01 +07:00 committed by Matan Bareket
parent a9d47a163e
commit e4da63823a
11 changed files with 66 additions and 0 deletions

View File

@ -1514,6 +1514,8 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
_serverPortDesc = 0;
_serverPort = 0;
_serverPortClearButton = 0;
_featureDescriptionLine1 = 0;
_featureDescriptionLine2 = 0;
_serverWasRunning = false;
#endif
#endif
@ -1915,6 +1917,9 @@ void GlobalOptionsDialog::addWiFiSharingControls(GuiObject *boss, const Common::
_serverPortDesc = new StaticTextWidget(boss, prefix + "ServerPortDesc", _("Server's port:"), _("Port for server to use"));
_serverPort = new EditTextWidget(boss, prefix + "ServerPortEditText", Common::String::format("%u", port), 0);
_serverPortClearButton = addClearButton(boss, prefix + "ServerPortClearButton", kServerPortClearCmd);
_featureDescriptionLine1 = new StaticTextWidget(boss, prefix + "FeatureDescriptionLine1", _c("Run server to manage files with browser (in the same Wi-Fi network).", context), "", ThemeEngine::kFontStyleNormal);
_featureDescriptionLine2 = new StaticTextWidget(boss, prefix + "FeatureDescriptionLine2", _c("Closing options dialog will stop the server.", context), "", ThemeEngine::kFontStyleNormal);
reflowWiFiSharingTabLayout();
@ -2626,6 +2631,17 @@ void GlobalOptionsDialog::reflowWiFiSharingTabLayout() {
if (_serverPortClearButton)
_serverPortClearButton->setVisible(false);
#endif // NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE
// if port override isn't supported, there will be a gap between these lines and options -- it's OK
if (_featureDescriptionLine1) {
_featureDescriptionLine1->setVisible(true);
_featureDescriptionLine1->setEnabled(false);
}
if (_featureDescriptionLine2) {
_featureDescriptionLine2->setVisible(true);
_featureDescriptionLine2->setEnabled(false);
}
}
#endif // USE_SDL_NET

View File

@ -343,6 +343,8 @@ protected:
StaticTextWidget *_serverPortDesc;
EditTextWidget *_serverPort;
ButtonWidget *_serverPortClearButton;
StaticTextWidget *_featureDescriptionLine1;
StaticTextWidget *_featureDescriptionLine2;
bool _serverWasRunning;
void addWiFiSharingControls(GuiObject *boss, const Common::String &prefix, const char *context = nullptr);

Binary file not shown.

View File

@ -767,6 +767,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '4' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>

View File

@ -774,6 +774,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '2' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>

Binary file not shown.

View File

@ -781,6 +781,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '4' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>

View File

@ -772,6 +772,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '2' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>

Binary file not shown.

View File

@ -781,6 +781,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '4' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>

View File

@ -772,6 +772,14 @@
width = 'Globals.Line.Height'
/>
</layout>
<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '2' center = 'true'>
<widget name = 'FeatureDescriptionLine1'
height = 'Globals.Line.Height'
/>
<widget name = 'FeatureDescriptionLine2'
height = 'Globals.Line.Height'
/>
</layout>
</layout>
</dialog>