Skip to content

Commit eaad228

Browse files
author
Koen Deforche
committed
Several changes:
- added a test case for the http client and server - WResource: handleAbort() allows aborted requests to be handled - Http::ResourceContinuation::haveMoreData(): allow an individual request to be continued - Http::Client: allow response data to be processed incrementally - fix #3613: WDialog problems without javascript - fix browser detection of Qt5 browser (#3287) - fix CLang + boost 1.57 build - fix namespace scoping (#3655) - fix enable() to take into account ancestor enabled state (#3629) - show resize handle in bootstrap themes (#3653) - keep track of dialog order also server-side (#3652, Bruce Toll) - fix treetable layout issue (#3651) - fix WTreeNode::expand() on an empty node (#3650) - fix internal path url encoding regression (#3638) - added constructor for WInPlacEdit that configures buttons (#3418) - fix WTableView::setRowHeight() messes up layout (#3628) - fix WPanel bootstraptheme layout glitch (#3649) - fix XHTML tooltip in default CSS theme - WTemplate: store bound strings as WString so they translate properly
1 parent 00f113f commit eaad228

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+658
-127
lines changed

examples/widgetgallery/examples/Dialog.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
#include <Wt/WApplication>
12
#include <Wt/WBreak>
23
#include <Wt/WContainerWidget>
34
#include <Wt/WDialog>
5+
#include <Wt/WEnvironment>
46
#include <Wt/WLabel>
57
#include <Wt/WLineEdit>
68
#include <Wt/WPushButton>
@@ -25,7 +27,8 @@ extern void showDialog(Wt::WText *out)
2527

2628
Wt::WPushButton *ok = new Wt::WPushButton("OK", dialog->footer());
2729
ok->setDefault(true);
28-
ok->disable();
30+
if (wApp->environment().ajax())
31+
ok->disable();
2932

3033
Wt::WPushButton *cancel = new Wt::WPushButton("Cancel", dialog->footer());
3134
dialog->rejectWhenEscapePressed();

