Skip to content

Commit 314fa17

Browse files
committed
[Cleanup] Add "reloadOnChange" icon for all occasions change will reload
1 parent ec9172e commit 314fa17

File tree

10 files changed

+11
-198
lines changed

10 files changed

+11
-198
lines changed

src/src/DataTypes/FormSelectorOptions.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,5 @@ void FormSelectorOptions::addSelector(const String& id,
152152

153153
if ((i & 0x07) == 0) { delay(0); }
154154
}
155-
addSelector_Foot();
156-
157-
if (reloadonchange) {
158-
addHtml(F("🔄"));
159-
160-
// addFormNote(F("Page will reload when selection is changed."));
161-
}
155+
addSelector_Foot(reloadonchange);
162156
}

src/src/WebServer/ControllerPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
318318
disabled);
319319
++protocolIndex;
320320
}
321-
addSelector_Foot();
321+
addSelector_Foot(true);
322322

323323
addHelpButton(F("EasyProtocols"));
324324

src/src/WebServer/CustomPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bool handle_custom(const String& path) {
9898
addSelector_Item(name, it->first, choice == it->first);
9999
}
100100
}
101-
addSelector_Foot();
101+
addSelector_Foot(true);
102102

103103
// create <> navigation buttons
104104
uint8_t prev = Settings.Unit;

src/src/WebServer/DevicesPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void addDeviceSelect(const __FlashStringHelper *name, pluginID_t choice)
252252
++x;
253253
}
254254

255-
addSelector_Foot();
255+
addSelector_Foot(true);
256256
}
257257

258258
// ********************************************************************************

src/src/WebServer/FactoryResetPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void addPreDefinedConfigSelector() {
131131
model == active_model);
132132
}
133133
}
134-
addSelector_Foot();
134+
addSelector_Foot(true);
135135
}
136136

137137
#ifdef WEBSERVER_NEW_UI

src/src/WebServer/Markup.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,12 @@ void addSelector_Item(const String& option, int index, bool selected, bool
255255
addHtml(F("</option>"));
256256
}
257257

258-
void addSelector_Foot()
258+
void addSelector_Foot(bool reloadonchange)
259259
{
260260
addHtml(F("</select>"));
261+
if (reloadonchange) {
262+
addHtml(F("&#128260;"));
263+
}
261264
}
262265

263266
void addUnit(const __FlashStringHelper *unit)

src/src/WebServer/Markup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void addSelector_Item(const String& option,
6565
bool disabled = false,
6666
const String& attr = EMPTY_STRING);
6767

68-
void addSelector_Foot();
68+
void addSelector_Foot(bool reloadonchange = false);
6969

7070
void addUnit(const __FlashStringHelper *unit);
7171
void addUnit(const String& unit);

src/src/WebServer/Markup_Forms.cpp

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -507,123 +507,6 @@ void addFormSelectorI2C(const String& id,
507507
addSelector_Foot();
508508
}
509509

