|
Lines 1220-1226
Link Here
|
| 1220 |
else if (type != `ftp) |
1220 |
else if (type != `ftp) |
| 1221 |
// FTP needs to distinguish absolute and relative path |
1221 |
// FTP needs to distinguish absolute and relative path |
| 1222 |
{ |
1222 |
{ |
| 1223 |
directory = Slashed (directory); |
1223 |
// do not add the slash if host and directory is empty |
|
|
1224 |
// (avoid e.g. http:// -> http:/// when switching from the parts to the complete view) |
| 1225 |
if (host != "" || directory != "") |
| 1226 |
directory = Slashed (directory); |
| 1224 |
} |
1227 |
} |
| 1225 |
if (UI::WidgetExists (`id (`workgroup))) |
1228 |
if (UI::WidgetExists (`id (`workgroup))) |
| 1226 |
{ |
1229 |
{ |
|
Lines 1252-1257
Link Here
|
| 1252 |
_url = (string)UI::QueryWidget(`id(`complete_url), `Value); |
1255 |
_url = (string)UI::QueryWidget(`id(`complete_url), `Value); |
| 1253 |
} |
1256 |
} |
| 1254 |
|
1257 |
|
|
|
1258 |
// use selected editing URL part, remember the value in case the URL is wrong |
| 1259 |
// and the dialog needs to displayed again |
| 1260 |
boolean editing_parts = true; |
| 1261 |
|
| 1255 |
/** |
1262 |
/** |
| 1256 |
* Handle function of a widget |
1263 |
* Handle function of a widget |
| 1257 |
* @param key string widget key |
1264 |
* @param key string widget key |
|
Lines 1377-1382
Link Here
|
| 1377 |
ServerStoreParts(); |
1384 |
ServerStoreParts(); |
| 1378 |
} |
1385 |
} |
| 1379 |
|
1386 |
|
|
|
1387 |
editing_parts = (id == `edit_url_parts); |
| 1388 |
|
| 1380 |
// reinitialize the dialog (set the current values) |
1389 |
// reinitialize the dialog (set the current values) |
| 1381 |
ServerInit(nil); |
1390 |
ServerInit(nil); |
| 1382 |
} |
1391 |
} |
|
Lines 1387-1395
Link Here
|
| 1387 |
* @param key string widget key |
1396 |
* @param key string widget key |
| 1388 |
*/ |
1397 |
*/ |
| 1389 |
void ServerInit (string key) { |
1398 |
void ServerInit (string key) { |
|
|
1399 |
// check the current edit type |
| 1400 |
symbol current_type = editing_parts ? `edit_url_parts : `edit_complete_url; |
| 1390 |
|
1401 |
|
| 1391 |
// check the current edit type |
1402 |
// set the stored value |
| 1392 |
symbol current_type = (symbol)UI::QueryWidget(`id(`edit_type), `Value); |
1403 |
UI::ChangeWidget(`id(`edit_type), `Value, current_type); |
|
|
1404 |
|
| 1393 |
y2debug("Current edit type: %1", current_type); |
1405 |
y2debug("Current edit type: %1", current_type); |
| 1394 |
|
1406 |
|
| 1395 |
UI::ReplaceWidget(`id(`edit_content), (current_type == `edit_url_parts) ? details_content : complete_content); |
1407 |
UI::ReplaceWidget(`id(`edit_content), (current_type == `edit_url_parts) ? details_content : complete_content); |
|
Lines 1522-1528
Link Here
|
| 1522 |
symbol current_type = (symbol)UI::QueryWidget(`id(`edit_type), `Value); |
1534 |
symbol current_type = (symbol)UI::QueryWidget(`id(`edit_type), `Value); |
| 1523 |
y2debug("Current edit type: %1", current_type); |
1535 |
y2debug("Current edit type: %1", current_type); |
| 1524 |
|
1536 |
|
| 1525 |
if (current_type == `edit_url_parts) |
1537 |
editing_parts = (current_type == `edit_url_parts); |
|
|
1538 |
|
| 1539 |
if (editing_parts) |
| 1526 |
{ |
1540 |
{ |
| 1527 |
ServerStoreParts(); |
1541 |
ServerStoreParts(); |
| 1528 |
} |
1542 |
} |
|
Lines 1532-1538
Link Here
|
| 1532 |
} |
1546 |
} |
| 1533 |
} |
1547 |
} |
| 1534 |
|
1548 |
|
| 1535 |
|
|
|
| 1536 |
/** |
1549 |
/** |
| 1537 |
* Get widget description map |
1550 |
* Get widget description map |
| 1538 |
* @return widget description map |
1551 |
* @return widget description map |
|
Lines 1543-1551
Link Here
|
| 1543 |
"custom_widget" : `VBox ( |
1556 |
"custom_widget" : `VBox ( |
| 1544 |
`RadioButtonGroup (`id (`edit_type), |
1557 |
`RadioButtonGroup (`id (`edit_type), |
| 1545 |
`HBox ( |
1558 |
`HBox ( |
| 1546 |
`RadioButton(`id(`edit_url_parts), `opt(`notify), _("Edit Parts of the URL"), true), |
1559 |
`RadioButton(`id(`edit_url_parts), `opt(`notify), _("Edit Parts of the URL"), editing_parts), |
| 1547 |
`HSpacing(2), |
1560 |
`HSpacing(2), |
| 1548 |
`RadioButton(`id(`edit_complete_url), `opt(`notify), _("Edit Complete URL")) |
1561 |
`RadioButton(`id(`edit_complete_url), `opt(`notify), _("Edit Complete URL"), !editing_parts) |
| 1549 |
) |
1562 |
) |
| 1550 |
), |
1563 |
), |
| 1551 |
`VSpacing(0.3), |
1564 |
`VSpacing(0.3), |
|
Lines 1782-1788
Link Here
|
| 1782 |
symbol selected = (symbol)UI::QueryWidget (`id (`type), `CurrentButton); |
1795 |
symbol selected = (symbol)UI::QueryWidget (`id (`type), `CurrentButton); |
| 1783 |
|
1796 |
|
| 1784 |
if (contains ([`ftp, `http, `https, `samba, `nfs, `cd, `dvd, `usb, `hd, |
1797 |
if (contains ([`ftp, `http, `https, `samba, `nfs, `cd, `dvd, `usb, `hd, |
| 1785 |
`local_dir, `specify__url, `slp, `local_iso, `comm_repos], selected)) |
1798 |
`local_dir, `specify_url, `slp, `local_iso, `comm_repos], selected)) |
| 1786 |
{ |
1799 |
{ |
| 1787 |
if ( selected == `ftp ) _url = "ftp://"; |
1800 |
if ( selected == `ftp ) _url = "ftp://"; |
| 1788 |
else if ( selected == `http ) _url = "http://"; |
1801 |
else if ( selected == `http ) _url = "http://"; |
|
Lines 2030-2037
Link Here
|
| 2030 |
* Sample implementation of URL selection dialog |
2043 |
* Sample implementation of URL selection dialog |
| 2031 |
* @return symbol for wizard sequencer |
2044 |
* @return symbol for wizard sequencer |
| 2032 |
*/ |
2045 |
*/ |
| 2033 |
global symbol EditDialog () { |
2046 |
global symbol EditDialogProtocol(string proto) |
| 2034 |
string proto = URLScheme (_url); |
2047 |
{ |
| 2035 |
y2milestone ("Displaying dialog for protocol %1", proto); |
2048 |
y2milestone ("Displaying dialog for protocol %1", proto); |
| 2036 |
string caption = _caption[proto]:""; |
2049 |
string caption = _caption[proto]:""; |
| 2037 |
|
2050 |
|
|
Lines 2045-2051
Link Here
|
| 2045 |
"fallback_functions" : $[] |
2058 |
"fallback_functions" : $[] |
| 2046 |
]); |
2059 |
]); |
| 2047 |
} |
2060 |
} |
|
|
2061 |
/** |
| 2062 |
* Sample implementation of URL selection dialog |
| 2063 |
* @return symbol for wizard sequencer |
| 2064 |
*/ |
| 2065 |
global symbol EditDialog () { |
| 2066 |
string proto = URLScheme (_url); |
| 2048 |
|
2067 |
|
|
|
2068 |
return EditDialogProtocol(proto); |
| 2069 |
} |
| 2070 |
|
| 2049 |
/** |
2071 |
/** |
| 2050 |
* URL editation popup with the HTTPS option |
2072 |
* URL editation popup with the HTTPS option |
| 2051 |
* @return string modified URL or empty string if canceled |
2073 |
* @return string modified URL or empty string if canceled |