resources/themes/bootstrap/2/wt.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@
250250
.Wt-cal .days td .Wt-cal-sel,
251251
.Wt-cal .days td .Wt-cal-sel:hover {
252252
color: #ffffff;
253+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
253254
background-color: #006dcc;
254255
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
255256
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
@@ -994,3 +995,13 @@ body.Wt-rtl .Wt-treeview .Wt-ctrl.noexpand {
994995
overflow: hidden;
995996
position: relative;
996997
}
998+
/*
999+
* WResizable
1000+
*/
1001+
.Wt-resizable,
1002+
.Wt-resizable.modal .modal-footer {
1003+
background-image: url(../../../resizable.png);
1004+
background-repeat: no-repeat;
1005+
background-attachment: scroll;
1006+
background-position: right bottom;
1007+
}

resources/themes/bootstrap/2/wt.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,3 +1049,13 @@ body.Wt-rtl {
10491049
overflow: hidden;
10501050
position: relative;
10511051
}
1052+
1053+
/*
1054+
* WResizable
1055+
*/
1056+
.Wt-resizable, .Wt-resizable.modal .modal-footer {
1057+
background-image: url(../../../resizable.png);
1058+
background-repeat: no-repeat;
1059+
background-attachment: scroll;
1060+
background-position: right bottom;
1061+
}

resources/themes/bootstrap/3/wt.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138

139139
.modal-dialog {
140140
display: block;
141+
width: auto;
141142
}
142143

143144
.modal-dialog .modal-header {
@@ -1144,3 +1145,14 @@ body.Wt-rtl .Wt-treeview .Wt-ctrl.noexpand {
11441145
.Wt-calendar .form-control {
11451146
display: initial;
11461147
}
1148+
1149+
/*
1150+
* WResizable
1151+
*/
1152+
1153+
.modal-dialog.Wt-resizable .modal-content {
1154+
background-attachment: scroll;
1155+
background-image: url(../../../resizable.png);
1156+
background-position: right bottom;
1157+
background-repeat: no-repeat;
1158+
}

resources/themes/bootstrap/3/wt.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,3 +1050,13 @@ body.Wt-rtl {
10501050
.Wt-calendar .form-control {
10511051
display: initial;
10521052
}
1053+
1054+
/*
1055+
* WResizable
1056+
*/
1057+
.modal-dialog.Wt-resizable .modal-content {
1058+
background-image: url(../../../resizable.png);
1059+
background-repeat: no-repeat;
1060+
background-attachment: scroll;
1061+
background-position: right bottom;
1062+
}

src/Wt/Auth/RegistrationWidget

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public:
5555
* This updates the user-interface to reflect the current state of the
5656
* model.
5757
*/
58-
void update();
58+
virtual void update();
5959

6060
protected:
6161
/*! \brief Validates the current information.

src/Wt/Http/Client

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ public:
150150
* The limit includes status line, headers and response body.
151151
*
152152
* The default value is 64 kilo bytes.
153+
*
154+
* A value of 0 has a special meaning: the size of the response will
155+
* not be limited, but the response body will not be stored in the
156+
* response message. Instead the data is made available only
157+
* to bodyDataReceived() to be processed incrementally.
153158
*/
154159
void setMaximumResponseSize(std::size_t bytes);
155160

@@ -327,7 +332,35 @@ public:
327332
* }
328333
* \endcode
329334
*/
330-
Signal<boost::system::error_code, Message>& done() { return done_; }
335+
Signal<boost::system::error_code, Message>& done() {
336+
return done_;
337+
}
338+
339+
/*! \brief %Signal that is emitted when all response headers have been
340+
* received.
341+
*
342+
* The signal forwards the message with all headers, but with
343+
* empty body text. You may want to catch this signal if you want to
344+
* examine the headers prior to having received the complete message.
345+
*
346+
* \sa done(), bodyDataReceived()
347+
*/
348+
Signal<Message>& headersReceived() {
349+
return headersReceived_;
350+
}
351+
352+
/*! \brief %Signal that is emitted when more body data was received.
353+
*
354+
* The signal contains the next body data chunk received. You may
355+
* want to catch this signal if you want to process the response as it
356+
* is being received.
357+
*
358+
* You may want to use this in combination with
359+
* setMaximumResponseSize(0) to handle very long responses.
360+
*/
361+
Signal<std::string>& bodyDataReceived() {
362+
return bodyDataReceived_;
363+
}
331364

332365
/*! \brief Utility class representing an %URL.
333366
*/
@@ -365,15 +398,17 @@ public:
365398
*/
366399
void setFollowRedirect(bool followRedirect);
367400

368-
/*! \brief Returns the maximum number of redirects that are followed when followRedirect() is enabled.
401+
/*! \brief Returns the maximum number of redirects to follow.
369402
*
370-
* \sa setMaxRedirects
403+
* \sa setMaxRedirects()
371404
*/
372405
int maxRedirects() const;
373406

374-
/*! \brief Set the maximum number of redirects to follow when followRedirect() is enabled.
407+
/*! \brief Set the maximum number of redirects to follow.
408+
*
409+
* This is used only when followRedirect() is enabled.
375410
*
376-
* This defaults to 20.
411+
* The default is 20.
377412
*/
378413
void setMaxRedirects(int maxRedirects);
379414

@@ -386,15 +421,21 @@ private:
386421
bool verifyEnabled_;
387422
std::string verifyFile_, verifyPath_;
388423
Signal<boost::system::error_code, Message> done_;
424+
Signal<Message> headersReceived_;
425+
Signal<std::string> bodyDataReceived_;
389426
bool followRedirect_;
390427
int redirectCount_;
391428
int maxRedirects_;
392429

393430
class TcpImpl;
394431
class SslImpl;
395432

396-
void handleRedirect(Http::Method method, boost::system::error_code err, const Message& response);
433+
void handleRedirect(Http::Method method, boost::system::error_code err,
434+
const Message& response);
435+
397436
void emitDone(boost::system::error_code err, const Message& response);
437+
void emitHeadersReceived(const Message& response);
438+
void emitBodyReceived(const std::string& data);
398439
};
399440

400441
}

0 commit comments

Comments
 (0)