510-
/*
511-
void addFormSelector(const __FlashStringHelper * label,
512-
const __FlashStringHelper * id,
513-
int optionCount,
514-
const int indices[],
515-
int selectedIndex,
516-
bool reloadonchange)
517-
{
518-
FormSelectorOptions selector(optionCount, indices);
519-
selector.reloadonchange = reloadonchange;
520-
selector.addFormSelector(label, id, selectedIndex);
521-
}
522-
523-
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange)
524-
{
525-
addFormSelector(String(label), String(id), optionCount, options, indices, nullptr, selectedIndex, reloadonchange);
526-
}
527-
528-
void addFormSelector(const __FlashStringHelper * label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange)
529-
{
530-
addFormSelector(String(label), id, optionCount, options, indices, nullptr, selectedIndex, reloadonchange);
531-
}
532-
533-
void addFormSelector(const String& label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex)
534-
{
535-
addFormSelector(label, id, optionCount, options, indices, nullptr, selectedIndex, false);
536-
}
537-
538-
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const String options[], const int indices[], int selectedIndex)
539-
{
540-
addFormSelector(String(label), String(id), optionCount, options, indices, nullptr, selectedIndex, false);
541-
}
542-
543-
void addFormSelector(const String & label,
544-
const String & id,
545-
int optionCount,
546-
const String options[],
547-
const int indices[],
548-
int selectedIndex
549-
#if FEATURE_TOOLTIPS
550-
, const String& tooltip
551-
#endif // if FEATURE_TOOLTIPS
552-
)
553-
{
554-
addFormSelector(label, id, optionCount, options, indices, nullptr, selectedIndex, false
555-
#if FEATURE_TOOLTIPS
556-
, tooltip
557-
#endif // if FEATURE_TOOLTIPS
558-
);
559-
}
560-
561-
void addFormSelector(const String& label,
562-
const String& id,
563-
int optionCount,
564-
const __FlashStringHelper * options[],
565-
const int indices[],
566-
int selectedIndex,
567-
bool reloadonchange)
568-
{
569-
addFormSelector(label, id, optionCount, options, indices, nullptr, selectedIndex, reloadonchange);
570-
}
571-
572-
void addFormSelector(const String& label,
573-
const String& id,
574-
int optionCount,
575-
const __FlashStringHelper * options[],
576-
const int indices[],
577-
const String attr[],
578-
int selectedIndex,
579-
bool reloadonchange)
580-
{
581-
FormSelectorOptions selector(optionCount, options, indices, attr);
582-
selector.reloadonchange = reloadonchange;
583-
selector.addFormSelector(label, id, selectedIndex);
584-
}
585-
586-
void addFormSelector(const String& label,
587-
const String& id,
588-
int optionCount,
589-
const String options[],
590-
const int indices[],
591-
int selectedIndex,
592-
bool reloadonchange
593-
#if FEATURE_TOOLTIPS
594-
, const String& tooltip
595-
#endif // if FEATURE_TOOLTIPS
596-
)
597-
{
598-
addFormSelector(label, id, optionCount, options, indices, nullptr, selectedIndex, reloadonchange
599-
#if FEATURE_TOOLTIPS
600-
, tooltip
601-
#endif // if FEATURE_TOOLTIPS
602-
);
603-
}
604-
605-
void addFormSelector(const String & label,
606-
const String & id,
607-
int optionCount,
608-
const String options[],
609-
const int indices[],
610-
const String attr[],
611-
int selectedIndex,
612-
bool reloadonchange
613-
#if FEATURE_TOOLTIPS
614-
, const String& tooltip
615-
#endif // if FEATURE_TOOLTIPS
616-
)
617-
{
618-
FormSelectorOptions selector(optionCount, options, indices, attr);
619-
selector.reloadonchange = reloadonchange;
620-
#if FEATURE_TOOLTIPS
621-
selector.tooltip = tooltip;
622-
#endif
623-
selector.addFormSelector(label, id, selectedIndex);
624-
}
625-
*/
626-
627510
void addFormSelector_YesNo(const __FlashStringHelper * label,
628511
const __FlashStringHelper * id,
629512
int selectedIndex,

src/src/WebServer/Markup_Forms.h

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -292,73 +292,6 @@ void addFormSelectorI2C(const String& id,
292292
#endif
293293
);
294294

295-
/*
296-
297-
void addFormSelector(const String& label,
298-
const String& id,
299-
int optionCount,
300-
const String options[],
301-
const int indices[],
302-
int selectedIndex
303-
#if FEATURE_TOOLTIPS
304-
,
305-
const String& tooltip = EMPTY_STRING
306-
#endif
307-
);
308-
309-
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const int indices[], int selectedIndex, bool reloadonchange = false);
310-
311-
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange = false);
312-
void addFormSelector(const __FlashStringHelper * label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange = false);
313-
void addFormSelector(const String& label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex);
314-
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const String options[], const int indices[], int selectedIndex);
315-
316-
void addFormSelector(const String& label,
317-
const String& id,
318-
int optionCount,
319-
const __FlashStringHelper * options[],
320-
const int indices[],
321-
int selectedIndex,
322-
bool reloadonchange);
323-
324-
void addFormSelector(const String& label,
325-
const String& id,
326-
int optionCount,
327-
const __FlashStringHelper * options[],
328-
const int indices[],
329-
const String attr[],
330-
int selectedIndex,
331-
bool reloadonchange);
332-
333-
334-
void addFormSelector(const String& label,
335-
const String& id,
336-
int optionCount,
337-
const String options[],
338-
const int indices[],
339-
int selectedIndex,
340-
bool reloadonchange
341-
#if FEATURE_TOOLTIPS
342-
,
343-
const String& tooltip = EMPTY_STRING
344-
#endif
345-
);
346-
347-
void addFormSelector(const String& label,
348-
const String& id,
349-
int optionCount,
350-
const String options[],
351-
const int indices[],
352-
const String attr[],
353-
int selectedIndex,
354-
bool reloadonchange
355-
#if FEATURE_TOOLTIPS
356-
,
357-
const String& tooltip = EMPTY_STRING
358-
#endif
359-
);
360-
*/
361-
362295
void addFormSelector_YesNo(const __FlashStringHelper * label,
363296
const __FlashStringHelper * id,
364297
int selectedIndex,

src/src/WebServer/NotificationPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void handle_notifications() {
205205
Notification[x].Number,
206206
choice == Notification[x].Number);
207207
}
208-
addSelector_Foot();
208+
addSelector_Foot(true);
209209

210210
addHelpButton(F("EasyNotifications"));
211211
addRTDHelpButton(F("Notify/_Notifications.html"));

0 commit comments

Comments
 (0)