You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(102) |
Dec
(255) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(38) |
Feb
(16) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mik...@us...> - 2003-12-26 22:56:45
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/thread In directory sc8-pr-cvs1:/tmp/cvs-serv3848/src/thread Modified Files: Thread.cpp Log Message: 26/12/2003 Mikael Barbeaux * Added a test program for Http sockets. * Fixed a problem about accepting sockets which were an infinite process. * Implemented main http controls : HttpRequest, HttpResponse, HttpSocket, HttpServerSocket and Writers Index: Thread.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/thread/Thread.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Thread.cpp 24 Dec 2003 13:03:54 -0000 1.1 +++ Thread.cpp 26 Dec 2003 22:56:42 -0000 1.2 @@ -76,7 +76,7 @@ * Sets a cancellation point. */ void Thread::setCancelPoint() throw (ThreadException) { - lock(); + lock(); // exit thread if cancellation has been requested if(cancel_th) { running = false; |
From: <mik...@us...> - 2003-12-26 22:56:35
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http In directory sc8-pr-cvs1:/tmp/cvs-serv3813/src/server/http Log Message: Directory /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http added to the repository |
From: <ma...@us...> - 2003-12-26 14:27:38
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv24035 Modified Files: Changelog Log Message: Various stuff Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- Changelog 25 Dec 2003 03:12:34 -0000 1.114 +++ Changelog 26 Dec 2003 14:27:35 -0000 1.115 @@ -25,8 +25,15 @@ # This also helps in backtracking changes, or reviewing development history. # ############################################################################### +2003/12/26 Alo Sarv + * Fixed configure script to be compatible with BSD. + * Fixed the i18n issues that arose after implementing dynamic pages + handling. + 2003/12/25 Alo Sarv * Various Mac OS related fixes by Xavi. + * Fixed button-with-text-and-image controls - now compatible with + all supported platforms. 2003/12/24 Alo Sarv * French translation by Nicolas Lussier. |
From: <ma...@us...> - 2003-12-26 14:25:32
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv23522/src Modified Files: Makefile.am Log Message: BSD compatibility. Index: Makefile.am =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 22 Dec 2003 08:37:55 -0000 1.9 +++ Makefile.am 26 Dec 2003 14:25:29 -0000 1.10 @@ -30,8 +30,8 @@ all: $(PROGRAM) .c.o: - @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to " - @echo -e -n "$(OUTPUTCOLOR)$@$(ACTIONCOLOR) @PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)" + @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to \\c" + @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR) @PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)\\c" @if cc @CFLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $< 2>.err; then \ if test -s .err; then \ echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ @@ -50,8 +50,8 @@ fi; .cpp.o: - @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to " - @echo -e -n "$(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)" + @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to \\c" + @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)\\c" @if @CXX@ @CXX_FLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $< 2>.err; then \ if test -s .err; then \ echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ @@ -70,8 +70,8 @@ fi; @RES@: - @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to "; - @echo -e -n "$(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)"; + @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to \\c"; + @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)\\c"; @if windres -i wxInterface_private.rc -I rc -o $@ -O coff --include-dir=/local/include 2>.err; then \ if test -s .err; then \ echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ @@ -90,15 +90,15 @@ fi; wxInterface: $(WXINTERFACE_OBJECTS) @TRAY_OBJECTS@ - @echo -e -n "$(ACTIONCOLOR)Linking $(INPUTCOLOR)$(WXINTERFACE_OBJECTS)@TRAY_OBJECTS@ " - @echo -e -n "$(ACTIONCOLOR)to $(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_LINK_FLAGS@: " - @echo -e -n "$(ATTENTIONCOLOR)" + @echo -e "$(ACTIONCOLOR)Linking $(INPUTCOLOR)$(WXINTERFACE_OBJECTS)@TRAY_OBJECTS@ \\c" + @echo -e "$(ACTIONCOLOR)to $(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_LINK_FLAGS@: \\c" + @echo -e "$(ATTENTIONCOLOR)\\c" @if @CXX@ -o $(PROGRAM) $(WXINTERFACE_OBJECTS) @TRAY_OBJECTS@ @LIBS@ 2>.err; then \ echo -e "$(WELLCOLOR)ok."; \ - echo -e -n "$(DEFAULTCOLOR)"; \ - echo -e -n "$(WELLCOLOR)Successfully compiled "; \ - echo -e -n "$(WARNINGCOLOR)$(BUILD)"; \ - echo -e -n "$(OUTPUTCOLOR)$@$(WELLCOLOR) binary!\n"; \ + echo -e "$(DEFAULTCOLOR)\\c"; \ + echo -e "$(WELLCOLOR)Successfully compiled \\c"; \ + echo -e "$(WARNINGCOLOR)$(BUILD)\\c"; \ + echo -e "$(OUTPUTCOLOR)$@$(WELLCOLOR) binary!"; \ echo -e "$(DEFAULTCOLOR)Now cd to src/ dir and type $(OUTPUTCOLOR)./$@$(DEFAULTCOLOR) to start the application."; \ else \ echo -e "failed:"; \ @@ -108,11 +108,11 @@ fi clean: - @echo -e -n "Cleaning up..." - @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe @TRAY_OBJECTS@ - @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)" + @echo -e "Cleaning up...\\c"; + @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe @TRAY_OBJECTS@; + @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)"; distclean: - @echo -e -n "Cleaning up..." - @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe Makefile @TRAY_OBJECTS@ - @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)" + @echo -e "Cleaning up...\\c"; + @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe Makefile @TRAY_OBJECTS@; + @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)"; |
From: <ma...@us...> - 2003-12-26 14:25:32
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv23522 Modified Files: configure Log Message: BSD compatibility. Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/configure,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- configure 22 Dec 2003 10:51:04 -0000 1.14 +++ configure 26 Dec 2003 14:25:28 -0000 1.15 @@ -21,7 +21,7 @@ ## # Parses command-line options and sets variables as needed. # -function parse_cmdline() { +parse_cmdline() { # defaults wxconfig=wx-config; gtkconfig=gtk-config; @@ -102,7 +102,7 @@ shift; done; - echo -e -n "checking for --disable-colours\t\t\t"; + echo -e "checking for --disable-colours\\t\\t\\t\\c"; if test $colours = 1; then colour_default="\33[0;2m" colour_yes="\33[32;22m" @@ -114,11 +114,11 @@ echo -e "yes"; fi; - echo -e "checking for --with-wx-config\t\t\t$wxconfig"; - echo -e "checking for --prefix\t\t\t\t$prefix"; - echo -e "checking for --include-dir\t\t\t$include_dir"; + echo -e "checking for --with-wx-config\\t\\t\\t$wxconfig"; + echo -e "checking for --prefix\\t\\t\\t\\t$prefix"; + echo -e "checking for --include-dir\\t\\t\\t$include_dir"; - echo -e -n "checking for --enable-optimise\t\t\t"; + echo -e "checking for --enable-optimise\\t\\t\\t\\c" if test $optimise = 1; then echo -e "${colour_yes}yes${colour_default}"; cppflags="$cppflags -O3" @@ -126,7 +126,7 @@ echo -e "${colour_no}no${colour_default}"; fi; - echo -e -n "checking for --enable-debug\t\t\t"; + echo -e "checking for --enable-debug\\t\\t\\t\\c"; if test $debug = 1; then echo -e "${colour_yes}yes${colour_default}"; cppflags="$cppflags -g -ggdb -fno-inline -Wall" @@ -134,7 +134,7 @@ echo -e "${colour_no}no${colour_default}"; fi; - echo -e -n "checking for --enable-profile\t\t\t"; + echo -e "checking for --enable-profile\\t\\t\\t\\c"; if test $profile = 1; then echo -e "${colour_yes}yes${colour_default}"; cppflags="$cppflags -pg" @@ -142,14 +142,14 @@ echo -e "${colour_no}no${colour_default}"; fi; - echo -e -n "checking for --has-patched-wxsizer\t\t"; + echo -e "checking for --has-patched-wxsizer\\t\\t\\c"; if test $patch_sizer = 1; then echo -e "${colour_yes}yes${colour_default}"; else echo -e "${colour_no}no${colour_default}"; fi; - echo -e -n "checking for --show-flags\t\t\t"; + echo -e "checking for --show-flags\\t\\t\\t\\c"; if test $show_flags = 1; then echo -e "${colour_yes}yes${colour_default}"; else @@ -161,12 +161,10 @@ # Checks for wx-config in various standard locations and sets $wxconfig variable # to the location of it if found, or calls not_found() if can't find wx-config. # -function check_wxconfig() { - echo -n -e "checking for wx-config... \t\t\t"; +check_wxconfig() { + echo -e "checking for wx-config... \\t\\t\\t\\c"; if test -x $wxconfig; then wxconfig=$wxconfig; - elif test -x `which wx-config 2>/dev/null`; then - wxconfig=`which wx-config 2>/dev/null`; elif test -x /usr/local/bin/wx-config; then wxconfig=/usr/local/bin/wx-config; elif test -x /usr/bin/wx-config; then @@ -182,11 +180,12 @@ else echo "${colour_no}no${colour_default}"; cat <<EOF -wx-config was not found in standard locations. This means that either you do not -have wxWindows library installed for your platform (wxGTK for Linux, wxMac for -Mac OS, wxMSW for MS Windows), you are missing wxWindows developer package or -you have installed wxWindows into non-standard location. In the latter case, -rerun configure with --with-wx-config=/path/to/wx-config. + wx-config was not found in standard locations. This means that either + you do not have wxWindows library installed for your platform (wxGTK + for Linux, wxMac for Mac OS, wxMSW for MS Windows), you are missing + wxWindows developer package or you have installed wxWindows into non- + standard location. In the latter case, rerun configure with --with- + wx-config=/path/to/wx-config. EOF exit 1; fi; @@ -197,8 +196,8 @@ # Checks for wxWindows library version by parsing output of wx-config --version # and testing it against 2.4.0. Exists script with true if version is >= 2.4.0. # -function check_wxversion() { - echo -e -n "checking for wxWindows version >= 2.4.0...\t"; +check_wxversion() { + echo -e "checking for wxWindows version >= 2.4.0...\\t\\c"; wxversion=`$wxconfig --version` wxversion_major=`echo $wxversion | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` @@ -228,23 +227,23 @@ fi; if test $patch_sizer = 0; then - echo -e "\t${colour_warning}Warning: Sidebar hiding code will be disabled. To enable it,${colour_default}"; - echo -e "\t${colour_warning}get wxWindows >=v2.5.1, or patch it with flexgridsizer.patch and${colour_default}"; - echo -e "\t${colour_warning}recompile it and re-run this configure with --has-patched-wxsizer.${colour_default}"; + echo -e "\\t${colour_warning}Warning: Sidebar hiding code will be disabled. To enable it,${colour_default}"; + echo -e "\\t${colour_warning}get wxWindows >=v2.5.1, or patch it with flexgridsizer.patch and${colour_default}"; + echo -e "\\t${colour_warning}recompile it and re-run this configure with --has-patched-wxsizer.${colour_default}"; fi; } ## # Checks if wxWindows library was linked against GTK2 # -function check_wxgtk2() { +check_wxgtk2() { if $wxconfig --cppflags | grep -q 'gtk'; then - echo -e -n "checking if wxWindows was linked against GTK2..."; + echo -e "checking if wxWindows was linked against GTK2...\\c"; if $wxconfig --cppflags | grep -q 'gtk2' ; then echo -e "${colour_no}yes${colour_default}"; - echo -e "\t${colour_warning}Warning: GTK2 support in wxWindows is only experimental,${colour_default}"; - echo -e "\t${colour_warning}thus it is not officially supported in this application${colour_default}"; - echo -e "\t${colour_warning}either. You have been warned, continue on your own risk.${colour_default}"; + echo -e "\\t${colour_warning}Warning: GTK2 support in wxWindows is only experimental,${colour_default}"; + echo -e "\\t${colour_warning}thus it is not officially supported in this application${colour_default}"; + echo -e "\\t${colour_warning}either. You have been warned, continue on your own risk.${colour_default}"; cppflags="$cppflags -D__GTK2__" gtk2=1; else @@ -257,7 +256,7 @@ ## # Checks if wxWindows was linked against MSW # -function check_wxmsw() { +check_wxmsw() { if $wxconfig --cppflags | grep -q 'msw'; then res=wxInterface_private.res else @@ -268,11 +267,11 @@ ### # Checks for availability of GTK headers (needed for GTK systray) # -function check_gtkconfig() { +check_gtkconfig() { has_gtk=0; has_pkgconfig=0; if $wxconfig --cppflags | grep -q 'gtk'; then - echo -e -n "checking for gtk-config..."; + echo -e "checking for gtk-config...\\c"; if test -x $gtkconfig; then gtkconfig=$gtkconfig; has_gtk=1; @@ -304,11 +303,11 @@ has_gtk=0; fi; if test $has_gtk = 1; then - echo -e "${colour_yes}\t\t\t$gtkconfig${colour_default}"; + echo -e "${colour_yes}\\t\\t\\t$gtkconfig${colour_default}"; fi; if test $gtk2 = 1; then - echo -e -n "checking for pkg-config..."; + echo -e "checking for pkg-config...\\c"; if test -x $pkgconfig; then pkgconfig=$pkgconfig; has_pkgconfig=1; @@ -328,7 +327,7 @@ has_pkgconfig=0; fi; if test $has_gtk = 1 -a $has_pkgconfig = 1; then - echo -e "$colour_yes\t\t\t$pkgconfig$colour_default"; + echo -e "$colour_yes\\t\\t\\t$pkgconfig$colour_default"; fi; fi; @@ -339,8 +338,8 @@ ## # Checks for ccache (compiler cache) availability # -function check_ccache() { - echo -n -e "checking for ccache...\t\t\t\t"; +check_ccache() { + echo -e "checking for ccache...\\t\\t\\t\\t\\c"; if test -x /usr/local/bin/ccache; then ccache=/usr/local/bin/ccache; echo -e "${colour_yes}yes${colour_default}"; @@ -425,7 +424,7 @@ ## # Outputs error message about too old wxWindows library and exits with false. # -function wrong_version() { +wrong_version() { cat<<EOF wxWindows library was found, but is too old for usage (v$wxversion_major.\ $wxversion_minor.$wxversion_patch). Please download |
From: <ma...@us...> - 2003-12-26 11:36:36
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv2590 Modified Files: GUISettingsDlg.cpp MainDlg.cpp MainDlg.h Log Message: Fixed i18n that got broken by dynamic page-list storage implemention. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- GUISettingsDlg.cpp 25 Dec 2003 02:27:48 -0000 1.30 +++ GUISettingsDlg.cpp 26 Dec 2003 11:36:32 -0000 1.31 @@ -131,7 +131,7 @@ GetShowTool()->SetValue(show_toolbar); GetShowMenu()->SetValue(show_menubar); GetRememberLast()->SetValue(remember_last); - GetStartPage()->SetStringSelection(startpage); + GetStartPage()->SetStringSelection(_(startpage)); switch (tool_align) { case wxTB_HORIZONTAL: tool_align = 0; break; @@ -194,8 +194,12 @@ m_config->Write(wxT("Show ToolBar"), GetShowTool()->GetValue()); m_config->Write(wxT("Toolbar Alignment"), tool_align); m_config->Write(wxT("Show MenuBar"), GetShowMenu()->GetValue()); + Page *start_page = (Page*)GetStartPage()->GetClientData( + GetStartPage()->GetSelection() + ); m_config->Write( - wxT("StartPage"), GetStartPage()->GetStringSelection() + wxT("StartPage"), + mainframe->GetPageList().Find(start_page)->GetKeyString() ); m_config->Write(wxT("Remember last"), GetRememberLast()->GetValue()); @@ -485,18 +489,15 @@ wxStaticBox *item20 = new wxStaticBox( this, -1, _("Startup page") ); wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); - wxString strs21[] = { - _("Servers"), - _("Search"), - _("Transfer"), - _("Shared Files"), - _("Messages"), - _("Statistics") - }; wxChoice *item21 = new wxChoice( - this, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1), - 6, strs21, 0 + this, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1) ); + for (size_t i=0;i<mainframe->GetPageList().GetCount();i++) { + item21->Append( + mainframe->GetPageList()[i]->short_title, + mainframe->GetPageList()[i] + ); + } #ifndef __WXX11__ item21->SetToolTip( _("Set which page will be displayed on program startup") Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- MainDlg.cpp 25 Dec 2003 14:25:45 -0000 1.39 +++ MainDlg.cpp 26 Dec 2003 11:36:32 -0000 1.40 @@ -209,7 +209,8 @@ m_config->SetPath(wxT("/General")); m_config->Read(wxT("Remember last"), &remember_last, true); if (remember_last && !pages.IsEmpty()) { - m_config->Write(wxT("StartPage"), GetCurPage()->short_title); + m_config->Write(wxT("StartPage"), + pages.Find(GetCurPage())->GetKeyString()); } #ifdef wxHAS_TASK_BAR_ICON @@ -248,7 +249,7 @@ return false; /* Nothing to show */ } else if (to_show == wxT("")) { return false; /* Nothing to show */ - } else if (cur_page->short_title == to_show) { + } else if (pages.Find(cur_page)->GetKeyString() == to_show) { return false; /* Already shown */ } else if (pages.Find(to_show) == NULL) { return false; /* Not found */ @@ -322,7 +323,7 @@ if (pages.IsEmpty()) { break; } - names.Add(pages.Item(i)->GetData()->short_title); + names.Add(pages.Item(i)->GetKeyString()); } img->CalcToolBitmapSize(names); } @@ -447,28 +448,29 @@ wxASSERT_MSG(statisticswnd, wxT("Statistics Page creation failed.")); AddPage( - serverwnd, _("Servers"), _("Server list"), + serverwnd, wxT("Servers"), _("Servers"), _("Server list"), wxT("btn_servers"), ID_SERVERWND ); AddPage( - searchwnd, _("Search"), _("Search files"), + searchwnd, wxT("Search"), _("Search"), _("Search files"), wxT("btn_search"), ID_SEARCHWND ); AddPage( - transferwnd, _("Transfer"), _("File Transfer"), + transferwnd, wxT("Transfer"), _("Transfer"), _("File Transfer"), wxT("btn_transfer"), ID_TRANSFERWND ); AddPage( - sharedfileswnd, _("Shared Files"), _("Shared Files"), - wxT("btn_shared"), ID_SHAREDFILESWND + sharedfileswnd, wxT("Shared Files"), _("Shared Files"), + _("Shared Files"), wxT("btn_shared"), ID_SHAREDFILESWND ); AddPage( - messageswnd, _("Messaging"), _("Chatting"), + messageswnd, wxT("Messaging"), _("Messaging"), _("Chatting"), wxT("btn_messages"), ID_MESSAGESWND ); AddPage( - statisticswnd, _("Statistics"), _("Show live statistics"), - wxT("btn_statistics"), ID_STATISTICSWND + statisticswnd, wxT("Statistics"), _("Statistics"), + _("Show live statistics"), wxT("btn_statistics"), + ID_STATISTICSWND ); m_config->Read(wxT("/General/StartPage"), &start_page, wxT("Servers")); @@ -745,7 +747,7 @@ } if (event.GetId() == pages.Item(i)->GetData()->id) { tmp = SetActivePage( - pages.Item(i)->GetData()->short_title + pages.Item(i)->GetKeyString() ); if (!tmp) { GetToolBar()->ToggleTool(event.GetId(), true); @@ -956,7 +958,7 @@ start_up = true; if (!pages.IsEmpty()) { - SetActivePage(pages.Item(0)->GetData()->short_title); + SetActivePage(pages.Item(0)->GetKeyString()); } UpdateToolBar(); UpdateMenuBar(); @@ -982,6 +984,7 @@ /* Constructs a new `Page` structure from the values passed to us, adds it to */ /* pages list and updates tool/menubars as neccesery. */ /* @page Contents of the new page */ +/* @name UNTRANSLATED name for the page for internal handling */ /* @short_title Will be displayed on toolbar button */ /* @long_title Will be displayed as tooltip on toolbar */ /* @image Name of the image for toolbar button (will be looked */ @@ -990,15 +993,16 @@ /* @update_bars If true, also updates toolbar/menubars as neccesery */ /******************************************************************************/ void CMainDlg::AddPage( - wxPanel *page, const wxString &short_title, const wxString - &long_title, const wxString &image, wxWindowID id, bool update_bars + wxPanel *page, const wxString &name, const wxString &short_title, + const wxString &long_title, const wxString &image, wxWindowID id, + bool update_bars ) { if (page == NULL) { wxFAIL_MSG(wxT("Empty page passed for adding!")); return; } wxLogDebug( - wxT("Adding page `%s` with title `%s`, image `%s`."), + wxT("Adding page `%s` with title `%s`, image `%s`."), short_title.c_str(), long_title.c_str(), image.c_str() ); Page *newpage = new Page; @@ -1011,7 +1015,7 @@ if (!start_up) { img->MakeToolImage(newpage->short_title, newpage->image); } - pages.Append(short_title, newpage); + pages.Append(name, newpage); if (update_bars) { CreateMyToolBar(); Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MainDlg.h 23 Dec 2003 00:40:50 -0000 1.16 +++ MainDlg.h 26 Dec 2003 11:36:32 -0000 1.17 @@ -128,8 +128,9 @@ void CreateMyToolBar(bool gen_images = false); /* Creates tbar */ void CreateMyMenuBar(); /* (re)Creates menubar */ void AddPage( /* Adds new page to frame */ - wxPanel *page, const wxString &short_title, const wxString - &long_title, const wxString &image, wxWindowID = -1, + wxPanel *page, const wxString &name, + const wxString &short_title, const wxString &long_title, + const wxString &image, wxWindowID = -1, bool updatebars = false ); void AddPage(Page *page, bool updatebars = false); /* Adds new page */ @@ -154,6 +155,7 @@ wxStaticText* GetStatusConnection() { /* Statusbar server name text */ return (wxStaticText*) FindWindow( ID_STATUS_CONNECTION ); } + PageList& GetPageList() { return pages; } private: DECLARE_EVENT_TABLE() |
From: <mik...@us...> - 2003-12-26 10:33:50
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src In directory sc8-pr-cvs1:/tmp/cvs-serv27773/src Modified Files: Main.cpp Log Message: 26/12/2003 Mikael Barbeaux * Fixed win32 sockets initialization bug. Index: Main.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Main.cpp 26 Dec 2003 10:31:16 -0000 1.5 +++ Main.cpp 26 Dec 2003 10:33:47 -0000 1.6 @@ -66,8 +66,8 @@ WSADATA wsaData; int WSockStatus = WSAStartup(winsockminversion, &wsaData); if(WSockStatus != 0) { - cout << Localize("ERROR_WINSOCK") << std::endl; - return false; + cout << "ERROR_WINSOCK" << std::endl; + return -1; } #endif TestSocket test_sock; |
From: <mik...@us...> - 2003-12-26 10:31:19
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv27509 Modified Files: Makefile.win ChangeLog Log Message: 26/12/2003 Mikael Barbeaux * Fixed win32 sockets initialization bug. Index: Makefile.win =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.win,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.win 26 Dec 2003 10:07:58 -0000 1.6 +++ Makefile.win 26 Dec 2003 10:31:16 -0000 1.7 @@ -32,7 +32,7 @@ INCLUDE_DIRS = -I"$(MINGW_DIR)/include/c++" -I"$(MINGW_DIR)/include/c++/mingw32" INLUCDE_DIRS += -I"$(MINGW_DIR)/include/c++/backward" -I"$(MINGW_DIR)/include" LIBRARIES_DIR = -L"$(MINGW_DIR)/lib" -LIBS = -L"$(MINGW_DIR)/lib" +LIBS = -L"$(MINGW_DIR)/lib" $(MINGW_DIR)/lib/libws2_32.a OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ChangeLog 26 Dec 2003 10:07:58 -0000 1.7 +++ ChangeLog 26 Dec 2003 10:31:16 -0000 1.8 @@ -24,6 +24,7 @@ ----------------------------------------------------------- 26/12/2003 Mikael Barbeaux + * Fixed win32 sockets initialization bug. * Updated Makefiles * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. |
From: <mik...@us...> - 2003-12-26 10:31:19
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src In directory sc8-pr-cvs1:/tmp/cvs-serv27509/src Modified Files: Main.cpp Log Message: 26/12/2003 Mikael Barbeaux * Fixed win32 sockets initialization bug. Index: Main.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Main.cpp 26 Dec 2003 10:04:51 -0000 1.4 +++ Main.cpp 26 Dec 2003 10:31:16 -0000 1.5 @@ -60,6 +60,16 @@ cont = false; } else if(command == "4") { + #ifdef _WIN32_ + // Init WINSOCK + WORD winsockminversion = MAKEWORD(2,0); + WSADATA wsaData; + int WSockStatus = WSAStartup(winsockminversion, &wsaData); + if(WSockStatus != 0) { + cout << Localize("ERROR_WINSOCK") << std::endl; + return false; + } + #endif TestSocket test_sock; test_sock.test(); cont = false; |
From: <mik...@us...> - 2003-12-26 10:08:02
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv24821 Modified Files: Makefile.bsd Makefile.osx Makefile.win Makefile.lin ChangeLog Log Message: 26/12/2003 Mikael Barbeaux * Updated Makefiles Index: Makefile.bsd =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.bsd,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.bsd 26 Dec 2003 10:04:51 -0000 1.5 +++ Makefile.bsd 26 Dec 2003 10:07:58 -0000 1.6 @@ -31,8 +31,8 @@ OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ src/exceptions/SocketException.o \ - src/server/Socket.o \ - src/server/ServerSocket.o \ + src/server/network/Socket.o \ + src/server/network/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ Index: Makefile.osx =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.osx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.osx 26 Dec 2003 10:04:51 -0000 1.5 +++ Makefile.osx 26 Dec 2003 10:07:58 -0000 1.6 @@ -31,8 +31,8 @@ OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ src/exceptions/SocketException.o \ - src/server/Socket.o \ - src/server/ServerSocket.o \ + src/server/network/Socket.o \ + src/server/network/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ Index: Makefile.win =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.win,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.win 26 Dec 2003 10:04:51 -0000 1.5 +++ Makefile.win 26 Dec 2003 10:07:58 -0000 1.6 @@ -37,8 +37,8 @@ OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ src/exceptions/SocketException.o \ - src/server/Socket.o \ - src/server/ServerSocket.o \ + src/server/network/Socket.o \ + src/server/network/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ Index: Makefile.lin =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.lin,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.lin 26 Dec 2003 10:04:51 -0000 1.5 +++ Makefile.lin 26 Dec 2003 10:07:58 -0000 1.6 @@ -30,8 +30,8 @@ OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ src/exceptions/SocketException.o \ - src/server/Socket.o \ - src/server/ServerSocket.o \ + src/server/network/Socket.o \ + src/server/network/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ChangeLog 26 Dec 2003 10:04:51 -0000 1.6 +++ ChangeLog 26 Dec 2003 10:07:58 -0000 1.7 @@ -24,6 +24,7 @@ ----------------------------------------------------------- 26/12/2003 Mikael Barbeaux + * Updated Makefiles * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. |
From: <mik...@us...> - 2003-12-26 10:04:55
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src In directory sc8-pr-cvs1:/tmp/cvs-serv24435/src Modified Files: Main.cpp Log Message: 26/12/2003 Mikael Barbeaux * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. Index: Main.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Main.cpp 24 Dec 2003 14:10:32 -0000 1.3 +++ Main.cpp 26 Dec 2003 10:04:51 -0000 1.4 @@ -20,19 +20,51 @@ #include "test/TestException.h" #include "test/TestThread.h" #include "test/TestSemaphore.h" +#include "test/TestSocket.h" +#include <iostream> +#include <string> +using namespace std; /** * Main program. */ int main() { - TestException test_excp; - test_excp.test(); - - TestThread test_th; - test_th.test(); + cout << "Choose a test to run : " << endl; + cout << " 1. Exceptions test" << endl; + cout << " 2. Threads test" << endl; + cout << " 3. Semaphores test" << endl; + cout << " 4. Sockets test" << endl; + cout << "Enter your choice : "; + + bool cont = true; + while(cont) { + // Retrieve command + string command; + char buffer[80]; + cin.getline(buffer, 79); + command = buffer; - TestSemaphore test_sem; - test_sem.test(); - return 0; + if(command == "1") { + TestException test_excp; + test_excp.test(); + cont = false; + } + else if(command == "2") { + TestThread test_th; + test_th.test(); + cont = false; + } + else if(command == "3") { + TestSemaphore test_sem; + test_sem.test(); + cont = false; + } + else if(command == "4") { + TestSocket test_sock; + test_sock.test(); + cont = false; + } + else cout << "Invalid choice... Enter your choice : "; + } } |
From: <mik...@us...> - 2003-12-26 10:04:55
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv24435/src/test Added Files: TestSocket.cpp TestSocket.h Log Message: 26/12/2003 Mikael Barbeaux * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. --- NEW FILE: TestSocket.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "TestSocket.h" #include "../exceptions/Exception.h" #include <iostream> using namespace std; #include <stdio.h> /** * Constructor for TestSocket. */ TestSocket::TestSocket() : TestHandler() { } /** * Destructor for TestSocket. */ TestSocket::~TestSocket() { } /** * Runs the tester */ void TestSocket::test() { /** This test tries to launch a thread * and goes on working. */ cout << endl; cout << "ShareDaemon Web Interface - Test" << endl << endl; cout << "Test for sockets... " << endl; cout << "The tester will create a socket, listening for connections on " << endl; cout << "port 4589. Open your favourite browser and waits for the socket" << endl; cout << "to start. Then, try to open \"http://localhost:4589\" with your " << endl; cout << "browser to test the socket." << endl; cout << "Press enter to continue" << endl; getchar(); cout << endl << endl; try { cout << "Creates a server socket..." << endl; ServerSocket server; cout << "Validates the server socket..." << endl; server.validate(); cout << "Bind server socket on port 4589..." << endl; server.bind(4589); cout << "Listening for connections..." << endl; server.listen(5); cout << "Take your browser to test \"http://localhost:4589\"..." << endl; Socket *socket = server.accept(); cout << "Socket accepted !" << endl; char *recv; socket->receive(&recv); cout << "Reveiced mesage : " << endl; cout << recv << endl; cout << "Sending response..." << endl; delete[] recv; char *resp = "HTTP/1.1 200 OK\n\n<html><body>Request received !</body></html>\n"; socket->send(resp, strlen(resp)); cout << "Closing socket..." << endl; socket->close(); cout << "Closing server socket..." << endl << endl; server.close(); } catch(Exception& e) { // display the exception message cout << e.getMessage() << endl; } cout << "Could you connect to the socket and did you see the response ?" << endl; cout << " If no => VERY BAD :(" << endl; cout << " If yes => Test worked !! :D" << endl << endl; cout << "Press enter to continue" << endl; getchar(); } --- NEW FILE: TestSocket.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TEST_SOCKET_H_ #define _TEST_SOCKET_H_ #include "TestHandler.h" #include "../server/network/Socket.h" #include "../server/network/ServerSocket.h" /** * Defines a test class for sockets. */ class TestSocket : public TestHandler { public: /** * Creates a test for sockets. */ TestSocket(); /** * Destructor for TestSocket */ ~TestSocket(); /** * Runs the tester. */ virtual void test(); }; #endif |
From: <mik...@us...> - 2003-12-26 10:04:54
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/network In directory sc8-pr-cvs1:/tmp/cvs-serv24435/src/server/network Added Files: Socket.h Socket.cpp ServerSocket.cpp ServerSocket.h Log Message: 26/12/2003 Mikael Barbeaux * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. --- NEW FILE: Socket.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SOCKET_H_ #define _SOCKET_H_ #include <unistd.h> #include <cstdlib> #include <string> #ifdef _WIN32_ #include <winsock.h> #include <winuser.h> #else #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #endif #include "../../exceptions/SocketException.h" /** * * Defines a standard socket implementation. * This socket simply sends data bytes and receives * data bytes. * For a HTTP socket, use the corresponding class into * http directory. * */ class Socket { private: // inet address of this socket sockaddr_in socket_address; // state of this socket bool closed; // socket's id int socket_id; public: /** * Create a unconnected socket. */ Socket(); /** * Create a socket ( considered as connected ) * with the given identifiant and address. * * @param id - Socket's id * @param address - inet address of this socket */ Socket(int id, sockaddr_in& address); /** * Socket destructor */ ~Socket(); /** * Test if the socket is closed. * * @return bool */ bool isClosed(); /** * Close the socket. * * @throw SocketException */ void close() throw (SocketException); /** * Test if the socket is valid ( have been instancied ). * * @return bool */ bool isValid(); /** * Returns this socket's id * * @return int */ int getId(); /** * Sends bytes to the client. * * @param data - data to send. * @param size - Size of data. * @param max - Maximum number of bytes to send each time. * @throw SocketException. */ void send(const char* data, unsigned long int size, unsigned int max = 4096) throw (SocketException); /** * Receives bytes from the client. * * @param data - A buffer where to save data. * @param max - Maximum number of bytes to receive each time. * @return Number of bytes received. * @throw SocketException. */ unsigned long int receive(char** data, unsigned int max = 4096) throw (SocketException); }; #endif --- NEW FILE: Socket.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Socket.h" /** * Default Socket constructor. * As it doesn't need parameters, the socket * is considered as not yet connected and * without any inet address. */ Socket::Socket() { socket_id = -1; closed = false; } /** * Default Socket constructor. * As it doesn't need parameters, the socket * is considered as not yet connected and * without any inet address. */ Socket::Socket(int id, sockaddr_in& addr) { socket_id = id; socket_address = addr; closed = false; } /** * Socket destructor. */ Socket::~Socket() { } /** * Returns true if the socket is closed, else return * false. */ bool Socket::isClosed() { return closed; } /** * Close the socket. * Throws a SocketException if this socket had * already been closed or if it's an invalid * socket. */ void Socket::close() throw (SocketException) { // Throw an exception if invalid or already closed. if(! isValid()) throw SocketException(InvalidSockExcp,"Invalid socket.","Socket::close"); if(isClosed()) throw SocketException(ClosedSockExcp,"Socket already closed.","Socket::close"); // Close the socket. #ifdef _WIN32_ ::closesocket(socket_id); #else ::close(socket_id); #endif // Set socket's state. closed = true; } /** * Returns true if the socket is valid (id not equals to -1 ), * else returns false. */ bool Socket::isValid() { return (socket_id != -1); } /** * Returns this socket's id. */ int Socket::getId() { return socket_id; } /** * Send size bytes to the client connected with this socket. * At one time, only 'max' bytes are sent to the client. * Throws a SocketException if an error occurs while * sending datas. */ void Socket::send(const char* data, unsigned long int size, unsigned int max) throw(SocketException) { // Throw an exception if invalid or already closed. if(! isValid()) throw SocketException(InvalidSockExcp,"Invalid socket.","Socket::send"); if(isClosed()) throw SocketException(ClosedSockExcp,"Socket is closed.", "Socket::send"); // Total number of bytes sent unsigned long int total_sent = 0; // Number of bytes sent this time long int sent = 0; while(total_sent < size) { // Try to send max bytes... if((sent = ::send(socket_id, data, ((size - total_sent) > max) ? max : (size - total_sent), 0)) > 0) { total_sent += sent; data += sent; } else if(sent < 0) // error while sending... throw SocketException(SendSockExcp, "Error while sending data.", "Socket::send"); } } /** * Receives data from the client connected to this socket. * At one time, only 'max' bytes are received from the client. * Returns the number of bytes received. * Throws a SocketException if an error occurs while * receiving data from the client. */ unsigned long int Socket::receive(char** data, unsigned int max) throw (SocketException) { // Throw an exception if invalid or already closed. if(! isValid()) throw SocketException(InvalidSockExcp,"Invalid socket.","Socket::receive"); if(isClosed()) throw SocketException(ClosedSockExcp,"Socket is closed.", "Socket::receive"); // Total number of bytes read unsigned long int total_read = 0; // Number of bytes read this time long int read = max; // Receive as much data as possible... while((read > 0) && (read == (int) max)) { char *buffer = new char[total_read+max+1]; // copy already received bytes memcpy(buffer,*data,total_read); delete[] (*data); // Receive new bytes read = ::recv(socket_id, (buffer+total_read), max, 0); if(read <= 0) { delete[] buffer; break; } buffer[total_read+read] = '\0'; total_read += read; // Update data *data = buffer; } if(read <= 0) throw SocketException(RecvSockExcp, "Error while receiving data.", "Socket::receive"); return total_read; } --- NEW FILE: ServerSocket.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ServerSocket.h" #ifdef _WIN32_ #define socklen_t int #endif /** * Creates a generic ServerSocket. * At initialization, this socket will * be unconnected and invalid. * Call the connect() method to start * listening for connections. */ ServerSocket::ServerSocket() { // Initialization of server state. bound = false; closed = false; listening = false; server_id = -1; } /** * Destructs a server socket object. * It will close the server if not yet * done. */ ServerSocket::~ServerSocket() { if(! isClosed()) close(); } /** * Returns true if the server socket is * binding to a port, else returns false. */ bool ServerSocket::isBound() { return bound; } /** * Returns true if the server socket is * listening to a port, else returns false. */ bool ServerSocket::isListening() { return listening; } /** * Returns true if the server socket is * valid, else returns false. */ bool ServerSocket::isValid() { return (server_id != -1); } /** * Returns true if the server socket is * closed, else returns false. */ bool ServerSocket::isClosed() { return closed; } /** * Close the server socket. * Throws a SocketException if the server socket is * invalid or had been already closed. */ void ServerSocket::close() throw (SocketException) { if(server_id == -1) throw SocketException(InvalidSockExcp, "Invalid server socket.", "ServerSocket::close"); if(closed) throw SocketException(ClosedSockExcp, "Server socket already closed", "ServerSocket::close"); // Close the server socket #ifdef _WIN32_ ::closesocket(server_id); #else ::close(server_id); #endif // Change server socket state closed = true; } /** * Validates the server socket. It instanciates * the socket listening for connections. * Throws a SocketException if cannot validate * the socket. */ void ServerSocket::validate() throw(SocketException) { if(server_id != -1) throw SocketException(AlreadyValidSockExcp, "Server socket is already valid.", "ServerSocket::validate"); if(closed) throw SocketException(ClosedSockExcp, "Server socket is closed.", "ServerSocket::validate"); // create socket ( TCP and Internet ) server_id = socket(AF_INET, SOCK_STREAM, 0); if(server_id == -1) throw SocketException(CantCreateSockExcp, "Cannot create server socket.", "ServerSocket::validate"); } /** * Binds the server socket to a given port. * Throws a SocketException if a problem occured * while binding : server already bounded, server * not valid, or cannot bind to given port. */ void ServerSocket::bind(int port) throw (SocketException) { if(server_id == -1) throw SocketException(InvalidSockExcp, "Invalid server socket.", "ServerSocket::bind"); if(closed) throw SocketException(ClosedSockExcp, "Server socket is closed.", "ServerSocket::bind"); if(bound) throw SocketException(AlreadyBoundSockExcp, "Server socket is already bound", "ServerSocket::bind"); // Bind the server socket to given port server_address.sin_family = AF_INET; server_address.sin_addr.s_addr = INADDR_ANY; server_address.sin_port = htons(port); int ret = ::bind(server_id, (struct sockaddr *) &server_address, sizeof(struct sockaddr_in)); if(ret == -1) throw SocketException(CantBindSockExcp, "Cannot bind server socket.", "ServerSocket::bind"); // change state bound = true; } /** * Makes the server socket listening for connections. * Throws a SocketException if it's invalid, if it's not bound * or if it cannot be listening. * * @param max_conn - Maximum number of simultaneous connections. */ void ServerSocket::listen(unsigned int max_conn) throw (SocketException) { if(server_id == -1) throw SocketException(InvalidSockExcp, "Invalid server socket.", "ServerSocket::listen"); if(closed) throw SocketException(ClosedSockExcp, "Server socket is closed.", "ServerSocket::listen"); if(! bound) throw SocketException(UnboundSockExcp, "Server socket isn't bound", "ServerSocket::listen"); // listen for connection int ret = ::listen(server_id, max_conn); if(ret == -1) throw SocketException(CantListenSockExcp, "Server socket can't listen for connections.", "ServerSocket::listen"); listening = true; } /** * Accepts a connection. It creates a connection * to a client and inserts it into the Socket object. * Throws a SocketException if an error occurs when * accepting or any other reasons ( not valid, not * bound, not listening ). */ Socket* ServerSocket::accept() throw (SocketException) { if(server_id == -1) throw SocketException(InvalidSockExcp, "Invalid server socket.", "ServerSocket::accept"); if(closed) throw SocketException(ClosedSockExcp, "Server socket is closed.", "ServerSocket::accept"); if(! bound) throw SocketException(UnboundSockExcp, "Server socket isn't bound", "ServerSocket::accept"); if(! listening) throw SocketException(NotListeningSockExcp, "Server socket isn't listening for connections", "ServerSocket::accept"); // Client informations int client_id; sockaddr_in client_address; int address_length = sizeof(struct sockaddr_in); // Accepting connection client_id = ::accept(server_id, (sockaddr *) &client_address, (socklen_t *) &address_length); if(client_id <= 0) throw SocketException(InvalidSockExcp, "Received socket is invalid.", "ServerSocket::accept"); // Create socket for this connection Socket *client = new Socket(client_id, client_address); return client; } --- NEW FILE: ServerSocket.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SERVER_SOCKET_H_ #define _SERVER_SOCKET_H_ #ifdef _MACOSX_ #define _BSD_SOCKLEN_T_ #endif #include "Socket.h" #include "../../exceptions/SocketException.h" /** * * Defines a generic socket for acting as a server. * This socket will listen for connection and accept * them, creating an associated Socket object to * discuss with the client. * */ class ServerSocket { private: // address of this server socket sockaddr_in server_address; // bound state bool bound; // closed state bool closed; // listening state bool listening; // server identifiant int server_id; public: /** * Creates a generic server socket. */ ServerSocket(); /** * ServerSocket destructor */ ~ServerSocket(); /** * Test if the server socket is bound. */ bool isBound(); /** * Test if the server socket is listening. */ bool isListening(); /** * Test if the server socket is valid. */ bool isValid(); /** * Test if the server socket is closed. */ bool isClosed(); /** * Close the server socket. * * @throw SocketException */ void close() throw (SocketException); /** * Validates the server socket. * * @throw SocketException */ void validate() throw (SocketException); /** * Binds the server socket on the given port. * * @param port - Port where to bind server * @throw SocketException */ void bind(int port) throw (SocketException); /** * Makes the server socket listening for connections. * * @param max_conn - Maximum number of simultaneous connections. * @throw SocketException */ void listen(unsigned int max_conn) throw (SocketException); /** * Accepts a connection. * * @return Socket* - The connected socket. * @throw SocketException */ Socket* accept() throw (SocketException); }; #endif |
From: <mik...@us...> - 2003-12-26 10:04:54
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv24435 Modified Files: Makefile.lin Makefile.bsd Makefile.osx Makefile.win ChangeLog Log Message: 26/12/2003 Mikael Barbeaux * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. Index: Makefile.lin =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.lin,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.lin 24 Dec 2003 14:10:32 -0000 1.4 +++ Makefile.lin 26 Dec 2003 10:04:51 -0000 1.5 @@ -29,10 +29,14 @@ OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ + src/exceptions/SocketException.o \ + src/server/Socket.o \ + src/server/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ src/test/TestSemaphore.o \ + src/test/TestSocket.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: Makefile.bsd =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.bsd,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.bsd 24 Dec 2003 14:10:32 -0000 1.4 +++ Makefile.bsd 26 Dec 2003 10:04:51 -0000 1.5 @@ -28,13 +28,16 @@ STRIP = strip LIBS = -pthread - OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ + src/exceptions/SocketException.o \ + src/server/Socket.o \ + src/server/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ src/test/TestSemaphore.o \ + src/test/TestSocket.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: Makefile.osx =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.osx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.osx 24 Dec 2003 14:10:32 -0000 1.4 +++ Makefile.osx 26 Dec 2003 10:04:51 -0000 1.5 @@ -28,13 +28,16 @@ STRIP = strip LIBS = -lpthread - OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ + src/exceptions/SocketException.o \ + src/server/Socket.o \ + src/server/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ src/test/TestSemaphore.o \ + src/test/TestSocket.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: Makefile.win =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.win,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.win 24 Dec 2003 14:10:32 -0000 1.4 +++ Makefile.win 26 Dec 2003 10:04:51 -0000 1.5 @@ -34,13 +34,16 @@ LIBRARIES_DIR = -L"$(MINGW_DIR)/lib" LIBS = -L"$(MINGW_DIR)/lib" - OBJECTS = src/exceptions/Exception.o \ src/exceptions/ThreadException.o \ + src/exceptions/SocketException.o \ + src/server/Socket.o \ + src/server/ServerSocket.o \ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ src/test/TestSemaphore.o \ + src/test/TestSocket.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChangeLog 24 Dec 2003 14:10:32 -0000 1.5 +++ ChangeLog 26 Dec 2003 10:04:51 -0000 1.6 @@ -23,7 +23,11 @@ ----------------------------------------------------------- -24/12/2003 Barbeaux +26/12/2003 Mikael Barbeaux + * Implemented Socket, ServerSocket and SocketException classes. + * Added simple test program for Sockets. + +24/12/2003 Mikael Barbeaux * Added simple test program for Semaphores. * Updated Makefiles for Win32, Linux and MacOS X * Added simple test programs for Exceptions and Threads. |
From: <mik...@us...> - 2003-12-26 10:04:54
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv24435/src/exceptions Modified Files: Exception.h ThreadException.cpp Added Files: SocketException.h SocketException.cpp Log Message: 26/12/2003 Mikael Barbeaux * Implemented Socket, ServerSocket and SocketException classes. * Added simple test program for Sockets. --- NEW FILE: SocketException.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SOCKET_EXCEPTION_H_ #define _SOCKET_EXCEPTION_H_ #include "Exception.h" enum SocketError { InvalidSockExcp, ClosedSockExcp, SendSockExcp, RecvSockExcp, AlreadyValidSockExcp, CantCreateSockExcp, AlreadyBoundSockExcp, CantBindSockExcp, UnboundSockExcp, CantListenSockExcp, NotListeningSockExcp }; /** * Defines a Exception for handling socket errors. */ class SocketException : public Exception { public: /** * Creates a Socket exception handler. * * @param eCode - code of this exception * @param message - Message to send to this exception * @param origin - Method who throws the exception */ SocketException(SocketError eCode, const string& message, const string& origin); /** * Returns the message sent by this Socket exception. * * @return const string */ virtual const string getMessage() const; }; #endif --- NEW FILE: SocketException.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "SocketException.h" #include <sstream> using namespace std; /** * Creates a SocketException object with the given error code and * message. */ SocketException::SocketException(SocketError eCode, const string& message, const string& origin) : Exception(eCode, message, origin) { } /** * Returns the message sent by this exception, depending the * error code sent. */ const string SocketException::getMessage() const { ostringstream message; // Build error message depending error code message << "-----------------------" << endl; message << "WARNING : SocketException thrown !!" << endl; message << "| Type : "; switch(code) { case InvalidSockExcp: message << "InvalidSocket error"; break; case ClosedSockExcp: message << "ClosedSocket error"; break; case SendSockExcp: message << "SendSocket error"; break; case RecvSockExcp: message << "ReceiveSocket error"; break; case AlreadyValidSockExcp: message << "AlreadyValidSocket error"; break; case CantCreateSockExcp: message << "CantCreateSocket error"; break; case AlreadyBoundSockExcp: message << "AlreadyBoundSocket error"; break; case CantBindSockExcp: message << "CantBindSocket error"; break; case UnboundSockExcp: message << "UnboundSocket error"; break; case CantListenSockExcp: message << "CantListenSocket error"; break; case NotListeningSockExcp: message << "NotListeningSocket error"; break; default: message << "UnknownError"; break; } message << endl << "| From : " << origin << endl; message << "| Message : " << what() << endl; message << "-----------------------" << endl; return message.str(); } Index: Exception.h =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/exceptions/Exception.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Exception.h 24 Dec 2003 11:52:49 -0000 1.2 +++ Exception.h 26 Dec 2003 10:04:50 -0000 1.3 @@ -27,7 +27,10 @@ /** * Defines a generic Exception object for handling * exceptions into the program. - * + * Exceptions are defined with a error code, that describes it, + * a string message for explaining the error meaning, and finally + * a string containing the name of the method which launches it, + * in order to provide a more powerful debugging. */ class Exception : public runtime_error { Index: ThreadException.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/exceptions/ThreadException.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ThreadException.cpp 24 Dec 2003 13:03:54 -0000 1.3 +++ ThreadException.cpp 26 Dec 2003 10:04:50 -0000 1.4 @@ -37,7 +37,7 @@ ostringstream message; // Build error message depending error code message << "-----------------------" << endl; - message << "WARNING : Exception thrown !!" << endl; + message << "WARNING : ThreadException thrown !!" << endl; message << "| Type : "; switch(code) { case MutexExcp: |
From: <mik...@us...> - 2003-12-26 10:04:34
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server In directory sc8-pr-cvs1:/tmp/cvs-serv24409/src/server Log Message: Directory /cvsroot/sharedaemon/sharedaemon-ui-web/src/server added to the repository |
From: <mik...@us...> - 2003-12-26 10:04:34
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/network In directory sc8-pr-cvs1:/tmp/cvs-serv24409/src/server/network Log Message: Directory /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/network added to the repository |
From: <ma...@us...> - 2003-12-25 14:25:48
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv13701 Modified Files: MainDlg.cpp Log Message: Fixes unicode compatibility. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- MainDlg.cpp 25 Dec 2003 02:27:48 -0000 1.38 +++ MainDlg.cpp 25 Dec 2003 14:25:45 -0000 1.39 @@ -998,9 +998,8 @@ return; } wxLogDebug( - wxT("%s,%d: Adding page `%s` with title `%s`, image `%s`."), - wxString(__FILE__).c_str(), __LINE__, short_title.c_str(), - long_title.c_str(), image.c_str() + wxT("Adding page `%s` with title `%s`, image `%s`."), + short_title.c_str(), long_title.c_str(), image.c_str() ); Page *newpage = new Page; newpage->content = page; |
From: <ma...@us...> - 2003-12-25 07:22:13
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv30964 Modified Files: ServerWnd.cpp Log Message: Minor spacing fix Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- ServerWnd.cpp 22 Dec 2003 10:45:32 -0000 1.50 +++ ServerWnd.cpp 25 Dec 2003 07:22:10 -0000 1.51 @@ -182,7 +182,11 @@ sbmain->SetSizeHints(sidebar); /* Add the sidebar to mainsizer. */ +#ifdef __WXMSW__ mainsizer->Add(sidebar, 0, wxGROW|wxADJUST_MINSIZE, 5); +#else + mainsizer->Add(sidebar, 0, wxGROW|wxADJUST_MINSIZE|wxTOP, 5); +#endif /* Sidebar sections */ CSBPanel *addserver = new CSBPanel( @@ -325,7 +329,7 @@ /* Split the window and add to sizer */ splatter->SplitHorizontally( top_panel, bottom_panel, horizontal_splitter_pos); - mainsizer->Add(splatter, 0, wxGROW, 0 ); + mainsizer->Add(splatter, 0, wxGROW|wxTOP, 5 ); this->SetAutoLayout( TRUE ); this->SetSizer( mainsizer ); |
From: <ma...@us...> - 2003-12-25 07:02:58
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv29017 Modified Files: SBPanel.cpp Log Message: YEAH! Finally fixed bitmapbutton sizing issues!!!! Index: SBPanel.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SBPanel.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- SBPanel.cpp 25 Dec 2003 05:36:39 -0000 1.14 +++ SBPanel.cpp 25 Dec 2003 07:02:56 -0000 1.15 @@ -66,7 +66,7 @@ wxFont(SB_BTN_FONT_SIZE, wxROMAN, wxNORMAL, wxBOLD) ); header_btn_id = headerbmpbtn->GetId(); - mainsizer->Add(headerbmpbtn, 0, wxGROW|wxADJUST_MINSIZE, 5); + mainsizer->Add(headerbmpbtn, 0, wxGROW); } else { wxButton *headerbtn = new wxButton( this, -1, title, wxDefaultPosition, wxDefaultSize, 0 |
From: <ma...@us...> - 2003-12-25 05:36:42
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv20226 Modified Files: SBPanel.cpp Log Message: Should fix Sidebar panel toggling layout issues. Index: SBPanel.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SBPanel.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- SBPanel.cpp 24 Dec 2003 07:36:46 -0000 1.13 +++ SBPanel.cpp 25 Dec 2003 05:36:39 -0000 1.14 @@ -116,9 +116,7 @@ mainsizer->Show(content); shown = true; } - GetParent()->Fit(); - GetParent()->GetParent()->Fit(); - wxGetTopLevelParent(this)->Layout(); + GetParent()->Layout(); } /** |
From: <ma...@us...> - 2003-12-25 03:12:37
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv4500 Modified Files: Changelog Log Message: osx fixes Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- Changelog 23 Dec 2003 23:38:25 -0000 1.113 +++ Changelog 25 Dec 2003 03:12:34 -0000 1.114 @@ -25,6 +25,9 @@ # This also helps in backtracking changes, or reviewing development history. # ############################################################################### +2003/12/25 Alo Sarv + * Various Mac OS related fixes by Xavi. + 2003/12/24 Alo Sarv * French translation by Nicolas Lussier. |
From: <ma...@us...> - 2003-12-25 02:27:51
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv31331 Modified Files: GUISettingsDlg.cpp MainDlg.cpp Log Message: Fixes windows registry access problems. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- GUISettingsDlg.cpp 19 Dec 2003 23:50:11 -0000 1.29 +++ GUISettingsDlg.cpp 25 Dec 2003 02:27:48 -0000 1.30 @@ -92,7 +92,7 @@ m_config->Read(wxT("Show ToolBar"), &show_toolbar, true); m_config->Read(wxT("Toolbar Alignment"), &tool_align, wxTB_HORIZONTAL); m_config->Read(wxT("Show MenuBar"), &show_menubar, false); - m_config->Read(wxT("Start Page"), &startpage, wxT("Servers")); + m_config->Read(wxT("StartPage"), &startpage, wxT("Servers")); m_config->Read(wxT("Remember last"), &remember_last, true); /* Load iconset data */ @@ -195,7 +195,7 @@ m_config->Write(wxT("Toolbar Alignment"), tool_align); m_config->Write(wxT("Show MenuBar"), GetShowMenu()->GetValue()); m_config->Write( - wxT("Start Page"), GetStartPage()->GetStringSelection() + wxT("StartPage"), GetStartPage()->GetStringSelection() ); m_config->Write(wxT("Remember last"), GetRememberLast()->GetValue()); Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- MainDlg.cpp 24 Dec 2003 07:37:26 -0000 1.37 +++ MainDlg.cpp 25 Dec 2003 02:27:48 -0000 1.38 @@ -209,7 +209,7 @@ m_config->SetPath(wxT("/General")); m_config->Read(wxT("Remember last"), &remember_last, true); if (remember_last && !pages.IsEmpty()) { - m_config->Write(wxT("Start Page"), GetCurPage()->short_title); + m_config->Write(wxT("StartPage"), GetCurPage()->short_title); } #ifdef wxHAS_TASK_BAR_ICON @@ -471,7 +471,7 @@ wxT("btn_statistics"), ID_STATISTICSWND ); - m_config->Read(wxT("/General/Start Page"), &start_page, wxT("Servers")); + m_config->Read(wxT("/General/StartPage"), &start_page, wxT("Servers")); SetActivePage(start_page); /* Error-checking is done there */ } |
From: <ma...@us...> - 2003-12-25 02:19:00
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv30385 Modified Files: Images.cpp Images.h MBitmapButton.cpp MBitmapButton.h Log Message: Hopefully fixed wxMac issues reported by Xavi Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Images.cpp 22 Dec 2003 21:54:16 -0000 1.42 +++ Images.cpp 25 Dec 2003 02:18:57 -0000 1.43 @@ -295,19 +295,18 @@ tmp_new = wxBitmap(tool_img_width, tool_img_height); mdc.SelectObject(tmp_new); - mdc.SetTextForeground(wxColour(10, 10, 10)); #ifdef __WXMAC__ - mdc.SetFont(wxFont(10, wxDEFAULT, wxNORMAL, wxNORMAL)); + mdc.SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT)); #else mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); #endif + mdc.SetPen(*wxTRANSPARENT_PEN); mdc.BeginDrawing(); #ifdef __WXMSW__ /* This gives transparent image on wxMSW */ - mdc.SetPen(*wxTRANSPARENT_PEN); - mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); + mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); #else /* Elsewhere, it will be done with wxMask later */ - mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); + mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); #endif mdc.DrawRectangle( 0, 0, tmp_new.GetWidth(), tmp_new.GetHeight() @@ -316,11 +315,11 @@ GetImage(image), (tmp_new.GetWidth()-32)/2, 2, true ); - mdc.SetTextForeground(wxColour(1,1,1)); + mdc.SetTextForeground(wxColour(50, 50, 50)); mdc.GetTextExtent(name, &x, &y); mdc.DrawText(name, (tmp_new.GetWidth()-x)/2, 36); #ifndef __WXMSW__ /* Use wxMask for transparency */ - wxMask *tmp_mask; + wxMask *tmp_mask; tmp_mask = new wxMask(tmp_new, wxColour(0,0,0)); tmp_new.SetMask(tmp_mask); #endif Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Images.h 22 Dec 2003 01:55:10 -0000 1.19 +++ Images.h 25 Dec 2003 02:18:57 -0000 1.20 @@ -44,7 +44,7 @@ void UpdateImages(wxWindow *parent); void CalcToolBitmapSize(const wxArrayString &names); private: - ListOfBitmaps images; + ListOfBitmaps images; wxString MakePath(); }; Index: MBitmapButton.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MBitmapButton.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MBitmapButton.cpp 24 Dec 2003 07:34:10 -0000 1.7 +++ MBitmapButton.cpp 25 Dec 2003 02:18:57 -0000 1.8 @@ -114,7 +114,7 @@ wxBitmap *tmp; wxCoord x, y; mdc.SelectObject(wxBitmap(100, 100)); - mdc.SetFont(wxFont(BTN_FONT_SIZE, wxDEFAULT, wxNORMAL, wxNORMAL)); + mdc.SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT)); mdc.GetTextExtent(name, &x, &y); x+=image.GetWidth()+LABEL_WIDTH_ADDITION; @@ -123,9 +123,8 @@ tmp = new wxBitmap(x, y); mdc.SelectObject(*tmp); - -#ifdef __WXMSW__ /* This gives transparent image on wxMSW */ mdc.SetPen(*wxTRANSPARENT_PEN); +#ifdef __WXMSW__ /* This gives transparent image on wxMSW */ mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); #else /* Elsewhere, it will be done with wxMask later */ mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); @@ -136,7 +135,7 @@ image, 5, ((y-image.GetHeight())/2)+BITMAP_Y_POS_OFFSET, true ); - mdc.SetTextForeground(wxColour(1, 1, 1)); + mdc.SetTextForeground(wxColour(50, 50, 50)); mdc.DrawText( name, image.GetWidth()+10, ((tmp->GetHeight()-GetCharHeight())/2)+TEXT_Y_POS_OFFSET Index: MBitmapButton.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MBitmapButton.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MBitmapButton.h 24 Dec 2003 10:07:46 -0000 1.5 +++ MBitmapButton.h 25 Dec 2003 02:18:57 -0000 1.6 @@ -29,19 +29,39 @@ #endif /* Image/Text positioning/sizing constants */ -#if defined(__WXGTK__) && defined(__GTK2__) - #define BTN_FONT_SIZE 10 /* Button font size */ - #define LABEL_WIDTH_ADDITION 40 /* Extra width */ - #define BITMAP_Y_POS_OFFSET -2 /* Image Y positioning offset */ - #define TEXT_Y_POS_OFFSET -5 /* Text Y positioning offset */ - #define LABEL_POS_OFFSET -10 /* Pixels between image/button borders */ -#elif defined(__WXGTK__) && !defined(__GTK2__) - #define LABEL_WIDTH_ADDITION 10 /* Extra width */ - #define BITMAP_Y_POS_OFFSET 0 /* Text Y positioning offset */ - #define TEXT_Y_POS_OFFSET 0 /* Text Y positioning offset */ - #define LABEL_POS_OFFSET -8 /* Pixels between image/button borders */ - #define BTN_FONT_SIZE 12 /* Button font size */ -#elif !defined (__WXMSW__) +/* These constants adjust the positioning and sizing of this buttons bitmap */ +/* label. Since all platforms have different "base" button sizes/borders etc, */ +/* we define these constants here. */ +/* BTN_FONT_SIZE - The size of the font to be used on Button. */ +/* LABEL_WIDTH_ADDITON - Extra empty space added to image label */ +/* BITMAP_Y_POS_OFFSET - Needed for correctly centering the bitmap on button */ +/* TEXT_Y_POS_OFFSET - Needed for correctly centering the text on the button */ +/* LABEL_POS_OFFSET - Spacing between bitmap label and button border */ +#if defined(__WXGTK__) && defined(__GTK2__) /* wxGTK with GTK 2.0 */ + #define BTN_FONT_SIZE 10 + #define LABEL_WIDTH_ADDITION 40 + #define BITMAP_Y_POS_OFFSET -2 + #define TEXT_Y_POS_OFFSET -5 + #define LABEL_POS_OFFSET -10 +#elif defined(__WXGTK__) && !defined(__GTK2__) /* wxGTK with GTK 1.2 */ + #define LABEL_WIDTH_ADDITION 10 + #define BITMAP_Y_POS_OFFSET 0 + #define TEXT_Y_POS_OFFSET 0 + #define LABEL_POS_OFFSET -6 + #define BTN_FONT_SIZE 12 +#elif defined(__WXMAC__) /* wxMac */ + #define LABEL_WIDTH_ADDITION 40 + #define BITMAP_Y_POS_OFFSET 0 + #define TEXT_Y_POS_OFFSET 0 + #define LABEL_POS_OFFSET -5 + #define BTN_FONT_SIZE 10 +#elif defined(__WXMSW__) /* wxMSW */ + #define LABEL_WIDTH_ADDITION 10 + #define BITMAP_Y_POS_OFFSET 0 + #define TEXT_Y_POS_OFFSET 0 + #define LABEL_POS_OFFSET -6 + #define BTN_FONT_SIZE 12 +#else #error Need MBitmapButton constants for your port. #endif |
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv9609 Modified Files: Makefile.bsd AUTHORS Makefile.osx Makefile.win TODO Makefile.lin ChangeLog README INSTALL Log Message: 24/12/2003 Barbeaux * Added simple test program for Semaphores. Index: Makefile.bsd =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.bsd,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.bsd 24 Dec 2003 13:09:42 -0000 1.3 +++ Makefile.bsd 24 Dec 2003 14:10:32 -0000 1.4 @@ -6,7 +6,7 @@ ###################################################### # Your flags from the C++ compiler -CCFLAGS = -O3 -march=athlon-xp +CCFLAGS = -O3 # Do you want debugging ? #CCFLAGS += -D_DEBUG_INFO_ @@ -34,6 +34,7 @@ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ + src/test/TestSemaphore.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: AUTHORS =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AUTHORS 24 Dec 2003 10:49:48 -0000 1.1 +++ AUTHORS 24 Dec 2003 14:10:32 -0000 1.2 @@ -1,6 +1,7 @@ ShareDaemon Standard webInterface Authors +-------------------------------------------- Original code author: Mikael Barbeaux <mik...@us...> Index: Makefile.osx =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.osx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.osx 24 Dec 2003 13:09:42 -0000 1.3 +++ Makefile.osx 24 Dec 2003 14:10:32 -0000 1.4 @@ -6,7 +6,7 @@ ###################################################### # Your flags from the C++ compiler -CCFLAGS = -O3 -march=athlon-xp +CCFLAGS = -O3 # Do you want debugging ? #CCFLAGS += -D_DEBUG_INFO_ @@ -34,6 +34,7 @@ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ + src/test/TestSemaphore.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: Makefile.win =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.win,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.win 24 Dec 2003 13:09:42 -0000 1.3 +++ Makefile.win 24 Dec 2003 14:10:32 -0000 1.4 @@ -9,7 +9,7 @@ MINGW_DIR = G:/Dev-Cpp # Your flags from the C++ compiler -CCFLAGS = -O3 -march=athlon-xp +CCFLAGS = -O3 # Do you want debugging ? #CCFLAGS += -D_DEBUG_INFO_ @@ -40,6 +40,7 @@ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ + src/test/TestSemaphore.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: TODO =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 24 Dec 2003 10:49:48 -0000 1.1 +++ TODO 24 Dec 2003 14:10:32 -0000 1.2 @@ -1 +1 @@ - +... Index: Makefile.lin =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/Makefile.lin,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.lin 24 Dec 2003 13:09:42 -0000 1.3 +++ Makefile.lin 24 Dec 2003 14:10:32 -0000 1.4 @@ -6,7 +6,7 @@ # Your flags from the C++ compiler -CCFLAGS = -O3 -march=athlon-xp +CCFLAGS = -O3 # Do you want debugging ? #CCFLAGS += -D_DEBUG_INFO_ @@ -32,6 +32,7 @@ src/test/TestHandler.o \ src/test/TestException.o \ src/test/TestThread.o \ + src/test/TestSemaphore.o \ src/thread/Mutex.o \ src/thread/Condition.o \ src/thread/Semaphore.o \ Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ChangeLog 24 Dec 2003 13:09:42 -0000 1.4 +++ ChangeLog 24 Dec 2003 14:10:32 -0000 1.5 @@ -24,6 +24,7 @@ ----------------------------------------------------------- 24/12/2003 Barbeaux + * Added simple test program for Semaphores. * Updated Makefiles for Win32, Linux and MacOS X * Added simple test programs for Exceptions and Threads. * Implemented Semaphore and Thread. Index: README =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 24 Dec 2003 10:49:48 -0000 1.1 +++ README 24 Dec 2003 14:10:32 -0000 1.2 @@ -0,0 +1 @@ +Nothing yet... \ No newline at end of file Index: INSTALL =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/INSTALL,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- INSTALL 24 Dec 2003 10:49:48 -0000 1.1 +++ INSTALL 24 Dec 2003 14:10:32 -0000 1.2 @@ -1,3 +1,51 @@ INSTALLATION NOTES +Lastest revision : 24/12/2003 + + +This version is an early alpha. Compilation has been tester under Win32 ( MinGW +and Cygwin ) and Linux, but should also work on FreeBSD and MacOS X ( Cocoa ). +Use the specific plateform Makefiles from compiling the sources, eg : + + Makefile.lin : Makefile for Linux / Unix plateforms and win32 Cygwin + Makefile.win : Makefile for win32 MinGW + Makefile.bsd : Makefile for FreeBSD + Makefile.osx : Makefile for MacOS X (Cocoa). + +1) Compiling from sources + + Download the lastest sources package ( or retrieve sources from + CVS ). Then, go into the directory where your downloaded ( and + unzipped ) the sources and type, depending your plateform : + + $> make -f Makefile.lin # if you are on Linux + $> make -f Makefile.win # if you are on win32 MinGW + + Then, to start the program, simply type, depending your plateform : + + $> ./ui-web # if you are on Linux + $> ui-web.exe # if you are on Windows + + +Dependencies : + + To compile the sources, you need to have a C++ compiler installed on + your box. If you don't have a compiler and don't want to install one, then + try the binaries on http://sharedaemon.sourceforge.net ! + + If you are under Linux / FreeBSD / MacOS X, you need to have the GCC + compiler ( lastest version if possible ) with the C++ standard library + installed ( typically they are packaged together ). + If you are under Windows, you have the choice between using Cygwin + ( a Linux shell emulator ) or MinGW. I recommand that you use MinGW, + because Cygwin binaries are often built with dependencies, whereas + MinGW binaries aren't. Moreother, MinGW are much more stable than + Cygwin ones. + + GCC : http://gcc.gnu.org/ + MinGW : http://www.mingw.org + Cygwin : http://www.cygwin.com + + +MikaelB |