Skip to content

Commit

Permalink
Several bug fixes and improvements:
Browse files Browse the repository at this point in the history
	- WLineEdit::setAutoComplete (from Steve Drake)
    	- Make WPopupWidget::setTransient() work while rendered (#2192)
    	- Do not reset body/html style classes in widgetset mode
    	- WDateEdit: Provide entry points to specialize calendar-edit conversion
    	- WSuggestionPopup StdMatcher: add wordStartRegexp configuration option
    	- WSuggestionPopup: added bootstrap style for dropdown icon
    	- Fix for 'delete this' issue in boost signals2 (probably boost.signals2 bug, see https://svn.boost.org/trac/boost/ticket/9103 )
    	- Fix of several small documentation issues
    	- Simplechat example: make deprecated well (#2168)
    	- WSuggestionPopup: implement better partial results support
    	- Fix animation glitch in Firefox (Bruce Toll #2048)
    	- Ajax-progress a button rendered as an anchor (Bruce Toll)
    	- Fix Dbo query SELECT SUM(...) mysql bug fix + add test to dbo test 3 (#2091)
	- WTemplate, block() function, lacking documentation (#1820)
    	- WToolBar: WToolbar align vertically (#1833)
  • Loading branch information
Koen Deforche committed Sep 17, 2013
1 parent 9c38a29 commit 3356826
Show file tree
Hide file tree
Showing 56 changed files with 857 additions and 153 deletions.
4 changes: 3 additions & 1 deletion doc/tutorial/auth.doc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Session::Session(const std::string& sqliteDb)
try {
createTables();
std::cerr << "Created database." << std::endl;
} catch (std::exception& e) {
} catch (Wt::Dbo::Exception& e) {
std::cerr << e.what() << std::endl;
std::cerr << "Using existing database";
}
Expand Down Expand Up @@ -565,6 +565,8 @@ int main(int argc, char **argv)
}
} catch (Wt::WServer::Exception& e) {
std::cerr << e.what() << std::endl;
} catch (Wt::Dbo::Exception &e) {
std::cerr << "Dbo exception: " << e.what() << std::endl;
} catch (std::exception &e) {
std::cerr << "exception: " << e.what() << std::endl;
}
Expand Down
6 changes: 3 additions & 3 deletions doc/tutorial/wt.doc
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ ImagesWidget::ImagesWidget(int maxGuesses, WContainerWidget *parent)

void ImagesWidget::showImage(int index)
{
image(image_)->hide();
image(index)->hide();
image_ = index;
image(image_)->show();
image(index)->show();
}

WImage *ImagesWidget::image(int index) const
Expand Down Expand Up @@ -744,4 +744,4 @@ http://www.webtoolkit.eu/wt/documentation[online documentation].
You may want to continue learning about Wt using:

* {tutorials}auth.html[Introduction to authentication in Wt]
* {tutorials}dbo.html[Introduction to database persistence using Wt::Dbo]
* {tutorials}dbo.html[Introduction to database persistence using Wt::Dbo]
10 changes: 5 additions & 5 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ MACRO(WT_ADD_EXAMPLE name)

IF(WIN32)
SET(SCRIPT_DOCROOT "--docroot .")
IF(${DOCROOTSUBFOLDER})
IF(DOCROOTSUBFOLDER)
SET(SCRIPT_DOCROOT "--docroot ${DOCROOTSUBFOLDER}")
ENDIF(${DOCROOTSUBFOLDER})
ENDIF(DOCROOTSUBFOLDER)
SET(SCRIPT_APPROOT "")
IF(${APPROOTSUBFOLDER})
IF(APPROOTSUBFOLDER)
SET(SCRIPT_APPROOT "--approot ${APPROOTSUBFOLDER}")
ENDIF(${APPROOTSUBFOLDER})
ENDIF(APPROOTSUBFOLDER)

CONFIGURE_FILE(${WT_SOURCE_DIR}/examples/run-example.bat.cmake ${WT_BINARY_DIR}/${EXAMPLENAME}.bat @ONLY)
INSTALL(PROGRAMS ${WT_BINARY_DIR}/${EXAMPLENAME}.bat DESTINATION bin )

IF(INSTALL_RESOURCES)
INSTALL(DIRECTORY ${WT_SOURCE_DIR}/resources DESTINATION ${EXAMPLES_DESTINATION}/${EXAMPLESUBDIR}) # Can't safely make symlinks of Windows
INSTALL(DIRECTORY ${WT_SOURCE_DIR}/resources DESTINATION ${EXAMPLES_DESTINATION}/${EXAMPLESUBDIR}/${DOCROOTSUBFOLDER}) # Can't safely make symlinks of Windows
ENDIF(INSTALL_RESOURCES)
ELSE(WIN32)
CONFIGURE_FILE(${WT_SOURCE_DIR}/examples/run-example.cmake ${WT_BINARY_DIR}/${EXAMPLENAME} @ONLY)
Expand Down
5 changes: 5 additions & 0 deletions examples/blog/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<head><title>Not here!</title></head>
<body>The blog example is deployed at <a href="/blog">/blog</a></body>.
</html>

2 changes: 1 addition & 1 deletion examples/composer/ContactSuggestions.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace {
};
}

ContactSuggestions::ContactSuggestions(WContainerWidget *parent)
ContactSuggestions::ContactSuggestions(WObject *parent)
: WSuggestionPopup(WSuggestionPopup::generateMatcherJS(contactOptions),
WSuggestionPopup::generateReplacerJS(contactOptions),
parent)
Expand Down
2 changes: 1 addition & 1 deletion examples/composer/ContactSuggestions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ContactSuggestions : public WSuggestionPopup
public:
/*! \brief Create a new ContactSuggestions popup.
*/
ContactSuggestions(WContainerWidget *parent = 0);
ContactSuggestions(WObject *parent = 0);

/*! \brief Set the address book.
*/
Expand Down
9 changes: 8 additions & 1 deletion examples/feature/client-ssl-auth/SslClientAuth.C
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ public:
authWidget->registerNewUser(id);
else
session_.login().login(u, Wt::Auth::WeakLogin);

root()->addWidget(authWidget);
} else {
new Wt::WText("Not an SSL session, or no client certificate available. "
"Please read the readme file in examples/feature/client-ssl-auth "
"for more info.",
root());
quit();
}

root()->addWidget(authWidget);
}

void authEvent() {
Expand Down
3 changes: 2 additions & 1 deletion examples/feature/suggestionpopup/SuggestionPopup.C
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ private:
*/
if (input.value().length() < 3 && i > 10) {
fourCharModel_->addString("...");
// no actual value
fourCharModel_->setData(row, 0, std::string(""), Wt::UserRole);
fourCharModel_->setData(row, 0, std::string("Wt-more-data"),
Wt::StyleClassRole);

break;
}
Expand Down
5 changes: 5 additions & 0 deletions examples/planner/planner.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ body {
height: 100%;
}

/* This is needed for IE8 */
html {
height: 100%;
}

31 changes: 29 additions & 2 deletions examples/simplechat/simpleChat.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Wt/WPushButton>
#include <Wt/WServer>
#include <Wt/WText>
#include <Wt/WTimer>

#include "SimpleChatServer.h"
#include "PopupChatWidget.h"
Expand All @@ -32,25 +33,34 @@ public:

private:
SimpleChatServer& server_;
Wt::WText *javaScriptError_;
const WEnvironment& env_;
Wt::WTimer *timer_;

/*! \brief Add another chat client.
*/
void addChatWidget();
void javaScriptTest();
void emptyFunc();
};

ChatApplication::ChatApplication(const WEnvironment& env,
SimpleChatServer& server)
: WApplication(env),
server_(server)
server_(server),
env_(env)
{
setTitle("Wt Chat");
useStyleSheet("chatapp.css");

messageResourceBundle().use(appRoot() + "simplechat");

javaScriptTest();

root()->addWidget(new WText(WString::tr("introduction")));

SimpleChatWidget *chatWidget = new SimpleChatWidget(server_, root());
SimpleChatWidget *chatWidget =
new SimpleChatWidget(server_, root());
chatWidget->setStyleClass("chat");

root()->addWidget(new WText(WString::tr("details")));
Expand All @@ -60,6 +70,23 @@ ChatApplication::ChatApplication(const WEnvironment& env,
b->clicked().connect(this, &ChatApplication::addChatWidget);
}

void ChatApplication::javaScriptTest()
{
if(!env_.javaScript()){
javaScriptError_ = new WText(WString::tr("serverpushwarning"), root());

// The 5 second timer is a fallback for real server push. The updated
// server state will piggy back on the response to this timeout.
timer_ = new Wt::WTimer(root());
timer_->setInterval(5000);
timer_->timeout().connect(this, &ChatApplication::emptyFunc);
timer_->start();
}
}

void ChatApplication::emptyFunc()
{}

void ChatApplication::addChatWidget()
{
SimpleChatWidget *chatWidget2 = new SimpleChatWidget(server_, root());
Expand Down
2 changes: 2 additions & 0 deletions examples/simplechat/simplechat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ the current session, but also of all other sessions is updated and

</message>

<message id="serverpushwarning">Note, you do not have JavaScript and this chat will have degraded functionality</message>

</messages>
14 changes: 7 additions & 7 deletions examples/widgetgallery/examples/FormModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class UserFormModel : public Wt::WFormModel
//
// static constexpr Field FirstNameField = "first-name";

static const Wt::WFormModel::Field FirstNameField;
static const Wt::WFormModel::Field LastNameField;
static const Wt::WFormModel::Field CountryField;
static const Wt::WFormModel::Field CityField;
static const Wt::WFormModel::Field BirthField;
static const Wt::WFormModel::Field ChildrenField;
static const Wt::WFormModel::Field RemarksField;
static const Field FirstNameField;
static const Field LastNameField;
static const Field CountryField;
static const Field CityField;
static const Field BirthField;
static const Field ChildrenField;
static const Field RemarksField;

UserFormModel(Wt::WObject *parent = 0)
: Wt::WFormModel(parent)
Expand Down
5 changes: 5 additions & 0 deletions examples/wt-homepage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ How to run
Copy the blog.xml file and css directory from the blog example to this directory
See the README in the parent directory.

Note that the little chat widget is a separate application (simplechat), which
is visible on the homepage through Wt's 'widgetset' mechanism. In order for
this to work, you must run this example in progressive bootstrap mode. You
can configure progressive bootstrap mode in wt_config.xml.

What it illustrates
-------------------

Expand Down
Binary file added resources/themes/bootstrap/splitter-h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/themes/bootstrap/splitter-v.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/themes/bootstrap/suggest-dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3356826

Please sign in to comment.