From 788a7638bc26f47b61fe14835fd4aabbb75cc2fe Mon Sep 17 00:00:00 2001 From: emeric Date: Tue, 8 Apr 2014 12:33:05 +0200 Subject: [PATCH] WIP, compile problems --- Makefile.am | 10 ++-- configure.ac | 72 +++++++++++++--------------- main/ServiceManager.cpp | 10 ++-- main/ServiceManager.hpp | 2 +- main/WebServerService.cpp | 4 +- main/main.cpp | 33 +++++++++++-- resources/themes/bootstrap/2/wt.css | 10 +++- resources/themes/bootstrap/2/wt.less | 11 ++++- resources/themes/bootstrap/3/wt.css | 41 +++++++--------- resources/themes/bootstrap/3/wt.less | 32 +++++-------- 10 files changed, 122 insertions(+), 103 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9bd12bc1..a37cae1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,6 @@ lms_SOURCES = \ $(top_srcdir)/main/main.cpp \ $(top_srcdir)/main/ServiceManager.cpp \ $(top_srcdir)/main/DatabaseRefreshService.cpp \ - $(top_srcdir)/main/RemoteServerService.cpp \ $(top_srcdir)/main/WebServerService.cpp \ $(top_srcdir)/av/CodecContext.cpp \ $(top_srcdir)/av/Common.cpp \ @@ -39,16 +38,17 @@ lms_SOURCES = \ $(top_srcdir)/database/SqlQuery.cpp \ $(top_srcdir)/database/Path.cpp \ $(top_srcdir)/database/Video.cpp \ - $(top_srcdir)/remote/server/Connection.cpp \ - $(top_srcdir)/remote/server/ConnectionManager.cpp \ - $(top_srcdir)/remote/server/Server.cpp \ $(top_srcdir)/transcode/AvConvTranscoder.cpp \ $(top_srcdir)/transcode/Format.cpp \ $(top_srcdir)/transcode/Parameters.cpp \ $(top_srcdir)/transcode/InputMediaFile.cpp \ $(top_srcdir)/metadata/AvFormat.cpp \ - $(top_srcdir)/metadata/Extractor.cpp \ $(top_srcdir)/metadata/Utils.cpp +#$(top_srcdir)/main/RemoteServerService.cpp +#$(top_srcdir)/remote/server/Connection.cpp +#$(top_srcdir)/remote/server/ConnectionManager.cpp +#$(top_srcdir)/remote/server/Server.cpp + lms_CXXFLAGS=-std=c++11 -Wall -I$(top_srcdir)/boost/ -I$(top_srcdir)/ui -I$(top_srcdir)/remote diff --git a/configure.ac b/configure.ac index 6010377f..63584bcf 100644 --- a/configure.ac +++ b/configure.ac @@ -8,18 +8,14 @@ AC_LANG_CPLUSPLUS # Checks for programs AC_PROG_CXX -AC_CHECK_HEADERS([Wt/WApplication extractor.h], +AC_CHECK_HEADERS([Wt/WApplication], [], [AC_MSG_ERROR([Header not found or unusable !])]) -#AC_CHECK_HEADERS([extractor.h], -# [], -# [AC_MSG_ERROR([Header not found or unusable !])]) - -AC_CHECK_LIB([pthread], - [pthread_create], - , - [AC_MSG_ERROR([libpthread not found!])]) +#AC_CHECK_LIB([pthread], +# [pthread_create], +# , +# [AC_MSG_ERROR([libpthread not found!])]) AC_CHECK_LIB([avutil], [av_free], @@ -36,11 +32,6 @@ AC_CHECK_LIB([avformat], , [AC_MSG_ERROR([libavformat not found!])]) -AC_CHECK_LIB([extractor], - [EXTRACTOR_extract], - , - [AC_MSG_ERROR([libextractor not found!])]) - AC_CHECK_LIB([boost_system], [main], , @@ -51,46 +42,47 @@ AC_CHECK_LIB( [boost_filesystem], , [AC_MSG_ERROR([libboost_filesystem not found!])]) -AC_CHECK_LIB( [boost_thread], - [main], - , - [AC_MSG_ERROR([libboost_thread not found!])]) +#AC_CHECK_LIB( [boost_thread], +# [main], +# , +# [AC_MSG_ERROR([libboost_thread not found!])]) -AC_CHECK_LIB( [boost_date_time], - [main], - , - [AC_MSG_ERROR([libboost_date_time not found!])]) +#AC_CHECK_LIB( [boost_date_time], +# [main], +# , +# [AC_MSG_ERROR([libboost_date_time not found!])]) -AC_CHECK_LIB( [boost_signals], - [main], - , - [AC_MSG_ERROR([libboost_signals not found!])]) +#AC_CHECK_LIB( [boost_signals], +# [main], +# , +# [AC_MSG_ERROR([libboost_signals not found!])]) AC_CHECK_LIB( [boost_iostreams], [main], , [AC_MSG_ERROR([libboost_iostreams not found!])]) -AC_CHECK_LIB([wt], - [main], - , - [AC_MSG_ERROR([libwt not found!])]) - -AC_CHECK_LIB([wtdbo], - [main], - , - [AC_MSG_ERROR([libwtdbo not found!])]) +# TODO -> PARAMETRIZE THIS +AC_CHECK_LIB([wthttp], + [main], + , + [AC_MSG_ERROR([libwthttp not found!])]) AC_CHECK_LIB([wtdbosqlite3], [main], , [AC_MSG_ERROR([libwtdbosqlite3 not found!])]) -# TODO -> PARAMETRIZE THIS -AC_CHECK_LIB([wthttp], - [main], - , - [AC_MSG_ERROR([libwthttp not found!])]) +AC_CHECK_LIB([wtdbo], + [main], + , + [AC_MSG_ERROR([libwtdbo not found!])]) + +AC_CHECK_LIB([wt], + [main], + , + [AC_MSG_ERROR([libwt not found!])]) + AC_CONFIG_FILES([Makefile diff --git a/main/ServiceManager.cpp b/main/ServiceManager.cpp index 33d64732..a1a40d75 100644 --- a/main/ServiceManager.cpp +++ b/main/ServiceManager.cpp @@ -7,15 +7,15 @@ #include "ServiceManager.hpp" ServiceManager::ServiceManager() -: _signalSet(_ioService) +/*: _signalSet(_ioService) */ { - _signalSet.add(SIGINT); +/* _signalSet.add(SIGINT); _signalSet.add(SIGTERM); #if defined(SIGQUIT) _signalSet.add(SIGQUIT); #endif // defined(SIGQUIT) - _signalSet.add(SIGHUP); + _signalSet.add(SIGHUP);*/ } void @@ -32,10 +32,10 @@ ServiceManager::run() void ServiceManager::asyncWaitSignals(void) { - _signalSet.async_wait(boost::bind(&ServiceManager::handleSignal, +/* _signalSet.async_wait(boost::bind(&ServiceManager::handleSignal, this, boost::asio::placeholders::error, - boost::asio::placeholders::signal_number)); + boost::asio::placeholders::signal_number));*/ } void diff --git a/main/ServiceManager.hpp b/main/ServiceManager.hpp index 7e1ee48b..a007ccef 100644 --- a/main/ServiceManager.hpp +++ b/main/ServiceManager.hpp @@ -31,7 +31,7 @@ class ServiceManager boost::asio::io_service _ioService; // Listen for interesting signals - boost::asio::signal_set _signalSet; +// boost::asio::signal_set _signalSet; std::set _services; }; diff --git a/main/WebServerService.cpp b/main/WebServerService.cpp index 970800e1..68d58b40 100644 --- a/main/WebServerService.cpp +++ b/main/WebServerService.cpp @@ -5,7 +5,7 @@ #include "ui/LmsApplication.hpp" -Wt::WApplication *createApplication(const Wt::WEnvironment& env) +static Wt::WApplication *createApplication(const Wt::WEnvironment& env) { /* * You could read information from the environment to decide whether @@ -19,7 +19,7 @@ WebServerService::WebServerService( int argc, char* argv[]) : _server(argv[0], "") { - std::cout << "Constructing server... argc = " << argc << std::endl; + std::cout << "Constructing server... argv[0] = '" << argv[0] << "' argc = " << argc << std::endl; // TODO configure server _server.setServerConfiguration (argc, argv, WTHTTP_CONFIGURATION); diff --git a/main/main.cpp b/main/main.cpp index 21f048aa..6df4d802 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -9,7 +9,17 @@ #include "WebServerService.hpp" #include "RemoteServerService.hpp" -void toto(int argc, char* argv[]); +#include "ui/LmsApplication.hpp" + +static Wt::WApplication *createApplication(const Wt::WEnvironment& env) +{ + /* + * You could read information from the environment to decide whether + * the user has permission to start a new application + */ + std::cout << "Creating new Application" << std::endl; + return new LmsApplication(env); +} int main(int argc, char* argv[]) { @@ -18,17 +28,32 @@ int main(int argc, char* argv[]) try { - ServiceManager serviceManager; +// ServiceManager serviceManager; // lib init Av::AvInit(); Transcode::AvConvTranscoder::init(); + return Wt::WRun(argc, argv, createApplication); +/* Wt::WServer server(argv[0], ""); + + server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION); + server.addEntryPoint(Wt::Application, createApplication); + if (server.start()) { + int sig = Wt::WServer::waitForShutdown(argv[0]); + std::cerr << "Shutdown (signal = " << sig << ")" << std::endl; + server.stop(); + if (sig == SIGHUP) + Wt::WServer::restart(argc, argv, environ); + }*/ +// return 0; + + // serviceManager.startService( std::make_shared( "test.db" ) ); - serviceManager.startService( std::make_shared(argc, argv) ); +// serviceManager.startService( std::make_shared(argc, argv) ); // serviceManager.startService( std::make_shared( Remote::Server::Server::endpoint_type() ) ); - serviceManager.run(); +// serviceManager.run(); res = EXIT_SUCCESS; diff --git a/resources/themes/bootstrap/2/wt.css b/resources/themes/bootstrap/2/wt.css index 8133d205..25d2585c 100644 --- a/resources/themes/bootstrap/2/wt.css +++ b/resources/themes/bootstrap/2/wt.css @@ -86,6 +86,7 @@ @media (max-width: 979px) { .nav-collapse .dropdown-menu { display: block !important; + position: static !important; } .nav-collapse .dropdown-menu li > a:hover { color: #555555; @@ -249,6 +250,7 @@ .Wt-cal .days td .Wt-cal-sel, .Wt-cal .days td .Wt-cal-sel:hover { color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); @@ -544,7 +546,6 @@ white-space: nowrap; background: white; border: 1px solid #dddddd; - overflow: auto; /* header */ /* resize handles */ @@ -554,6 +555,9 @@ /* item drag & drop */ } +.Wt-itemview.Wt-itemview-paged { + overflow: auto; +} .Wt-itemview .Wt-spacer { background: url(../../../loading.png); } @@ -688,6 +692,10 @@ body.Wt-rtl .Wt-itemview .Wt-tv-no-rh { .Wt-tableview .Wt-plaintable td, .Wt-tableview .Wt-plaintable th { border-right: 1px solid #dddddd; + border-top: 1px solid #dddddd; + margin-top: -1px; +} +.Wt-tableview .Wt-spacer { border-bottom: 1px solid #dddddd; } .Wt-tableview .Wt-header { diff --git a/resources/themes/bootstrap/2/wt.less b/resources/themes/bootstrap/2/wt.less index 0487f729..441264ca 100644 --- a/resources/themes/bootstrap/2/wt.less +++ b/resources/themes/bootstrap/2/wt.less @@ -74,6 +74,7 @@ @media (max-width: 979px) { .nav-collapse .dropdown-menu { display: block !important; + position: static !important; } .nav-collapse .dropdown-menu li > a:hover { @@ -501,7 +502,10 @@ white-space: nowrap; background: white; border: 1px solid @tableBorder; - overflow: auto; + + &.Wt-itemview-paged { + overflow: auto; + } .Wt-spacer { background: url(../../../loading.png); @@ -668,6 +672,11 @@ body.Wt-rtl { .Wt-tv-contents .Wt-tv-c, .Wt-plaintable td, .Wt-plaintable th { border-right: 1px solid @tableBorder; + border-top: 1px solid @tableBorder; + margin-top: -1px; + } + + .Wt-spacer { border-bottom: 1px solid @tableBorder; } diff --git a/resources/themes/bootstrap/3/wt.css b/resources/themes/bootstrap/3/wt.css index 3d1734ad..56d9f201 100644 --- a/resources/themes/bootstrap/3/wt.css +++ b/resources/themes/bootstrap/3/wt.css @@ -73,25 +73,15 @@ display: inline; } -/* - * Custom collapse nav support - */ - -.navbar .navbar-collapse { - display: block !important; -} - -@media (max-width: 979px) { - .navbar-collapse .dropdown-menu { +@media (min-width: 768px) { + .navbar .navbar-collapse { display: block !important; } - .navbar-collapse .dropdown-menu li > a:hover { - color: #333333; - background: #f2f2f2; - } - .navbar-collapse .dropdown-menu .active > a { - color: inherit; - background: inherit; +} + +@media (max-width: 768px) { + .navbar-nav .open .dropdown-menu { + position: static !important; } } @@ -607,13 +597,16 @@ fieldset[disabled] .Wt-slider-v .handle.active { */ .Wt-itemview { - overflow: auto; white-space: nowrap; cursor: default; background: white; border: 1px solid #dddddd; } +.Wt-itemview.Wt-itemview-paged { + overflow: auto; +} + .Wt-itemview .Wt-spacer { background: url(../../../loading.png); } @@ -971,6 +964,12 @@ body.Wt-rtl .Wt-sbspacer { border-right: 1px solid #dddddd; } +.Wt-treeview button.Wt-tv-c { + border-right-color: transparent; + /* doesn't work */ + +} + .Wt-treeview .Wt-tv-c { padding: 0 3px; -webkit-box-sizing: content-box; @@ -978,12 +977,6 @@ body.Wt-rtl .Wt-sbspacer { box-sizing: content-box; } -.Wt-treeview button.Wt-tv-c { - border-right-color: transparent; - /* doesn't work */ - -} - .Wt-treeview .Wt-tv-row { float: right; overflow: hidden; diff --git a/resources/themes/bootstrap/3/wt.less b/resources/themes/bootstrap/3/wt.less index 4a12a7b7..cb1a47ae 100644 --- a/resources/themes/bootstrap/3/wt.less +++ b/resources/themes/bootstrap/3/wt.less @@ -65,27 +65,16 @@ display: inline; } -/* - * Custom collapse nav support - */ -.navbar .navbar-collapse { - display: block !important; +@media (min-width: 768px) { + .navbar .navbar-collapse { + display: block !important; + } } -@media (max-width: 979px) { - .navbar-collapse .dropdown-menu { - display: block !important; - } - - .navbar-collapse .dropdown-menu li > a:hover { - color: @navbar-default-link-hover-color; - background: #f2f2f2; - } - - .navbar-collapse .dropdown-menu .active >a { - color: inherit; - background: inherit; - } +@media (max-width: 768px) { + .navbar-nav .open .dropdown-menu { + position: static !important; + } } .navbar .navbar-inner .container { @@ -519,7 +508,10 @@ white-space: nowrap; background: white; border: 1px solid @table-border-color; - overflow: auto; + + &.Wt-itemview-paged { + overflow: auto; + } .Wt-spacer { background: url(../../../loading.png);