diff --git a/installer/mc2_installer.nsi b/installer/mc2_installer.nsi index c781465f0..bbe334c6c 100644 --- a/installer/mc2_installer.nsi +++ b/installer/mc2_installer.nsi @@ -9,8 +9,8 @@ SetCompressor /SOLID lzma !define MUI_BGCOLOR "FFFFFF" !define PROJECT_NAME "musikCube 2" -!define SUB_NAME "developers milestone 1" -!define INSTALLER_NAME "mC2_dev_m1" +!define SUB_NAME "developers milestone 2" +!define INSTALLER_NAME "mC2dm2" !define INSTALL_DIR "musikCube 2" ;---------------------------------------------------------------- @@ -42,6 +42,7 @@ Section "mC2installation" main SetOutPath "$INSTDIR" File /r "..\bin\release\mC2.exe" + File /r "..\bin\release\musikServer.exe" File /r "..\LICENSE.txt" SetOutPath "$INSTDIR\plugins" @@ -52,6 +53,7 @@ Section "mC2installation" main CreateDirectory "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}" CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\mC2.exe" + CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\musikServer.lnk" "$INSTDIR\musikServer.exe" SectionEnd diff --git a/src/core/Library/Remote.cpp b/src/core/Library/Remote.cpp index 233e08b89..53f4c7b01 100644 --- a/src/core/Library/Remote.cpp +++ b/src/core/Library/Remote.cpp @@ -44,7 +44,7 @@ #include #include - +#include using namespace musik::core; @@ -99,6 +99,7 @@ utfstring Library::Remote::GetInfo(){ ////////////////////////////////////////// bool Library::Remote::Startup(){ + ATLTRACE2("Library::Remote::Startup\n"); // Lets start the ReadThread first, it will startup the connection and // then start the WriteThread this->threads.create_thread(boost::bind(&Library::Remote::ReadThread,this)); @@ -113,6 +114,7 @@ bool Library::Remote::Startup(){ ////////////////////////////////////////// void Library::Remote::ReadThread(){ +ATLTRACE2("Library::Remote::ReadThread\n"); { Preferences prefs("Connection",this->Identifier().c_str()); @@ -124,27 +126,42 @@ void Library::Remote::ReadThread(){ boost::asio::ip::tcp::resolver::query resolverQuery(this->address,this->port); try{ - boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve(resolverQuery); + ATLTRACE2("Library::Remote::ReadThread 1\n"); + boost::system::error_code resolverError; + boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve(resolverQuery,resolverError); boost::asio::ip::tcp::resolver::iterator end; + ATLTRACE2("Library::Remote::ReadThread 1.1\n"); + + if(resolverError){ + ATLTRACE2("Library::Remote::ReadThread ERROR 1.1\n"); + this->Exit(); + return; + } boost::system::error_code error = boost::asio::error::host_not_found; while (error && endpointIterator!=end){ + ATLTRACE2("Library::Remote::ReadThread 1.2\n"); this->socket.close(); + ATLTRACE2("Library::Remote::ReadThread 1.3\n"); this->socket.connect(*endpointIterator, error); + ATLTRACE2("Library::Remote::ReadThread 1.4\n"); if(error){ endpointIterator++; } } if (error || endpointIterator==end){ + ATLTRACE2("Library::Remote::ReadThread 1.5\n"); this->Exit(); return; } + ATLTRACE2("Library::Remote::ReadThread 1.6\n"); } catch(...){ this->Exit(); return; } + ATLTRACE2("Library::Remote::ReadThread 2\n"); // Successfully connected to server // Start the WriteThread try{ @@ -155,11 +172,15 @@ void Library::Remote::ReadThread(){ return; } + ATLTRACE2("Library::Remote::ReadThread 3\n"); + try{ // Lets start recieving queries xml::Parser parser(&this->socket); + ATLTRACE2("Library::Remote::ReadThread 4\n"); if( xml::ParserNode rootNode=parser.ChildNode("musik")){ while(xml::ParserNode node=rootNode.ChildNode()){ + ATLTRACE2("Library::Remote::ReadThread 5\n"); if(node.Name()=="queryresults"){ unsigned int queryId = boost::lexical_cast(node.Attributes()["id"]); @@ -204,6 +225,7 @@ void Library::Remote::ReadThread(){ ///Thread for writing to the socket ////////////////////////////////////////// void Library::Remote::WriteThread(){ + ATLTRACE2("Library::Remote::WriteThread\n"); xml::Writer writer(&this->socket); diff --git a/src/core/db/Connection.cpp b/src/core/db/Connection.cpp index 276825537..cd7fb32ee 100644 --- a/src/core/db/Connection.cpp +++ b/src/core/db/Connection.cpp @@ -230,7 +230,7 @@ int Connection::Execute(const wchar_t* sql){ void Connection::Analyze(){ boost::mutex::scoped_lock lock(Connection::globalMutex); - this->Execute("ANALYZE"); +// this->Execute("ANALYZE"); } diff --git a/src/cube/MainWindowController.cpp b/src/cube/MainWindowController.cpp index 8ac50a8c5..52999a602 100644 --- a/src/cube/MainWindowController.cpp +++ b/src/cube/MainWindowController.cpp @@ -87,12 +87,11 @@ void MainWindowController::OnMainWindowCreated(Window* window) { // Start by setting the icon - HICON icon = LoadIcon(Application::Instance(), MAKEINTRESOURCE( IDI_MAINFRAME ) ); - if ( icon ){ - - SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_SMALL ), LPARAM( icon ) ); - SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_BIG ), LPARAM( icon ) ); - } + HICON icon16 = (HICON)LoadImage(Application::Instance(), MAKEINTRESOURCE(IDI_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + HICON icon32 = (HICON)LoadImage(Application::Instance(), MAKEINTRESOURCE(IDI_MAINFRAME), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); + SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_SMALL ), LPARAM( icon16 ) ); + SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_BIG ), LPARAM( icon32 ) ); + // Init Tray Icon MenuRef myMenu = Menu::CreatePopup(); @@ -105,8 +104,8 @@ void MainWindowController::OnMainWindowCreated(Window* window) // Bind Exit to handler trayExit->Activated.connect(this, &MainWindowController::OnFileExit); - UINT uidTrayIcon = Application::Instance().SysTrayManager()->AddIcon(Application::Instance().MainWindow(), icon); - Application::Instance().SysTrayManager()->SetTooltip(uidTrayIcon, _T("And another test...")); + UINT uidTrayIcon = Application::Instance().SysTrayManager()->AddIcon(Application::Instance().MainWindow(), icon16); + Application::Instance().SysTrayManager()->SetTooltip(uidTrayIcon, _T("musikCube")); Application::Instance().SysTrayManager()->SetPopupMenu(uidTrayIcon, myMenu); Application::Instance().SysTrayManager()->ShowBalloon(uidTrayIcon, _T("musikCube 2"), _T("Welcome to musikCube!"), 2); Application::Instance().SysTrayManager()->EnableMinimizeToTray(uidTrayIcon); diff --git a/src/server/MainWindowController.cpp b/src/server/MainWindowController.cpp index c0e062693..363c19c3a 100644 --- a/src/server/MainWindowController.cpp +++ b/src/server/MainWindowController.cpp @@ -83,11 +83,10 @@ void MainWindowController::OnMainWindowCreated(Window* window) { // Start by setting the icon - HICON icon = LoadIcon(Application::Instance(), MAKEINTRESOURCE( IDI_MAINFRAME ) ); - if ( icon ){ - SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_SMALL ), LPARAM( icon ) ); - SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_BIG ), LPARAM( icon ) ); - } + HICON icon16 = (HICON)LoadImage(Application::Instance(), MAKEINTRESOURCE(IDI_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + HICON icon32 = (HICON)LoadImage(Application::Instance(), MAKEINTRESOURCE(IDI_MAINFRAME), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); + SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_SMALL ), LPARAM( icon16 ) ); + SendMessage( window->Handle(), WM_SETICON, WPARAM( ICON_BIG ), LPARAM( icon32 ) ); // Init Tray Icon @@ -99,7 +98,7 @@ void MainWindowController::OnMainWindowCreated(Window* window) // Bind Exit to handler trayExit->Activated.connect(this, &MainWindowController::OnFileExit); - UINT uidTrayIcon = Application::Instance().SysTrayManager()->AddIcon(Application::Instance().MainWindow(), icon); + UINT uidTrayIcon = Application::Instance().SysTrayManager()->AddIcon(Application::Instance().MainWindow(), icon16); Application::Instance().SysTrayManager()->SetTooltip(uidTrayIcon, _T("musikServer")); Application::Instance().SysTrayManager()->SetPopupMenu(uidTrayIcon, myMenu); Application::Instance().SysTrayManager()->EnableMinimizeToTray(uidTrayIcon); diff --git a/src/server/resources/musikServer.ico b/src/server/resources/musikServer.ico new file mode 100644 index 000000000..300ab8c3b Binary files /dev/null and b/src/server/resources/musikServer.ico differ diff --git a/src/server/resources/resource.rc b/src/server/resources/resource.rc index 6d076267b..aa6d3c614 100644 --- a/src/server/resources/resource.rc +++ b/src/server/resources/resource.rc @@ -9,7 +9,7 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAINFRAME ICON "../../cube/resources/mC2.ico" +IDI_MAINFRAME ICON "musikServer.ico" /////////////////////////////////////////////////////////////////////////////