[UI] Fixed build using older versions of Wt. Playback is unfortunately still broken

This commit is contained in:
emeric
2016-11-12 12:23:23 +01:00
parent 0a70552f8d
commit d8f8c77c07
4 changed files with 42 additions and 11 deletions
+7
View File
@@ -17,6 +17,7 @@
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Wt/WConfig.h>
#include <Wt/WItemDelegate>
#include "database/Types.hpp"
@@ -86,7 +87,9 @@ TableFilterCluster::layoutSizeChanged (int width, int height)
void
TableFilterCluster::refresh(SearchFilter& filter)
{
#if WT_VERSION >= 0X03030500
this->clearSelection();
#endif
Cluster::updateUIQueryModel(DboSession(), _queryModel, filter);
}
@@ -165,7 +168,9 @@ TableFilterArtist::layoutSizeChanged (int width, int height)
void
TableFilterArtist::refresh(SearchFilter& filter)
{
#if WT_VERSION >= 0X03030500
this->clearSelection();
#endif
Artist::updateUIQueryModel(DboSession(), _queryModel, filter);
}
@@ -249,7 +254,9 @@ TableFilterRelease::layoutSizeChanged (int width, int height)
void
TableFilterRelease::refresh(SearchFilter& filter)
{
#if WT_VERSION >= 0X03030500
this->clearSelection();
#endif
Release::updateUIQueryModel(DboSession(), _queryModel, filter);
}
+3
View File
@@ -19,6 +19,7 @@
#include <boost/date_time.hpp>
#include <Wt/WConfig.h>
#include <Wt/WItemDelegate>
#include <Wt/WBreak>
@@ -160,7 +161,9 @@ TrackView::emitStats(const SearchFilter& filter)
void
TrackView::refresh(SearchFilter& filter)
{
#if WT_VERSION >= 0X03030500
this->clearSelection();
#endif
Track::updateUIQueryModel(DboSession(), _queryModel, filter);
emitStats(filter);
+17 -10
View File
@@ -21,29 +21,36 @@
#if WT_VERSION < 0X03030500
#include <Wt/WTemplate>
#include <Wt/WText>
#endif
#include "InputRange.hpp"
#if WT_VERSION >= 0X03030500
InputRange::InputRange(Wt::WContainerWidget *parent)
: Wt::WWebWidget(parent)
{
//TODO woraround for older Wt versions
#if WT_VERSION >= 0X03030500
setHtmlTagName("input");
setAttributeValue("type", "range");
#else
Wt::WTemplate *t = new Wt::WTemplate("<input type=\"range\"></input>", parent);
#endif
}
std::string
InputRange::jsRef(void) const
{
#if WT_VERSION >= 0X03030500
return Wt::WWebWidget::jsRef();
#else
return this->jsRef() + ".getElementsByTagName(\"input\")[0]";
#endif
}
#else
InputRange::InputRange(Wt::WContainerWidget *parent)
: Wt::WContainerWidget(parent)
{
addWidget(new Wt::WTemplate("<input type=\"range\"></input>"));
}
std::string
InputRange::jsRef(void) const
{
return Wt::WWebWidget::jsRef() + ".getElementsByTagName(\"input\")[0]";
}
#endif
+15 -1
View File
@@ -22,11 +22,12 @@
#include <Wt/WContainerWidget>
#include <Wt/WWebWidget>
#include <Wt/WConfig.h>
#if WT_VERSION >= 0X03030500
class InputRange : public Wt::WWebWidget
{
public:
InputRange(Wt::WContainerWidget *parent = 0);
Wt::DomElementType domElementType() const
{
return Wt::DomElement_INPUT;
@@ -35,3 +36,16 @@ class InputRange : public Wt::WWebWidget
std::string jsRef() const;
};
#else
class InputRange : public Wt::WContainerWidget
{
public:
InputRange(Wt::WContainerWidget *parent = 0);
std::string jsRef() const;
};
#endif