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: <ma...@us...> - 2003-11-28 18:35:15
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv2713 Modified Files: ServerWnd.cpp Log Message: Minor layout fix Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- ServerWnd.cpp 27 Nov 2003 08:23:12 -0000 1.41 +++ ServerWnd.cpp 28 Nov 2003 18:35:10 -0000 1.42 @@ -196,7 +196,7 @@ sbmain->SetSizeHints(sidebar); /* Add the sidebar to mainsizer. */ - mainsizer->Add(sidebar, 0, wxGROW|wxTOP|wxBOTTOM|wxADJUST_MINSIZE, 5); + mainsizer->Add(sidebar, 0, wxGROW|wxTOP|wxBOTTOM|wxADJUST_MINSIZE, 0); /** * Create new CSBPanel object which provides framework for @@ -210,7 +210,13 @@ wxPanel *addserver_cnt = new wxPanel(addserver, -1); AddServerPanel(addserver_cnt); addserver->SetContent(addserver_cnt); - sbmain->Add(addserver, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); + + /* Need to use border 0 on wxMSW to have correct layout */ + #ifdef __WXMSW__ + sbmain->Add(addserver, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); + #else + sbmain->Add(addserver, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 5); + #endif CSBPanel *updatelist = new CSBPanel( sidebar, -1, _("Update from URL"), wxT("SideBar_UpdateServer") |
From: <ma...@us...> - 2003-11-28 17:42:28
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv26077 Modified Files: Images.cpp Log Message: Toolbar images generation now works on wxMSW and wxGTK. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Images.cpp 27 Nov 2003 15:21:29 -0000 1.26 +++ Images.cpp 28 Nov 2003 17:42:25 -0000 1.27 @@ -153,7 +153,6 @@ */ void CImages::MakeToolImages() { wxBitmap tmp, tmp_new; - wxMask *tmp_mask; wxMemoryDC mdc; wxCoord x, y, width = 0, height = 0; wxArrayString btntxt, btnimg; @@ -194,26 +193,33 @@ tool_img_width = width; tool_img_height = height; - wxString background; - m_config->Read(wxT("/General/ToolButtonBackground"), &background, wxT("LIGHT BLUE")); - m_config->Write(wxT("/General/ToolButtonBackground"), background); - mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); - + mdc.BeginDrawing(); /* Loop through our lists of texts/images and draw images for toolbar */ for (unsigned int i=0;i<btntxt.GetCount();i++) { tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); - mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); + /* On wxMSW, wxLIGHT_GREY colour pointer gives system background colour */ + #ifdef __WXMSW__ + mdc.SetPen(*wxTRANSPARENT_PEN); + mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); + /* Elsewhere 0,0,0 colour works for background */ + #else + mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); + #endif mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); mdc.DrawBitmap(GetImage(btnimg.Item(i)), (tmp_new.GetWidth()-32)/2, 2, true); mdc.SetTextForeground( wxColour(1,1,1)); mdc.GetTextExtent(btntxt.Item(i), &x, &y); mdc.DrawText(btntxt.Item(i), (tmp_new.GetWidth()-x)/2, 36); - tmp_mask = new wxMask(tmp_new, wxColour(0,0,0)); - tmp_new.SetMask(tmp_mask); + /* Can't (and dont need to) use transparency mask on wxMSW */ + #ifndef __WXMSW__ + wxMask *tmp_mask; + tmp_mask = new wxMask(tmp_new, wxColour(0,0,0)); + tmp_new.SetMask(tmp_mask); + #endif GetImage(btnimg.Item(i)) = tmp_new; } + mdc.EndDrawing(); } /** |
From: <ma...@us...> - 2003-11-27 15:43:16
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv22053 Modified Files: Makefile.win Log Message: removed statusbar from objects, no longer used Index: Makefile.win =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile.win,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Makefile.win 23 Nov 2003 20:16:43 -0000 1.24 +++ Makefile.win 27 Nov 2003 15:43:13 -0000 1.25 @@ -1,84 +1,83 @@ -# +++ Configuration settings section +++ - -# WXCONFIG should point to your wx-config file (usually at /usr/local/bin) -WXCONFIG = wx-config - -# Don't modify these - automatically generated from WXCONFIG -CXX = $(shell $(WXCONFIG) --cxx) -CXX_FLAGS = $(shell $(WXCONFIG) --cxxflags) -LIBS = $(shell $(WXCONFIG) --libs) - -# Normal CPP flags -#CPP_FLAGS = -O2 -pipe -I. -c -Wall - -# Debugging CPP flags -DEBUG_FLAGS = -ggdb -pipe -I. -c -g -ggdb -Wall - -# Only needed on Win32 - Location of windres.exe file -WINDRES = windres.exe - -# Any extra include directives needed -INCLUDE_DIR = /local/include - -# Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, -# which should only be enabled if you have patched wxWindows with sizer.patch -DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ - -# Final binary name -PROGRAM = wxInterface - -# +++ Objects section +++ -# Objects list. If new files are added to source tree, add them here also. -OBJECTS = ColorFrameCtrl.o \ - DownloadListCtrl.o \ - GUISettingsDlg.o \ - Images.o \ - KnownListCtrl.o \ - MainDlg.o \ - MessagesWnd.o \ - MListCtrl.o \ - QueueListCtrl.o \ - SBPanel.o \ - SearchListCtrl.o \ - SearchWnd.o \ - ServerListCtrl.o \ - ServerWnd.o \ - SharedFilesListCtrl.o \ - SharedFilesWnd.o \ - StatisticsWnd.o \ - StatisticsTreeCtrl.o \ - StatusBar.o \ - SysTray.o \ - TransferWnd.o \ - UploadListCtrl.o \ - wxInterface.o \ - wxInterface_wdr.o \ - wxInterface_private.res -# wxInterface_private.res is needed only on win32 platform. Comment out -# on all other platforms. - -# File suffixes -.SUFFIXES: .o .cpp .rc .res - -# +++ Compilation/linking commands section +++ -# Compile commands. To make DEBUG build, add $(DEBUG_FLAGS) flag to this command. -.cpp.o : - @echo "Compiling $< to $@..."; - @$(CXX) $(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< -.rc.res: - @echo "Running windres..."; - @windres -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) - -# Linking command -$(PROGRAM): $(OBJECTS) - @echo "Linking wxInterface..."; - @$(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) - -# +++ Building section +++ -# All builds program with default settings. -all: $(PROGRAM) - -# Cleanup command -clean: - @echo "Cleaning up..."; - @rm -f $(OBJECTS) $(PROGRAM) +# +++ Configuration settings section +++ + +# WXCONFIG should point to your wx-config file (usually at /usr/local/bin) +WXCONFIG = wx-config + +# Don't modify these - automatically generated from WXCONFIG +CXX = $(shell $(WXCONFIG) --cxx) +CXX_FLAGS = $(shell $(WXCONFIG) --cxxflags) +LIBS = $(shell $(WXCONFIG) --libs) + +# Normal CPP flags +#CPP_FLAGS = -O2 -pipe -I. -c -Wall + +# Debugging CPP flags +DEBUG_FLAGS = -ggdb -pipe -I. -c -g -ggdb -Wall + +# Only needed on Win32 - Location of windres.exe file +WINDRES = windres.exe + +# Any extra include directives needed +INCLUDE_DIR = /local/include + +# Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, +# which should only be enabled if you have patched wxWindows with sizer.patch +DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ + +# Final binary name +PROGRAM = wxInterface + +# +++ Objects section +++ +# Objects list. If new files are added to source tree, add them here also. +OBJECTS = ColorFrameCtrl.o \ + DownloadListCtrl.o \ + GUISettingsDlg.o \ + Images.o \ + KnownListCtrl.o \ + MainDlg.o \ + MessagesWnd.o \ + MListCtrl.o \ + QueueListCtrl.o \ + SBPanel.o \ + SearchListCtrl.o \ + SearchWnd.o \ + ServerListCtrl.o \ + ServerWnd.o \ + SharedFilesListCtrl.o \ + SharedFilesWnd.o \ + StatisticsWnd.o \ + StatisticsTreeCtrl.o \ + SysTray.o \ + TransferWnd.o \ + UploadListCtrl.o \ + wxInterface.o \ + wxInterface_wdr.o \ + wxInterface_private.res +# wxInterface_private.res is needed only on win32 platform. Comment out +# on all other platforms. + +# File suffixes +.SUFFIXES: .o .cpp .rc .res + +# +++ Compilation/linking commands section +++ +# Compile commands. To make DEBUG build, add $(DEBUG_FLAGS) flag to this command. +.cpp.o : + @echo "Compiling $< to $@..."; + @$(CXX) $(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< +.rc.res: + @echo "Running windres..."; + @windres -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) + +# Linking command +$(PROGRAM): $(OBJECTS) + @echo "Linking wxInterface..."; + @$(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) + +# +++ Building section +++ +# All builds program with default settings. +all: $(PROGRAM) + +# Cleanup command +clean: + @echo "Cleaning up..."; + @rm -f $(OBJECTS) $(PROGRAM) |
From: <ma...@us...> - 2003-11-27 15:21:32
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv18402 Modified Files: Images.cpp Log Message: Tbar buttons are now transparent on wxX11 and wxGTK (thanks Sebastien). Also cleaned up drawing code into one forloop. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Images.cpp 27 Nov 2003 13:52:51 -0000 1.25 +++ Images.cpp 27 Nov 2003 15:21:29 -0000 1.26 @@ -153,19 +153,28 @@ */ void CImages::MakeToolImages() { wxBitmap tmp, tmp_new; + wxMask *tmp_mask; wxMemoryDC mdc; wxCoord x, y, width = 0, height = 0; - wxArrayString btntxt; + wxArrayString btntxt, btnimg; /* List of button names */ btntxt.Add(_("Connect")); + btnimg.Add(wxT("btn_connect")); btntxt.Add(_("Servers")); + btnimg.Add(wxT("btn_servers")); btntxt.Add(_("Search")); + btnimg.Add(wxT("btn_search")); btntxt.Add(_("Transfer")); + btnimg.Add(wxT("btn_transfer")); btntxt.Add(_("Shared Files")); + btnimg.Add(wxT("btn_shared")); btntxt.Add(_("Messaging")); + btnimg.Add(wxT("btn_messages")); btntxt.Add(_("Statistics")); + btnimg.Add(wxT("btn_statistics")); btntxt.Add(_("Preferences")); + btnimg.Add(wxT("btn_guisettings")); /* Temporary bitmap for measuring text lengths. 100 pixels should be enuff. */ tmp = wxBitmap(100, 100); @@ -190,70 +199,21 @@ m_config->Write(wxT("/General/ToolButtonBackground"), background); mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_connect")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(0), &x, &y); - mdc.DrawText(btntxt.Item(0), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_connect")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_servers")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(1), &x, &y); - mdc.DrawText(btntxt.Item(1), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_servers")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_search")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(2), &x, &y); - mdc.DrawText(btntxt.Item(2), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_search"))= tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_transfer")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(3), &x, &y); - mdc.DrawText(btntxt.Item(3), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_transfer")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_shared")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(4), &x, &y); - mdc.DrawText(btntxt.Item(4), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_shared")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_messages")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(5), &x, &y); - mdc.DrawText(btntxt.Item(5), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_messages")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_statistics")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(6), &x, &y); - mdc.DrawText(btntxt.Item(6), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_statistics")) = tmp_new; - - tmp_new = wxBitmap(width, height); - mdc.SelectObject(tmp_new); - mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(GetImage(wxT("btn_guisettings")), (tmp_new.GetWidth()-32)/2, 2, true); - mdc.GetTextExtent(btntxt.Item(7), &x, &y); - mdc.DrawText(btntxt.Item(7), (tmp_new.GetWidth()-x)/2, 36); - GetImage(wxT("btn_guisettings")) = tmp_new; - + /* Loop through our lists of texts/images and draw images for toolbar */ + for (unsigned int i=0;i<btntxt.GetCount();i++) { + tmp_new = wxBitmap(width, height); + mdc.SelectObject(tmp_new); + mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); + mdc.DrawBitmap(GetImage(btnimg.Item(i)), (tmp_new.GetWidth()-32)/2, 2, true); + mdc.SetTextForeground( wxColour(1,1,1)); + mdc.GetTextExtent(btntxt.Item(i), &x, &y); + mdc.DrawText(btntxt.Item(i), (tmp_new.GetWidth()-x)/2, 36); + tmp_mask = new wxMask(tmp_new, wxColour(0,0,0)); + tmp_new.SetMask(tmp_mask); + GetImage(btnimg.Item(i)) = tmp_new; + } } /** |
From: <ma...@us...> - 2003-11-27 14:00:38
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv4603 Modified Files: Changelog Log Message: Some improvements Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- Changelog 24 Nov 2003 16:07:19 -0000 1.98 +++ Changelog 27 Nov 2003 14:00:34 -0000 1.99 @@ -20,6 +20,11 @@ # ALWAYS keep line lenghts UNDER/AT 80 characters. # ############################################################################### +2003/11/27 Alo Sarv + * Images class rewritten to provide dynamic reloading and name-based + lookup functionality. + * Iconset can now be changed on runtime. + 2003/11/24 Alo Sarv * New splashscreen by Avi Vahl. * New statusbar that works and looks the same on all platforms. |
From: <ma...@us...> - 2003-11-27 13:52:54
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv3307 Modified Files: Images.cpp Images.h MainDlg.cpp Log Message: toolimage height is also now stored globally accessibly Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Images.cpp 27 Nov 2003 12:54:27 -0000 1.24 +++ Images.cpp 27 Nov 2003 13:52:51 -0000 1.25 @@ -178,10 +178,12 @@ width = x; } } - tool_img_width = width+6; - + /* local storage */ width = width+6; height = y+38; + /* global, for accessing from outside */ + tool_img_width = width; + tool_img_height = height; wxString background; m_config->Read(wxT("/General/ToolButtonBackground"), &background, wxT("LIGHT BLUE")); Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Images.h 27 Nov 2003 08:23:11 -0000 1.14 +++ Images.h 27 Nov 2003 13:52:51 -0000 1.15 @@ -38,7 +38,7 @@ CImages(); virtual ~CImages(); void MakeToolImages(); - int tool_img_width; + int tool_img_width, tool_img_height; void LoadImages(); wxBitmap& GetImage(const wxString &name); void UpdateImages(wxWindow *parent); Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MainDlg.cpp 27 Nov 2003 13:43:43 -0000 1.16 +++ MainDlg.cpp 27 Nov 2003 13:52:51 -0000 1.17 @@ -242,7 +242,7 @@ /* Generate toolbar images */ img->MakeToolImages(); - tb->SetToolBitmapSize(wxSize(img->tool_img_width, 52)); + tb->SetToolBitmapSize(wxSize(img->tool_img_width, img->tool_img_height)); tb->SetMargins(2, 2); /* Add the buttons */ |
From: <ma...@us...> - 2003-11-27 13:43:46
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1953 Modified Files: MainDlg.cpp Log Message: Create toolbar/menubar as first thing on startup, perhaps THIS fixes `toolbar missing on startup on mac` bug?! Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- MainDlg.cpp 27 Nov 2003 10:01:54 -0000 1.15 +++ MainDlg.cpp 27 Nov 2003 13:43:43 -0000 1.16 @@ -63,6 +63,12 @@ int height, width, posx, posy; start_up = true; + /** + * Create toolbar and menubar + */ + CreateMyToolBar(); + CreateMyMenuBar(); + /* Set application icon */ wxIcon icon; icon.CopyFromBitmap(img->GetImage(wxT("mule"))); @@ -112,13 +118,8 @@ /* Load dialog pages */ LoadAndShowDialogPages(); - /** - * Toolbar and Menubar must be created AFTER loading dialog pages, - * since they do calls to GetCurPage() which results in crash - * if pages haven't been loaded yet. - */ - CreateMyToolBar(); - CreateMyMenuBar(); + UpdateToolButtons(); + UpdateMenuBar(); } /* @@ -283,31 +284,8 @@ tb->Realize(); SetToolBar(tb); tb->Refresh(); - - /** - * Last, but not least, we tell the toolbar which button should - * initially toggled. - */ - if (activewnd == serverwnd) { - tb->ToggleTool(ID_BTN_SERVERS, true); - } - if (activewnd == searchwnd) { - tb->ToggleTool(ID_BTN_SEARCH, true); - } - if (activewnd == transferwnd) { - tb->ToggleTool(ID_BTN_TRANSFER, true); - } - if (activewnd == sharedfileswnd) { - tb->ToggleTool(ID_BTN_SHARED_FILES, true); - } - if (activewnd == messageswnd) { - tb->ToggleTool(ID_BTN_MESSAGES, true); - } - if (activewnd == statisticswnd) { - tb->ToggleTool(ID_BTN_STATISTICS, true); - } - Layout(); + UpdateToolButtons(); } /** @@ -468,6 +446,7 @@ menubar->Append(help_menu, _("Help")); SetMenuBar(menubar); + UpdateMenuBar(); } /** |
From: <ma...@us...> - 2003-11-27 12:54:30
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv26857 Modified Files: Images.cpp Log Message: Fixes text length calculation on mac (thanks Sebastien) Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Images.cpp 27 Nov 2003 10:21:40 -0000 1.23 +++ Images.cpp 27 Nov 2003 12:54:27 -0000 1.24 @@ -170,6 +170,8 @@ /* Temporary bitmap for measuring text lengths. 100 pixels should be enuff. */ tmp = wxBitmap(100, 100); mdc.SelectObject(tmp); + + mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); for (unsigned int i=0;i<btntxt.GetCount();i++) { mdc.GetTextExtent(btntxt.Item(i), &x, &y); if (x > width) { @@ -179,13 +181,12 @@ tool_img_width = width+6; width = width+6; - height = y+36; + height = y+38; wxString background; - m_config->Read(wxT("/General/ToolButtonBackground"), &background, wxT("WHEAT")); + m_config->Read(wxT("/General/ToolButtonBackground"), &background, wxT("LIGHT BLUE")); m_config->Write(wxT("/General/ToolButtonBackground"), background); mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); - mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); |
From: <ma...@us...> - 2003-11-27 10:21:45
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv5503 Modified Files: Images.cpp Log Message: Use colour from config file for toolbar button background Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Images.cpp 27 Nov 2003 10:01:54 -0000 1.22 +++ Images.cpp 27 Nov 2003 10:21:40 -0000 1.23 @@ -181,7 +181,10 @@ width = width+6; height = y+36; - mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(wxT("WHEAT")), wxSOLID)); + wxString background; + m_config->Read(wxT("/General/ToolButtonBackground"), &background, wxT("WHEAT")); + m_config->Write(wxT("/General/ToolButtonBackground"), background); + mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(background), wxSOLID)); mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); tmp_new = wxBitmap(width, height); |
From: <ma...@us...> - 2003-11-27 10:01:58
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1586 Modified Files: Images.cpp MainDlg.cpp Log Message: All image formats are now supported (filenames hardcoded still tho), toolbar background colour hardcoded to `WHEAT`, font to wxDECORATIVE (both will be userconfigurable later). Using same toolbar code on all platforms now. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Images.cpp 27 Nov 2003 08:23:11 -0000 1.21 +++ Images.cpp 27 Nov 2003 10:01:54 -0000 1.22 @@ -98,48 +98,48 @@ path.Prepend(wxT("::Resources")); #endif - images.Append(wxT("friend"), new wxBitmap(path+wxT("friend.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("messages"), new wxBitmap(path+wxT("messages.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("searchresults"), new wxBitmap(path+wxT("searchresults.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("provider"), new wxBitmap(path+wxT("provider.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("serverlist"), new wxBitmap(path+wxT("serverlist.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("newserver"), new wxBitmap(path+wxT("newserver.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("updateservers"), new wxBitmap(path+wxT("updateservers.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("info"), new wxBitmap(path+wxT("info.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("serverinfo"), new wxBitmap(path+wxT("serverinfo.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("log"), new wxBitmap(path+wxT("log.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("sharedfiles"), new wxBitmap(path+wxT("sharedfiles.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("updown11"), new wxBitmap(path+wxT("updown11.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("updown00"), new wxBitmap(path+wxT("updown00.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("connectedhigh"), new wxBitmap(path+wxT("connectedhigh.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("disconnected"), new wxBitmap(path+wxT("disconnected.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("clock"), new wxBitmap(path+wxT("clock.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("user"), new wxBitmap(path+wxT("user.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("server"), new wxBitmap(path+wxT("server.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("arrow"), new wxBitmap(path+wxT("arrow.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("statistics"), new wxBitmap(path+wxT("statistics.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("upload"), new wxBitmap(path+wxT("upload.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("download"), new wxBitmap(path+wxT("download.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("partstats"), new wxBitmap(path+wxT("partstats.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("fullstats"), new wxBitmap(path+wxT("fullstats.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("exclamation"), new wxBitmap(path+wxT("exclamation.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("connection"), new wxBitmap(path+wxT("connection.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("daily"), new wxBitmap(path+wxT("daily.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("monthly"), new wxBitmap(path+wxT("monthly.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("yearly"), new wxBitmap(path+wxT("yearly.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("mule"), new wxBitmap(path+wxT("mule.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_connect"), new wxBitmap(path+wxT("btn_connect.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_servers"), new wxBitmap(path+wxT("btn_servers.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_transfer"), new wxBitmap(path+wxT("btn_transfer.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_search"), new wxBitmap(path+wxT("btn_search.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_shared"), new wxBitmap(path+wxT("btn_shared.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_messages"), new wxBitmap(path+wxT("btn_messages.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_statistics"), new wxBitmap(path+wxT("btn_statistics.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_guisettings"), new wxBitmap(path+wxT("btn_guisettings.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("btn_preferences"), new wxBitmap(path+wxT("btn_preferences.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("splashscreen"), new wxBitmap(path+wxT("splashscreen.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("leftarrow"), new wxBitmap(path+wxT("leftarrow.png"), wxBITMAP_TYPE_PNG)); - images.Append(wxT("rightarrow"), new wxBitmap(path+wxT("rightarrow.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("friend"), new wxBitmap(path+wxT("friend.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("messages"), new wxBitmap(path+wxT("messages.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("searchresults"), new wxBitmap(path+wxT("searchresults.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("provider"), new wxBitmap(path+wxT("provider.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("serverlist"), new wxBitmap(path+wxT("serverlist.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("newserver"), new wxBitmap(path+wxT("newserver.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("updateservers"), new wxBitmap(path+wxT("updateservers.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("info"), new wxBitmap(path+wxT("info.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("serverinfo"), new wxBitmap(path+wxT("serverinfo.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("log"), new wxBitmap(path+wxT("log.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("sharedfiles"), new wxBitmap(path+wxT("sharedfiles.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("updown11"), new wxBitmap(path+wxT("updown11.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("updown00"), new wxBitmap(path+wxT("updown00.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("connectedhigh"), new wxBitmap(path+wxT("connectedhigh.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("disconnected"), new wxBitmap(path+wxT("disconnected.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("clock"), new wxBitmap(path+wxT("clock.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("user"), new wxBitmap(path+wxT("user.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("server"), new wxBitmap(path+wxT("server.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("arrow"), new wxBitmap(path+wxT("arrow.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("statistics"), new wxBitmap(path+wxT("statistics.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("upload"), new wxBitmap(path+wxT("upload.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("download"), new wxBitmap(path+wxT("download.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("partstats"), new wxBitmap(path+wxT("partstats.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("fullstats"), new wxBitmap(path+wxT("fullstats.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("exclamation"), new wxBitmap(path+wxT("exclamation.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("connection"), new wxBitmap(path+wxT("connection.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("daily"), new wxBitmap(path+wxT("daily.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("monthly"), new wxBitmap(path+wxT("monthly.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("yearly"), new wxBitmap(path+wxT("yearly.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("mule"), new wxBitmap(path+wxT("mule.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_connect"), new wxBitmap(path+wxT("btn_connect.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_servers"), new wxBitmap(path+wxT("btn_servers.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_transfer"), new wxBitmap(path+wxT("btn_transfer.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_search"), new wxBitmap(path+wxT("btn_search.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_shared"), new wxBitmap(path+wxT("btn_shared.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_messages"), new wxBitmap(path+wxT("btn_messages.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_statistics"), new wxBitmap(path+wxT("btn_statistics.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_guisettings"), new wxBitmap(path+wxT("btn_guisettings.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("btn_preferences"), new wxBitmap(path+wxT("btn_preferences.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("splashscreen"), new wxBitmap(path+wxT("splashscreen.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("leftarrow"), new wxBitmap(path+wxT("leftarrow.png"), wxBITMAP_TYPE_ANY)); + images.Append(wxT("rightarrow"), new wxBitmap(path+wxT("rightarrow.png"), wxBITMAP_TYPE_ANY)); } /** @@ -154,7 +154,7 @@ void CImages::MakeToolImages() { wxBitmap tmp, tmp_new; wxMemoryDC mdc; - wxCoord x, y, width = 0; + wxCoord x, y, width = 0, height = 0; wxArrayString btntxt; /* List of button names */ @@ -178,71 +178,74 @@ } tool_img_width = width+6; - mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); - mdc.SetPen(*wxTRANSPARENT_PEN); + width = width+6; + height = y+36; - tmp_new = wxBitmap(width+6, y+36); + mdc.SetBrush(wxBrush(*wxTheColourDatabase->FindColour(wxT("WHEAT")), wxSOLID)); + mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); + + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_connect")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(0), &x, &y); - mdc.DrawText(btntxt.Item(0), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(0), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_connect")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_servers")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(1), &x, &y); - mdc.DrawText(btntxt.Item(1), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(1), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_servers")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_search")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(2), &x, &y); - mdc.DrawText(btntxt.Item(2), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(2), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_search"))= tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_transfer")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(3), &x, &y); - mdc.DrawText(btntxt.Item(3), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(3), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_transfer")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_shared")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(4), &x, &y); - mdc.DrawText(btntxt.Item(4), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(4), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_shared")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_messages")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(5), &x, &y); - mdc.DrawText(btntxt.Item(5), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(5), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_messages")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_statistics")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(6), &x, &y); - mdc.DrawText(btntxt.Item(6), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(6), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_statistics")) = tmp_new; - tmp_new = wxBitmap(width+6, y+36); + tmp_new = wxBitmap(width, height); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); mdc.DrawBitmap(GetImage(wxT("btn_guisettings")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(7), &x, &y); - mdc.DrawText(btntxt.Item(7), (tmp_new.GetWidth()-x)/2, 34); + mdc.DrawText(btntxt.Item(7), (tmp_new.GetWidth()-x)/2, 36); GetImage(wxT("btn_guisettings")) = tmp_new; } Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- MainDlg.cpp 27 Nov 2003 08:23:11 -0000 1.14 +++ MainDlg.cpp 27 Nov 2003 10:01:54 -0000 1.15 @@ -112,11 +112,6 @@ /* Load dialog pages */ LoadAndShowDialogPages(); - /* Generate toolbar images if needed */ - #if !defined(__WXGTK__) - img->MakeToolImages(); - #endif - /** * Toolbar and Menubar must be created AFTER loading dialog pages, * since they do calls to GetCurPage() which results in crash @@ -241,10 +236,10 @@ wxToolBar *tb = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, tool_align|wxNO_BORDER|wxTB_3DBUTTONS|wxTB_FLAT - #if defined(__WXGTK__) - |wxTB_TEXT - #endif ); + + /* Generate toolbar images */ + img->MakeToolImages(); tb->SetToolBitmapSize(wxSize(img->tool_img_width, 52)); tb->SetMargins(2, 2); |
From: <ma...@us...> - 2003-11-27 10:00:05
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1017 Modified Files: GUISettingsDlg.cpp Log Message: Fixed toolbar position saving and removed some `restart needed` texts from tooltips Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- GUISettingsDlg.cpp 27 Nov 2003 08:23:11 -0000 1.22 +++ GUISettingsDlg.cpp 27 Nov 2003 10:00:02 -0000 1.23 @@ -161,16 +161,6 @@ m_config->SetPath(wxT("/General")); /** - * Convert the checkbox value to wx constant for storing in config - * object. - */ - switch (tool_align) { - case 0: tool_align = wxTB_HORIZONTAL; break; - case 1: tool_align = wxTB_VERTICAL; break; - default: break; - } - - /** * Store some of the old values from config into temporary * variables, we need them to determine which parts of GUI * to update in the end of this function. @@ -184,6 +174,16 @@ show_menu = GetShowMenu()->GetValue(); icon_set = GetIconSet()->GetString(GetIconSet()->GetSelection()); + /** + * Convert the checkbox value to wx constant for storing in config + * object. + */ + switch (tool_align) { + case 0: tool_align = wxTB_HORIZONTAL; break; + case 1: tool_align = wxTB_VERTICAL; break; + default: break; + } + /* Save to config object. */ /* General data */ @@ -411,7 +411,7 @@ wxString *strs10 = (wxString*) NULL; wxChoice *item10 = new wxChoice( this, ID_ICONSET, wxDefaultPosition, wxSize(100,-1), 0, strs10, 0 ); #ifndef __WXX11__ - item10->SetToolTip( _("Change the iconet the interface should use. Requires restart to take effect") ); + item10->SetToolTip( _("Change the iconet the interface should use.") ); #endif item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); @@ -501,7 +501,7 @@ wxCheckBox *item27 = new wxCheckBox( this, ID_SHOWTOOL, _("Show ToolBar"), wxDefaultPosition, wxDefaultSize, 0 ); item27->SetValue( TRUE ); #ifndef __WXX11__ - item27->SetToolTip( _("Toggle wether toolbar is shown or not. Requires restart to take effect.") ); + item27->SetToolTip( _("Toggle wether toolbar is shown or not.") ); #endif item26->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); @@ -511,7 +511,7 @@ }; wxChoice *item28 = new wxChoice( this, ID_TOOLALIGN, wxDefaultPosition, wxSize(100,-1), 2, strs28, 0 ); #ifndef __WXX11__ - item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window. Requires restart to take effect.") ); + item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window.") ); #endif item26->Add( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|border_style, 5 ); @@ -519,7 +519,7 @@ wxCheckBox *item29 = new wxCheckBox( this, ID_SHOWMENU, _("Show MenuBar"), wxDefaultPosition, wxDefaultSize, 0 ); #ifndef __WXX11__ - item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not. Requires restart to take effect.") ); + item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not.") ); #endif item23->Add( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); |
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv12760 Modified Files: GUISettingsDlg.cpp Images.cpp Images.h MainDlg.cpp MessagesWnd.cpp SearchWnd.cpp ServerListCtrl.cpp ServerWnd.cpp ServerWnd.h SharedFilesWnd.cpp StatisticsTreeCtrl.cpp StatisticsTreeCtrl.h StatisticsWnd.h SysTray.cpp TransferWnd.cpp defines.h wxInterface.cpp wxInterface.wdr wxInterface_wdr.cpp Log Message: * Images class rewritten to provide dynamic reloading and name-based lookup functionality. * Iconset can now be changed on runtime. * Menubar radiobuttons now get updated correctly. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- GUISettingsDlg.cpp 24 Nov 2003 16:06:31 -0000 1.21 +++ GUISettingsDlg.cpp 27 Nov 2003 08:23:11 -0000 1.22 @@ -154,34 +154,14 @@ */ void CGUISettingsDlg::SaveSettings() { int old_tool_align, tool_align; + wxString old_icon_set, icon_set; bool old_show_tool, show_tool; bool old_show_menu, show_menu; - /** - * To determine wether we are reading the values for first time. - * Starts up as true, but will change to false as soon as a value - * is not found in config. - */ - bool notfirstload = true; m_config->SetPath(wxT("/General")); /** - * We do some checking here to find out wether toolbar/menubar settings - * were changed - if so, we display a messagebox notifying that user - * needs to restart the GUI for changes to take effect. - */ - notfirstload = m_config->Read(wxT("Toolbar Alignment"), &old_tool_align) - && notfirstload; - notfirstload = m_config->Read(wxT("Show ToolBar"), &old_show_tool) - && notfirstload; - notfirstload = m_config->Read(wxT("Show MenuBar"), &old_show_menu) - && notfirstload; - show_tool = GetShowTool()->GetValue(); - tool_align = GetToolAlign()->GetSelection(); - show_menu = GetShowMenu()->GetValue(); - - /** - * We convert the checkbox value to wx constant for storing in config + * Convert the checkbox value to wx constant for storing in config * object. */ switch (tool_align) { @@ -190,7 +170,23 @@ default: break; } - /* And finally save to config object. */ + /** + * Store some of the old values from config into temporary + * variables, we need them to determine which parts of GUI + * to update in the end of this function. + */ + m_config->Read(wxT("Toolbar Alignment"), &old_tool_align); + m_config->Read(wxT("Show ToolBar"), &old_show_tool); + m_config->Read(wxT("Show MenuBar"), &old_show_menu); + m_config->Read(wxT("/General/IconSets/CurIconSet"), &old_icon_set); + show_tool = GetShowTool()->GetValue(); + tool_align = GetToolAlign()->GetSelection(); + show_menu = GetShowMenu()->GetValue(); + icon_set = GetIconSet()->GetString(GetIconSet()->GetSelection()); + + /* Save to config object. */ + + /* General data */ m_config->Write(wxT("Font"), GetFont()->GetSelection()); m_config->Write(wxT("Icon set"), GetIconSet()->GetSelection()); m_config->Write(wxT("Show splashscreen"), GetShowSplash()->GetValue()); @@ -201,7 +197,7 @@ m_config->Write(wxT("Start page"), GetStartPage()->GetSelection()); m_config->Write(wxT("Remember last"), GetRememberLast()->GetValue()); - /* Save iconsets data */ + /* Iconsets data */ m_config->SetPath(wxT("/General/IconSets")); for (int i=0; i<GetIconSet()->GetCount(); i++) { m_config->Write( @@ -215,7 +211,7 @@ GetIconSet()->GetString(GetIconSet()->GetSelection()) ); - /* Save language data */ + /* Language data */ m_config->SetPath(wxT("/General/Lang")); for (int i=0; i<GetLang()->GetCount(); i++) { m_config->Write( @@ -229,14 +225,40 @@ GetLang()->GetString(GetLang()->GetSelection()) ); + /* Update GUI as neccesery */ + + /* If toolbar setting was changed, call toolbar init */ if ((old_show_tool != show_tool) || (old_tool_align != tool_align)) { mainframe->CreateMyToolBar(); } + /* If menubar setting was changed, call menubar init */ if (old_show_menu != show_menu) { mainframe->CreateMyMenuBar(); } + /* If iconset setting was changed update the images in gui */ + if (old_icon_set != icon_set) { + /* Reload images */ + img->LoadImages(); + /* Update static bitmaps */ + img->UpdateImages(mainframe); + /* Recreate toolbar */ + mainframe->CreateMyToolBar(); + /* Update server page logbook */ + serverwnd->SetLogBookImages(); + serverwnd->SetToggleSideBarImage(); + /* Update statistics tree */ + statisticswnd->GetTree()->GetTreeImages(); + statisticswnd->GetTree()->GenerateTree(); + /* Main frame and systray icons */ + wxIcon icon; + icon.CopyFromBitmap(img->GetImage(wxT("mule"))); + mainframe->SetIcon(icon); + #ifdef wxHAS_TASK_BAR_ICON + systray->SetIcon(icon); + #endif + } } /* Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Images.cpp 24 Nov 2003 11:18:01 -0000 1.20 +++ Images.cpp 27 Nov 2003 08:23:11 -0000 1.21 @@ -30,11 +30,24 @@ #include "Images.h" +#include <wx/listimpl.cpp> +WX_DEFINE_LIST(ListOfBitmaps); + +/* Constructor for CImages class */ CImages::CImages() { + images = ListOfBitmaps(wxKEY_STRING); LoadImages(); } /** + * Destructor for CImages class. Deletes contents of `images` list + */ +CImages::~CImages() { + images.DeleteContents(true); + images.Clear(); +} + +/** * This method loads all images into the global variables. */ void CImages::LoadImages() { @@ -42,6 +55,10 @@ wxChar sep; tool_img_width = 32; + /* Just in case theres anything in there, delete it */ + images.DeleteContents(true); + images.Clear(); + /** * We get the application binary path from argv[0], remove the binary * name from it, and use it as base for our resources. Needed if @@ -81,51 +98,48 @@ path.Prepend(wxT("::Resources")); #endif - frienduser.LoadFile(path+wxT("friend.png"), wxBITMAP_TYPE_PNG); - messages.LoadFile(path+wxT("messages.png"), wxBITMAP_TYPE_PNG); - search.LoadFile(path+wxT("searchresults.png"), wxBITMAP_TYPE_PNG); - provider.LoadFile(path+wxT("provider.png"), wxBITMAP_TYPE_PNG); - servers.LoadFile(path+wxT("serverlist.png"), wxBITMAP_TYPE_PNG); - newserver.LoadFile(path+wxT("newserver.png"), wxBITMAP_TYPE_PNG); - updateserver.LoadFile(path+wxT("updateservers.png"), wxBITMAP_TYPE_PNG); - info.LoadFile(path+wxT("info.png"), wxBITMAP_TYPE_PNG); - serverinfo.LoadFile(path+wxT("serverinfo.png"), wxBITMAP_TYPE_PNG); - log.LoadFile(path+wxT("log.png"), wxBITMAP_TYPE_PNG); - files.LoadFile(path+wxT("sharedfiles.png"), wxBITMAP_TYPE_PNG); - updown11.LoadFile(path+wxT("updown11.png"), wxBITMAP_TYPE_PNG); - updown00.LoadFile(path+wxT("updown00.png"), wxBITMAP_TYPE_PNG); - connected.LoadFile(path+wxT("connectedhigh.png"), wxBITMAP_TYPE_PNG); - disconnected.LoadFile(path+wxT("disconnected.png"), wxBITMAP_TYPE_PNG); - timer.LoadFile(path+wxT("clock.png"), wxBITMAP_TYPE_PNG); - user.LoadFile(path+wxT("user.png"), wxBITMAP_TYPE_PNG); - server.LoadFile(path+wxT("server.png"), wxBITMAP_TYPE_PNG); - arrow.LoadFile(path+wxT("arrow.png"), wxBITMAP_TYPE_PNG); - stats.LoadFile(path+wxT("statistics.png"), wxBITMAP_TYPE_PNG); - upload.LoadFile(path+wxT("upload.png"), wxBITMAP_TYPE_PNG); - download.LoadFile(path+wxT("download.png"), wxBITMAP_TYPE_PNG); - part.LoadFile(path+wxT("partstats.png"), wxBITMAP_TYPE_PNG); - full.LoadFile(path+wxT("fullstats.png"), wxBITMAP_TYPE_PNG); - exclamation.LoadFile(path+wxT("exclamation.png"), wxBITMAP_TYPE_PNG); - connection.LoadFile(path+wxT("connection.png"), wxBITMAP_TYPE_PNG); - daily.LoadFile(path+wxT("daily.png"), wxBITMAP_TYPE_PNG); - monthly.LoadFile(path+wxT("monthly.png"), wxBITMAP_TYPE_PNG); - yearly.LoadFile(path+wxT("yearly.png"), wxBITMAP_TYPE_PNG); - mule.LoadFile(path+wxT("mule.png"), wxBITMAP_TYPE_PNG); - btn_connect.LoadFile(path+wxT("btn_connect.png"), wxBITMAP_TYPE_PNG); - btn_servers.LoadFile(path+wxT("btn_servers.png"), wxBITMAP_TYPE_PNG); - btn_transfer.LoadFile(path+wxT("btn_transfer.png"), wxBITMAP_TYPE_PNG); - btn_search.LoadFile(path+wxT("btn_search.png"), wxBITMAP_TYPE_PNG); - btn_shared.LoadFile(path+wxT("btn_shared.png"), wxBITMAP_TYPE_PNG); - btn_messages.LoadFile(path+wxT("btn_messages.png"), wxBITMAP_TYPE_PNG); - btn_statistics.LoadFile(path+wxT("btn_statistics.png"), - wxBITMAP_TYPE_PNG); - btn_guisettings.LoadFile(path+wxT("btn_guisettings.png"), - wxBITMAP_TYPE_PNG); - btn_preferences.LoadFile(path+wxT("btn_preferences.png"), - wxBITMAP_TYPE_PNG); - logo.LoadFile(path+wxT("splashscreen.png"), wxBITMAP_TYPE_PNG); - leftarrow.LoadFile(path+wxT("leftarrow.png"), wxBITMAP_TYPE_PNG); - rightarrow.LoadFile(path+wxT("rightarrow.png"), wxBITMAP_TYPE_PNG); + images.Append(wxT("friend"), new wxBitmap(path+wxT("friend.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("messages"), new wxBitmap(path+wxT("messages.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("searchresults"), new wxBitmap(path+wxT("searchresults.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("provider"), new wxBitmap(path+wxT("provider.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("serverlist"), new wxBitmap(path+wxT("serverlist.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("newserver"), new wxBitmap(path+wxT("newserver.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("updateservers"), new wxBitmap(path+wxT("updateservers.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("info"), new wxBitmap(path+wxT("info.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("serverinfo"), new wxBitmap(path+wxT("serverinfo.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("log"), new wxBitmap(path+wxT("log.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("sharedfiles"), new wxBitmap(path+wxT("sharedfiles.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("updown11"), new wxBitmap(path+wxT("updown11.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("updown00"), new wxBitmap(path+wxT("updown00.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("connectedhigh"), new wxBitmap(path+wxT("connectedhigh.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("disconnected"), new wxBitmap(path+wxT("disconnected.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("clock"), new wxBitmap(path+wxT("clock.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("user"), new wxBitmap(path+wxT("user.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("server"), new wxBitmap(path+wxT("server.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("arrow"), new wxBitmap(path+wxT("arrow.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("statistics"), new wxBitmap(path+wxT("statistics.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("upload"), new wxBitmap(path+wxT("upload.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("download"), new wxBitmap(path+wxT("download.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("partstats"), new wxBitmap(path+wxT("partstats.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("fullstats"), new wxBitmap(path+wxT("fullstats.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("exclamation"), new wxBitmap(path+wxT("exclamation.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("connection"), new wxBitmap(path+wxT("connection.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("daily"), new wxBitmap(path+wxT("daily.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("monthly"), new wxBitmap(path+wxT("monthly.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("yearly"), new wxBitmap(path+wxT("yearly.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("mule"), new wxBitmap(path+wxT("mule.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_connect"), new wxBitmap(path+wxT("btn_connect.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_servers"), new wxBitmap(path+wxT("btn_servers.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_transfer"), new wxBitmap(path+wxT("btn_transfer.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_search"), new wxBitmap(path+wxT("btn_search.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_shared"), new wxBitmap(path+wxT("btn_shared.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_messages"), new wxBitmap(path+wxT("btn_messages.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_statistics"), new wxBitmap(path+wxT("btn_statistics.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_guisettings"), new wxBitmap(path+wxT("btn_guisettings.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("btn_preferences"), new wxBitmap(path+wxT("btn_preferences.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("splashscreen"), new wxBitmap(path+wxT("splashscreen.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("leftarrow"), new wxBitmap(path+wxT("leftarrow.png"), wxBITMAP_TYPE_PNG)); + images.Append(wxT("rightarrow"), new wxBitmap(path+wxT("rightarrow.png"), wxBITMAP_TYPE_PNG)); } /** @@ -170,65 +184,101 @@ tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_connect, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_connect")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(0), &x, &y); mdc.DrawText(btntxt.Item(0), (tmp_new.GetWidth()-x)/2, 34); - btn_connect = tmp_new; + GetImage(wxT("btn_connect")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_servers, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_servers")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(1), &x, &y); mdc.DrawText(btntxt.Item(1), (tmp_new.GetWidth()-x)/2, 34); - btn_servers = tmp_new; + GetImage(wxT("btn_servers")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_search, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_search")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(2), &x, &y); mdc.DrawText(btntxt.Item(2), (tmp_new.GetWidth()-x)/2, 34); - btn_search = tmp_new; + GetImage(wxT("btn_search"))= tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_transfer, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_transfer")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(3), &x, &y); mdc.DrawText(btntxt.Item(3), (tmp_new.GetWidth()-x)/2, 34); - btn_transfer = tmp_new; + GetImage(wxT("btn_transfer")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_shared, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_shared")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(4), &x, &y); mdc.DrawText(btntxt.Item(4), (tmp_new.GetWidth()-x)/2, 34); - btn_shared = tmp_new; + GetImage(wxT("btn_shared")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_messages, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_messages")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(5), &x, &y); mdc.DrawText(btntxt.Item(5), (tmp_new.GetWidth()-x)/2, 34); - btn_messages = tmp_new; + GetImage(wxT("btn_messages")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_statistics, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_statistics")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(6), &x, &y); mdc.DrawText(btntxt.Item(6), (tmp_new.GetWidth()-x)/2, 34); - btn_statistics = tmp_new; + GetImage(wxT("btn_statistics")) = tmp_new; tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); - mdc.DrawBitmap(btn_guisettings, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.DrawBitmap(GetImage(wxT("btn_guisettings")), (tmp_new.GetWidth()-32)/2, 2, true); mdc.GetTextExtent(btntxt.Item(7), &x, &y); mdc.DrawText(btntxt.Item(7), (tmp_new.GetWidth()-x)/2, 34); - btn_guisettings = tmp_new; + GetImage(wxT("btn_guisettings")) = tmp_new; + +} + +/** + * This is an "Images Getter". It finds the requested image by searching + * the image list by name. If not found, error message is generated, + * but we still return the pointer (even if its illegal). + */ +wxBitmap& CImages::GetImage(const wxString &name) { + ListOfBitmaps::Node *tmp = images.Find(name); + if (tmp == NULL) { + wxFAIL_MSG(wxString::Format( + wxT("Requested image `%s` could not be found!"), + name.c_str() + )); + } + + return *(tmp->GetData()); +} + +/** + * This method searches recusivly through all children under *parent for + * wxStaticBitmap type windows and sets their image by looking up the + * correct image by its name. + */ +void CImages::UpdateImages(wxWindow *parent) { + if (parent->GetClassInfo()->IsKindOf(CLASSINFO(wxStaticBitmap))) { + ((wxStaticBitmap*)parent)->SetBitmap( + GetImage(parent->GetName()) + ); + } + wxWindowList controls; + controls = parent->GetChildren(); + for (unsigned int i=0;i<controls.GetCount();i++) { + UpdateImages(controls.Item(i)->GetData()); + } } Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Images.h 23 Nov 2003 20:15:28 -0000 1.13 +++ Images.h 27 Nov 2003 08:23:11 -0000 1.14 @@ -30,22 +30,20 @@ #include "defines.h" +WX_DECLARE_LIST(wxBitmap, ListOfBitmaps); + extern class CImages *img; class CImages { public: CImages(); - wxBitmap frienduser, messages, search, provider, servers, newserver, - updateserver, info, serverinfo, log, files, updown11, updown00, - connected, disconnected, timer, user, server, arrow, stats, - upload, download, part, full, exclamation, connection, daily, - monthly, yearly, mule, btn_connect, btn_servers, - btn_transfer, btn_search, btn_shared, btn_messages, - btn_statistics, btn_guisettings, btn_preferences, logo, - leftarrow, rightarrow; + virtual ~CImages(); void MakeToolImages(); int tool_img_width; -private: void LoadImages(); + wxBitmap& GetImage(const wxString &name); + void UpdateImages(wxWindow *parent); +private: + ListOfBitmaps images; }; #endif /* __IMAGES_H__ */ Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- MainDlg.cpp 25 Nov 2003 04:21:14 -0000 1.13 +++ MainDlg.cpp 27 Nov 2003 08:23:11 -0000 1.14 @@ -65,7 +65,7 @@ /* Set application icon */ wxIcon icon; - icon.CopyFromBitmap(img->mule); + icon.CopyFromBitmap(img->GetImage(wxT("mule"))); SetIcon(icon); #ifdef wxHAS_TASK_BAR_ICON @@ -103,11 +103,11 @@ m_mainsizer->Add(statusbar, 0, wxGROW|wxEXPAND, 0); wxASSERT_MSG(statusbar, wxT("CMainDlg::CMainDlg() - StatusBar object not ready for accessing.")); - GetBmpStatusConnection()->SetBitmap(img->disconnected); - GetBmpStatusUsers()->SetBitmap(img->user); - GetBmpStatusFiles()->SetBitmap(img->files); - GetBmpStatusUpload()->SetBitmap(img->upload); - GetBmpStatusDload()->SetBitmap(img->download); + GetBmpStatusConnection()->SetBitmap(img->GetImage(wxT("disconnected"))); + GetBmpStatusUsers()->SetBitmap(img->GetImage(wxT("user"))); + GetBmpStatusFiles()->SetBitmap(img->GetImage(wxT("sharedfiles"))); + GetBmpStatusUpload()->SetBitmap(img->GetImage(wxT("upload"))); + GetBmpStatusDload()->SetBitmap(img->GetImage(wxT("download"))); /* Load dialog pages */ LoadAndShowDialogPages(); @@ -251,37 +251,37 @@ /* Add the buttons */ tb->AddTool( - ID_BTN_CONNECT, _("Connect"), img->btn_connect, - img->btn_connect, wxITEM_NORMAL, _("Connect to any server") + ID_BTN_CONNECT, _("Connect"), img->GetImage(wxT("btn_connect")), + img->GetImage(wxT("btn_connect")), wxITEM_NORMAL, _("Connect to any server") ); tb->AddSeparator(); tb->AddTool( - ID_BTN_SERVERS, _("Servers"), img->btn_servers, - img->btn_servers, wxITEM_CHECK, _("Server list") + ID_BTN_SERVERS, _("Servers"), img->GetImage(wxT("btn_servers")), + img->GetImage(wxT("btn_servers")), wxITEM_CHECK, _("Server list") ); tb->AddTool( - ID_BTN_SEARCH, _("Search"), img->btn_search, - img->btn_search, wxITEM_CHECK, _("Search files") + ID_BTN_SEARCH, _("Search"), img->GetImage(wxT("btn_search")), + img->GetImage(wxT("btn_search")), wxITEM_CHECK, _("Search files") ); tb->AddTool( - ID_BTN_TRANSFER, _("Transfer"), img->btn_transfer, - img->btn_transfer, wxITEM_CHECK, _("File Transfer") + ID_BTN_TRANSFER, _("Transfer"), img->GetImage(wxT("btn_transfer")), + img->GetImage(wxT("btn_transfer")), wxITEM_CHECK, _("File Transfer") ); tb->AddTool( - ID_BTN_SHARED_FILES, _("Shared Files"), img->btn_shared, - img->btn_shared, wxITEM_CHECK, _("Show shared files") + ID_BTN_SHARED_FILES, _("Shared Files"), img->GetImage(wxT("btn_shared")), + img->GetImage(wxT("btn_shared")), wxITEM_CHECK, _("Show shared files") ); tb->AddTool( - ID_BTN_MESSAGES, _("Messages"), img->btn_messages, - img->btn_messages, wxITEM_CHECK, _("Chatting") + ID_BTN_MESSAGES, _("Messages"), img->GetImage(wxT("btn_messages")), + img->GetImage(wxT("btn_messages")), wxITEM_CHECK, _("Chatting") ); tb->AddTool( - ID_BTN_STATISTICS, _("Statistics"), img->btn_statistics, - img->btn_statistics, wxITEM_CHECK, _("Show live statistics")); + ID_BTN_STATISTICS, _("Statistics"), img->GetImage(wxT("btn_statistics")), + img->GetImage(wxT("btn_statistics")), wxITEM_CHECK, _("Show live statistics")); tb->AddSeparator(); tb->AddTool( - ID_BTN_GUISETTINGS, _("Preferences"), img->btn_guisettings, - img->btn_guisettings, wxITEM_NORMAL, _("Modify settings") + ID_BTN_GUISETTINGS, _("Preferences"), img->GetImage(wxT("btn_guisettings")), + img->GetImage(wxT("btn_guisettings")), wxITEM_NORMAL, _("Modify settings") ); /* And go live */ Index: MessagesWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MessagesWnd.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MessagesWnd.cpp 20 Nov 2003 01:27:26 -0000 1.9 +++ MessagesWnd.cpp 27 Nov 2003 08:23:11 -0000 1.10 @@ -40,8 +40,8 @@ MessagesWnd( this, TRUE ); /* Set images of dialog static bitmaps */ - GetFriendImage()->SetBitmap(img->frienduser); - GetMessagesImage()->SetBitmap(img->messages); + GetFriendImage()->SetBitmap(img->GetImage(wxT("friend"))); + GetMessagesImage()->SetBitmap(img->GetImage(wxT("messages"))); Hide(); } Index: SearchWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- SearchWnd.cpp 20 Nov 2003 01:27:26 -0000 1.14 +++ SearchWnd.cpp 27 Nov 2003 08:23:11 -0000 1.15 @@ -48,7 +48,7 @@ : wxPanel( parent, id, position, size, style ) { SearchWnd( this, TRUE ); - GetSearchResultsImage()->SetBitmap(img->search); + GetSearchResultsImage()->SetBitmap(img->GetImage(wxT("searchresults"))); Hide(); Index: ServerListCtrl.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerListCtrl.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ServerListCtrl.cpp 20 Nov 2003 01:27:26 -0000 1.10 +++ ServerListCtrl.cpp 27 Nov 2003 08:23:12 -0000 1.11 @@ -64,7 +64,7 @@ /* Create and assign image list for this list. */ wxImageList *serverimages = new wxImageList(16, 16); - serverimages->Add(img->provider); + serverimages->Add(img->GetImage(wxT("provider"))); AssignImageList(serverimages, wxIMAGE_LIST_SMALL); /* Add some kind of test item to get adding/removing items working. */ Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- ServerWnd.cpp 24 Nov 2003 16:06:32 -0000 1.40 +++ ServerWnd.cpp 27 Nov 2003 08:23:12 -0000 1.41 @@ -70,16 +70,10 @@ Hide(); /* Set the images of static bitmaps on this page. */ - GetSSBitmapProvider()->SetBitmap(img->provider); - GetBtnToggleSidebar()->SetBitmapLabel(img->leftarrow); - - /* Set log notebook page images */ - m_imagelist = new wxImageList(16, 16); - m_imagelist->Add(img->log); + GetSSBitmapProvider()->SetBitmap(img->GetImage(wxT("provider"))); - GetLogBook()->AssignImageList(m_imagelist); - GetLogBook()->SetPageImage(0, 0); - GetLogBook()->SetPageImage(1, 0); + SetToggleSideBarImage(); + SetLogBookImages(); } /* @@ -101,6 +95,29 @@ m_config->Write(wxT("SideBar"), sidebar->IsShown()); } +void CServerWnd::SetToggleSideBarImage() { + if (sidebar->IsShown()) { + GetBtnToggleSidebar()->SetBitmapLabel(img->GetImage(wxT("leftarrow"))); + GetBtnToggleSidebar()->SetBitmapSelected(img->GetImage(wxT("leftarrow"))); + GetBtnToggleSidebar()->SetBitmapFocus(img->GetImage(wxT("leftarrow"))); + + } else { + GetBtnToggleSidebar()->SetBitmapLabel(img->GetImage(wxT("rightarrow"))); + GetBtnToggleSidebar()->SetBitmapSelected(img->GetImage(wxT("rightarrow"))); + GetBtnToggleSidebar()->SetBitmapFocus(img->GetImage(wxT("rightarrow"))); + } +} + +/* Set log notebook page images */ +void CServerWnd::SetLogBookImages() { + m_imagelist = new wxImageList(16, 16); + m_imagelist->Add(img->GetImage(wxT("log"))); + + GetLogBook()->AssignImageList(m_imagelist); + GetLogBook()->SetPageImage(0, 0); + GetLogBook()->SetPageImage(1, 0); +} + /** * These three almost identical methods add a line of [text] into the * corresponding log listctrls, optionally also displaying it in statusbar. @@ -167,7 +184,7 @@ */ sidebar = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize, - wxNO_FULL_REPAINT_ON_RESIZE|wxGROW, wxT("ServerWnd") + wxNO_FULL_REPAINT_ON_RESIZE|wxGROW, wxT("ServerWnd SideBar") ); /* Sidebar panel needs a sizer also for managing its children. */ wxFlexGridSizer *sbmain = new wxFlexGridSizer(1, 0, 0); @@ -232,7 +249,7 @@ * window to toggle sidebar on/off */ wxBitmapButton *toggler = new wxBitmapButton( - this, ID_BTN_TOGGLE_SIDEBAR, img->leftarrow, + this, ID_BTN_TOGGLE_SIDEBAR, img->GetImage(wxT("leftarrow")), wxDefaultPosition, wxSize(10,100) ); mainsizer->Add(toggler, 0, wxALIGN_CENTER, 5 ); @@ -284,17 +301,17 @@ mainsizer->RemoveGrowableCol(2); mainsizer->AddGrowableCol(1); sidebar->Hide(); - GetBtnToggleSidebar()->SetBitmapLabel(img->rightarrow); - GetBtnToggleSidebar()->SetBitmapSelected(img->rightarrow); - GetBtnToggleSidebar()->SetBitmapFocus(img->rightarrow); + GetBtnToggleSidebar()->SetBitmapLabel(img->GetImage(wxT("rightarrow"))); + GetBtnToggleSidebar()->SetBitmapSelected(img->GetImage(wxT("rightarrow"))); + GetBtnToggleSidebar()->SetBitmapFocus(img->GetImage(wxT("rightarrow"))); } else { mainsizer->Prepend(sidebar, 0, wxGROW|wxTOP|wxBOTTOM|wxADJUST_MINSIZE, 5); mainsizer->RemoveGrowableCol(1); mainsizer->AddGrowableCol(2); sidebar->Show(); - GetBtnToggleSidebar()->SetBitmapLabel(img->leftarrow); - GetBtnToggleSidebar()->SetBitmapSelected(img->leftarrow); - GetBtnToggleSidebar()->SetBitmapFocus(img->leftarrow); + GetBtnToggleSidebar()->SetBitmapLabel(img->GetImage(wxT("leftarrow"))); + GetBtnToggleSidebar()->SetBitmapSelected(img->GetImage(wxT("leftarrow"))); + GetBtnToggleSidebar()->SetBitmapFocus(img->GetImage(wxT("leftarrow"))); } Layout(); Refresh(); @@ -309,9 +326,12 @@ wxSizer* CServerWnd::SettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - wxCheckBox *item1 = new wxCheckBox( parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), wxDefaultPosition, wxDefaultSize, 0 ); + wxCheckBox *item1 = new wxCheckBox( + parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), + wxDefaultPosition, wxDefaultSize, 0 + ); #ifndef __WXX11__ - item1->SetToolTip( _("Toggle wether application should automatically connect to any server on startup") ); + item1->SetToolTip(_("Toggle wether application should automatically connect to any server on startup") ); #endif item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); @@ -330,7 +350,7 @@ wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL ); - wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize, 0, wxT("provider") ); item5->Add( item6, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item7 = new wxStaticText( parent, ID_SS_SERVER_NAME, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ServerWnd.h 24 Nov 2003 16:06:32 -0000 1.29 +++ ServerWnd.h 27 Nov 2003 08:23:12 -0000 1.30 @@ -57,7 +57,8 @@ void AddLogLine(wxString text, bool status = false); void AddDebugLine(wxString text, bool status = false); void AddServerLogLine(wxString text, bool status = false); - + void SetToggleSideBarImage(); + void SetLogBookImages(); private: DECLARE_EVENT_TABLE() Index: SharedFilesWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SharedFilesWnd.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- SharedFilesWnd.cpp 20 Nov 2003 01:27:26 -0000 1.9 +++ SharedFilesWnd.cpp 27 Nov 2003 08:23:12 -0000 1.10 @@ -39,7 +39,7 @@ : wxPanel( parent, id, position, size, style ) { SharedFilesWnd( this, TRUE ); - GetSharedFilesImage()->SetBitmap(img->files); + GetSharedFilesImage()->SetBitmap(img->GetImage(wxT("sharedfiles"))); Hide(); } Index: StatisticsTreeCtrl.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/StatisticsTreeCtrl.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- StatisticsTreeCtrl.cpp 20 Nov 2003 01:27:26 -0000 1.17 +++ StatisticsTreeCtrl.cpp 27 Nov 2003 08:23:12 -0000 1.18 @@ -41,29 +41,43 @@ CStatisticsTreeCtrl::CStatisticsTreeCtrl( wxWindow *parent, wxWindowID id, const wxPoint &position, const wxSize& size, long style ) : wxTreeCtrl( parent, id, position, size, style ) { + GetTreeImages(); + GenerateTree(); +} +/* This loads the correct images for the tree and assigns as imagelist. */ +void CStatisticsTreeCtrl::GetTreeImages() { wxImageList *tree_images = new wxImageList(16, 16); - tree_images->Add(img->updown11); // 0 Up/Down - tree_images->Add(img->connected); // 1 Connection - tree_images->Add(img->timer); // 2 Clock - tree_images->Add(img->user); // 3 User - tree_images->Add(img->server); // 4 Server - tree_images->Add(img->files); // 5 Shared Files - tree_images->Add(img->arrow); // 6 Arrow Item - tree_images->Add(img->stats); // 7 Statistics - tree_images->Add(img->upload); // 8 Uploads - tree_images->Add(img->download); // 9 Downloads - tree_images->Add(img->part); // 10 Statistics Session - tree_images->Add(img->full); // 11 Statistics Total - tree_images->Add(img->exclamation); // 12 Records - tree_images->Add(img->connection); // 13 Prefs.Connection - tree_images->Add(img->daily); // 14 Daily - tree_images->Add(img->monthly); // 15 Monthly - tree_images->Add(img->yearly); // 16 Yearly + tree_images->Add(img->GetImage(wxT("updown11"))); // 0 Up/Down + tree_images->Add(img->GetImage(wxT("connectedhigh"))); // 1 Connection + tree_images->Add(img->GetImage(wxT("clock"))); // 2 Clock + tree_images->Add(img->GetImage(wxT("user"))); // 3 User + tree_images->Add(img->GetImage(wxT("server"))); // 4 Server + tree_images->Add(img->GetImage(wxT("sharedfiles"))); // 5 Shared Files + tree_images->Add(img->GetImage(wxT("arrow"))); // 6 Arrow Item + tree_images->Add(img->GetImage(wxT("statistics"))); // 7 Statistics + tree_images->Add(img->GetImage(wxT("upload"))); // 8 Uploads + tree_images->Add(img->GetImage(wxT("download"))); // 9 Downloads + tree_images->Add(img->GetImage(wxT("partstats"))); // 10 Statistics Session + tree_images->Add(img->GetImage(wxT("fullstats"))); // 11 Statistics Total + tree_images->Add(img->GetImage(wxT("exclamation"))); // 12 Records + tree_images->Add(img->GetImage(wxT("connection"))); // 13 Prefs.Connection + tree_images->Add(img->GetImage(wxT("daily"))); // 14 Daily + tree_images->Add(img->GetImage(wxT("monthly"))); // 15 Monthly + tree_images->Add(img->GetImage(wxT("yearly"))); // 16 Yearly AssignImageList(tree_images); - +} + +/* This method generates the tree by calling a submethod for each of the branches. */ +void CStatisticsTreeCtrl::GenerateTree() { + /* Clean up if theres anything already in tree */ + DeleteAllItems(); + + /* Root item - this will be hidden */ wxTreeItemId root = AddRoot(wxT("ShareDaemon Statistics"), 7); SetItemBold(root); + + /* Branches */ CreateTransferBranch(root); CreateConnectionBranch(root); CreateTimeStatisticsBranch(root); Index: StatisticsTreeCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/StatisticsTreeCtrl.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- StatisticsTreeCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 +++ StatisticsTreeCtrl.h 27 Nov 2003 08:23:12 -0000 1.8 @@ -34,11 +34,12 @@ class CStatisticsTreeCtrl: public wxTreeCtrl { public: - CStatisticsTreeCtrl( wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0 ); - + CStatisticsTreeCtrl( wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0 ); + void GetTreeImages(); + void GenerateTree(); private: void CreateTransferBranch(wxTreeItemId root); void CreateConnectionBranch(wxTreeItemId root); Index: StatisticsWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/StatisticsWnd.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- StatisticsWnd.h 20 Nov 2003 01:27:26 -0000 1.7 +++ StatisticsWnd.h 27 Nov 2003 08:23:12 -0000 1.8 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "StatisticsTreeCtrl.h" class CStatisticsWnd: public wxPanel { public: @@ -40,7 +41,7 @@ long style = wxTAB_TRAVERSAL | wxNO_BORDER | wxNO_FULL_REPAINT_ON_RESIZE ); - + CStatisticsTreeCtrl* GetTree() { return (CStatisticsTreeCtrl*) FindWindow(ID_STATSTREECTRL); } private: DECLARE_EVENT_TABLE() void StatisticsMenu(wxCommandEvent &event); Index: SysTray.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SysTray.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- SysTray.cpp 23 Nov 2003 09:51:46 -0000 1.10 +++ SysTray.cpp 27 Nov 2003 08:23:12 -0000 1.11 @@ -46,7 +46,7 @@ */ CSysTray::CSysTray() : wxTaskBarIcon() { wxIcon icon; - icon.CopyFromBitmap(img->mule); + icon.CopyFromBitmap(img->GetImage(wxT("mule"))); SetIcon(icon, wxT("ShareDaemon")); } Index: TransferWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/TransferWnd.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- TransferWnd.cpp 20 Nov 2003 01:27:26 -0000 1.26 +++ TransferWnd.cpp 27 Nov 2003 08:23:12 -0000 1.27 @@ -174,8 +174,8 @@ /* Download icon */ wxStaticBitmap* bmp_dload = new wxStaticBitmap( - parent, wxID_STATIC, img->download, - wxDefaultPosition, wxSize(16, 16), 0 + parent, wxID_STATIC, img->GetImage(wxT("download")), + wxDefaultPosition, wxSize(16, 16), 0, wxT("download") ); s_upper->Add( bmp_dload, 0, wxALIGN_LEFT|wxALIGN_BOTTOM| @@ -236,10 +236,10 @@ s_main->Add( s_upper, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); /* Upload image */ - wxBitmap img_upload = img->upload; + wxBitmap img_upload = img->GetImage(wxT("upload")); wxStaticBitmap* img = new wxStaticBitmap( parent, wxID_STATIC, img_upload, - wxDefaultPosition, wxSize(16, 16), 0 + wxDefaultPosition, wxSize(16, 16), 0, wxT("upload") ); s_upper->Add( img, 0, wxALIGN_CENTER_HORIZONTAL| @@ -279,10 +279,10 @@ s_main->Add( s_upper, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); /* Image */ - wxBitmap img_upload = img->upload; + wxBitmap img_upload = img->GetImage(wxT("upload")); wxStaticBitmap* img = new wxStaticBitmap( parent, wxID_STATIC, img_upload, - wxDefaultPosition, wxSize(16, 16), 0 + wxDefaultPosition, wxSize(16, 16), 0, wxT("upload") ); s_upper->Add( img, 0, wxALIGN_CENTER_HORIZONTAL| @@ -319,10 +319,10 @@ s_main->Add( s_upper, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); /* Image */ - wxBitmap img_upload = img->upload; + wxBitmap img_upload = img->GetImage(wxT("upload")); wxStaticBitmap* img = new wxStaticBitmap( parent, wxID_STATIC, img_upload, - wxDefaultPosition, wxSize(16, 16), 0 + wxDefaultPosition, wxSize(16, 16), 0, wxT("upload") ); s_upper->Add( img, 0, wxALIGN_CENTER_HORIZONTAL| Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- defines.h 24 Nov 2003 16:06:32 -0000 1.38 +++ defines.h 27 Nov 2003 08:23:12 -0000 1.39 @@ -21,7 +21,7 @@ #define __defines_H__ /* Version strings for easier modification */ -#define APPVER wxT("0.1.8") +#define APPVER wxT("CVS") #define APPVER_LONG wxT("ShareDaemon wxInterface CVS Version") /* Include wx headers */ @@ -64,7 +64,9 @@ extern class CStatisticsWnd *statisticswnd; extern class CToolBar *toolbar; extern wxConfigBase *m_config; - +#ifdef wxHAS_TASK_BAR_ICON + extern class CSysTray *systray; +#endif /* ID codes for our controls */ enum { ID_BTN_CONNECT = 1000, Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- wxInterface.cpp 23 Nov 2003 18:55:08 -0000 1.6 +++ wxInterface.cpp 27 Nov 2003 08:23:12 -0000 1.7 @@ -60,13 +60,14 @@ m_config->Read(wxT("/General/Show splashscreen"), &show_splash); + /* Display the splashscreen if allowed */ if (show_splash) { - /* Display the splash screen */ splash = new wxSplashScreen( - img->logo, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, + img->GetImage(wxT("splashscreen")), + wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 2000, NULL, -1 ); - } + } // No need to delete splash - it will be deleted by wx Localize(); Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Binary files /tmp/cvs8WD84r and /tmp/cvsqwhALJ differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- wxInterface_wdr.cpp 25 Nov 2003 04:27:08 -0000 1.7 +++ wxInterface_wdr.cpp 27 Nov 2003 08:23:12 -0000 1.8 @@ -259,6 +259,7 @@ wxBoxSizer *item35 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBitmap *item36 = new wxStaticBitmap( parent, ID_SEARCH_RESULTS_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item36->SetName( "searchresults" ); item35->Add( item36, 0, wxALIGN_CENTER|wxALL, 5 ); wxStaticText *item37 = new wxStaticText( parent, ID_TEXT, _("Search Results"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -345,6 +346,7 @@ wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBitmap *item2 = new wxStaticBitmap( parent, ID_SHARED_FILES_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->SetName( "sharedfiles" ); item1->Add( item2, 0, wxALIGN_CENTER|wxTOP|wxBOTTOM, 5 ); wxStaticText *item3 = new wxStaticText( parent, ID_TXT_SHARED, _("Shared Files"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -473,6 +475,7 @@ wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBitmap *item3 = new wxStaticBitmap( parent, ID_FRIEND_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item3->SetName( "friend" ); item2->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 ); wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Friends"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -492,6 +495,7 @@ wxBoxSizer *item7 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBitmap *item8 = new wxStaticBitmap( parent, ID_MESSAGES_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item8->SetName( "messages" ); item7->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 ); wxStaticText *item9 = new wxStaticText( parent, ID_TEXT, _("Messages"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -875,6 +879,7 @@ item2->Add( item4, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item5 = new wxStaticBitmap( parent, ID_BMP_STATUS_USERS, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item5->SetName( "user" ); item2->Add( item5, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item6 = new wxStaticText( parent, ID_STATUS_USERS, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -884,6 +889,7 @@ item2->Add( item7, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item8 = new wxStaticBitmap( parent, ID_BMP_STATUS_FILES, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item8->SetName( "sharedfiles" ); item2->Add( item8, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item9 = new wxStaticText( parent, ID_STATUS_FILES, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -893,6 +899,7 @@ item2->Add( item10, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item11 = new wxStaticBitmap( parent, ID_BMP_STATUS_UPLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item11->SetName( "upload" ); item2->Add( item11, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item12 = new wxStaticText( parent, ID_STATUS_UPLOAD, wxT("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -902,6 +909,7 @@ item2->Add( item13, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item14 = new wxStaticBitmap( parent, ID_BMP_STATUS_DLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item14->SetName( "download" ); item2->Add( item14, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item15 = new wxStaticText( parent, ID_STATUS_DLOAD, _("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -911,6 +919,7 @@ item2->Add( item16, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item17 = new wxStaticBitmap( parent, ID_BMP_STATUS_CONNECTION, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item17->SetName( "disconnected" ); item2->Add( item17, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item18 = new wxStaticText( parent, ID_STATUS_CONNECTION, _("Disconnected"), wxDefaultPosition, wxDefaultSize, 0 ); |
From: <bo...@us...> - 2003-11-26 02:07:07
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv22311 Modified Files: test.cpp Log Message: Added code to scan the whole incoming directory for .part.met files, which in turn are being loaded Index: test.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/test.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- test.cpp 26 Nov 2003 01:22:56 -0000 1.28 +++ test.cpp 26 Nov 2003 02:07:04 -0000 1.29 @@ -591,6 +591,7 @@ int max_partfiles=0; std::string IncomingDirectory="/mnt/Fat_C/gesaugt/Internet/eMule/Incoming"; std::map<std::string,ParseClass *> partfile; +std::vector<std::string> partfilename; void printhash(hash h) { int i; @@ -599,17 +600,20 @@ } bool load_part_met(std::string part_met) { +#ifdef PRINT_PART_MET_ON_LOADING u8 part_met_magic; u32 part_met_date; hash part_met_filehash; u32 part_met_chunkcount; hash part_met_chunkhash; u32 part_met_tagcount; - u32 i; +#endif // #ifdef PRINT_PART_MET_ON_LOADING printf("Loading part file %s ...",part_met.c_str()); + partfilename.push_back(part_met); + ParseClass * & PartFile=partfile[part_met]; if (!PartFile) { @@ -617,6 +621,8 @@ } PartFile->Read(part_met.c_str()); + +#ifdef PRINT_PART_MET_ON_LOADING PartFile->Get(part_met_magic ,"magic"); printf("Magic =0x%02x\n",(unsigned)part_met_magic); PartFile->Get(part_met_date ,"date"); printf("Date =0x%08x\n",(unsigned)part_met_date); PartFile->Get(part_met_filehash ,"filehash"); printf("File hash ="); printhash(part_met_filehash); putchar('\n'); @@ -628,12 +634,32 @@ putchar('\n'); } PartFile->Get(part_met_tagcount ,"tagcount"); printf("Tag count =%u\n",(unsigned)part_met_tagcount); +#endif // #ifdef PRINT_PART_MET_ON_LOADING printf(" done.\n"); return true; } +#include "main-c.h" + +bool load_part_met_wrapper(cstring base, cstring rel, cstring file) { + int sl=strlen(file); + + if (sl<10) return true; + if (strcmp(file+sl-9,".part.met")) return true; + + load_part_met(std::string(base)+"/"+rel+"/"+file); + + return true; +} + +void load_all_part_mets(std::string part_met_base_directory) { + EnumFiles(part_met_base_directory.c_str(),load_part_met_wrapper,NULL,NULL); + +// load_part_met(part_met_base_directory+"/"+"004.part.met"); +} + void parse_something() { server_met_ps=parse_line( "<BYTE>magic<DWORD>num_servers{<IPPORT>ip<DWORD>num_tags<TAG>tag[num_tags]}server[num_servers]" @@ -1174,7 +1200,7 @@ } // print_server_met(); - load_part_met(IncomingDirectory+"/"+"004.part.met"); + load_all_part_mets(IncomingDirectory); u32 clienttcpportid=Connection::Alloc(); |
From: <bo...@us...> - 2003-11-26 02:06:06
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv22181 Modified Files: Makefile.cvs Log Message: Updated Makefile.cvs to list new file main-c.c Index: Makefile.cvs =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Makefile.cvs,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.cvs 26 Nov 2003 01:21:39 -0000 1.12 +++ Makefile.cvs 26 Nov 2003 02:06:02 -0000 1.13 @@ -71,7 +71,7 @@ OBJS = ClientList.oo Client.oo test.oo ClientShadow.oo Socket.oo osdep.oo \ Addr.oo MultiLevelBitmap.oo parse-ed2k.o Ed2kSocket.oo util.oo Ed2kPacket.oo \ -ParseClass.oo mprintf.o Ed2kConnection.oo +ParseClass.oo mprintf.o Ed2kConnection.oo main-c.o test: $(OBJS) $(CXX) $^ $(LDFLAGS) -o $@ |
From: <bo...@us...> - 2003-11-26 02:05:05
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv21992 Added Files: bttypes.h main-c.c main-c.h Log Message: Files for recursive directory scanning --- NEW FILE: bttypes.h --- /* * bttypes.h. Part of the bothie-utils. * * Copyright (C) 2001, 2002, 2003 Bodo Thiesen <bo...@gm...> * * 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 BTTYPES_H #define BTTYPES_H typedef char * string; typedef const char * cstring; # ifndef __cplusplus # ifndef CURSES_H # ifndef bool # define bool int # endif # endif /* #ifndef CURSES_H */ # ifndef false # define false 0 # endif # ifndef true # define true -1 # endif # endif /* ifndef _cplusplus */ #endif // #ifndef BTTYPES_H --- NEW FILE: main-c.c --- /* * main-c.c. Part of the bothie-utils. * * Copyright (C) 2001, 2002, 2003 Bodo Thiesen <bo...@gm...> * * 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 "main-c.h" #include <dirent.h> //#include <errno.h> //#include <fcntl.h> //#include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> //#include <unistd.h> #ifndef S_IFMT # define S_IFMT 0170000 /* These bits determine file type. */ #endif #ifndef S_IFSOCK # define S_IFSOCK 0140000 /* Socket. */ #endif #ifndef S_ISSOCK # define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK)) #endif int lstat(const char *file_name, struct stat *buf); /* * Function char* concat(int n,'n times:'char* str_i); * * Allocates memory and copies the contents of str_i, beginning with the * content of str_0 and finnishing with the content of str_(n-1) to the * newly allocated memory. * * The return value is the address of the new memory area. The latter * must be freed by the caller after use. */ string concat(int n, ...) { va_list ap; int i,string_offset,dest_strlen=1; int* sl; string dest_string; string* str; #ifdef DEBUG bprintf("-> concat\n"); #endif /* * Cache-Variables: Holds the address of the strings, passed as * arguments after 'int n', and their's sizes. * But first allocate them: */ sl =(int *)malloc(sizeof(int )*n); str=(string*)malloc(sizeof(string)*n); if (!sl || !str) { if (sl ) free(sl); if (str) free(str); return NULL; } /* * Walk throw the argument list, and summate the string sizes. * At this time, fill in the determined information in the caches. */ va_start(ap,n); for (i=0;i<n;i++) dest_strlen+=( sl[i]=strlen( str[i]=va_arg(ap,char*) ) ); va_end(ap); /* * Ok, let's allocate the memory for the destination string, ... */ dest_string=(char*)malloc(sizeof(char)*dest_strlen); if (!dest_string) { free(sl); free(str); return NULL; } /* * ... and copy the string's contents together. */ for (i=string_offset=0;i<n;i++) { strcpy(dest_string+string_offset,str[i]); string_offset+=sl[i]; } free(sl); free(str); #ifdef DEBUG bprintf("<- concat\n"); #endif return dest_string; } bool enum_special_inodes=false; void RealEnumFiles( cstring Base, cstring Relative, EnumFunction File, EnumFunction BlockDeviceFunction, EnumFunction CharacterDeviceFunction, EnumFunction PipeFunction, EnumFunction NamedSocketFunction, EnumFunction SymbolicLinkFunction, EnumFunction EnterDirectory, EnumFunction LeaveDirectory ) { DIR *Verzeichnis; struct dirent *Eintrag; struct stat DateiTyp; string SubDirectory,Temp,concat_tmp; Verzeichnis=opendir( concat_tmp=concat( 3, (Base && Base[0])?Base:".", "/", (Relative && Relative[0])?Relative:"." ) ); free(concat_tmp); if (Verzeichnis) { while ((Eintrag=readdir(Verzeichnis))!=0) { if (strcmp(Eintrag->d_name,".") && strcmp(Eintrag->d_name,"..")) { if (Base && Base [0]) { SubDirectory=concat(2,Base,"/"); } else { SubDirectory=concat(1,""); } if (Relative && Relative[0]) { Temp=concat(3,Relative,"/",Eintrag->d_name); } else { Temp=concat(1,Eintrag->d_name); } SubDirectory=concat(2,concat_tmp=SubDirectory,Temp); free(concat_tmp); lstat(SubDirectory,&DateiTyp); /* stat(SubDirectory,&DateiTyp); */ if (S_ISDIR(DateiTyp.st_mode)) { bool EnteringDirectory=true; #ifdef DEBUG bprintf("\tCalling callback-function EnterDirectory\n"); #endif if (EnterDirectory) { EnteringDirectory=EnterDirectory(Base,Relative,Eintrag->d_name); } if (EnteringDirectory) { RealEnumFiles( Base,Temp, File, BlockDeviceFunction, CharacterDeviceFunction, PipeFunction, NamedSocketFunction, SymbolicLinkFunction, EnterDirectory,LeaveDirectory ); if (LeaveDirectory) LeaveDirectory(Base,Relative,Eintrag->d_name); } } else if (S_ISREG(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function File\n"); #endif if (File) File(Base,Relative,Eintrag->d_name); } else if (S_ISBLK(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function BlockDeviceFunction\n"); #endif if (BlockDeviceFunction) BlockDeviceFunction(Base,Relative,Eintrag->d_name); } else if (S_ISCHR(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function CharacterDeviceFunction\n"); #endif if (CharacterDeviceFunction) CharacterDeviceFunction(Base,Relative,Eintrag->d_name); } else if (S_ISFIFO(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function PipeFunction\n"); #endif if (PipeFunction) PipeFunction(Base,Relative,Eintrag->d_name); } else if (S_ISSOCK(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function NamedSocketFunction\n"); #endif if (NamedSocketFunction) NamedSocketFunction(Base,Relative,Eintrag->d_name); } else if (S_ISLNK(DateiTyp.st_mode)) { #ifdef DEBUG bprintf("\tCalling callback-function SymbolicLinkFunction\n"); #endif if (SymbolicLinkFunction) SymbolicLinkFunction(Base,Relative,Eintrag->d_name); } free(SubDirectory); } } closedir(Verzeichnis); } } void EnumFiles(cstring BasePath,EnumFunction FileFunction,EnumFunction BeforeDirectoryFunction,EnumFunction AfterDirectoryFunction) { EnumFunction null=enum_special_inodes?FileFunction:NULL; RealEnumFiles( BasePath,"", FileFunction, null,null,null,null,null, BeforeDirectoryFunction, AfterDirectoryFunction ); } --- NEW FILE: main-c.h --- /* * main-c.h. Part of the bothie-utils. * * Copyright (C) 2001, 2002, 2003 Bodo Thiesen <bo...@gm...> * * 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 MAIN_C_H #define MAIN_C_H #include "bttypes.h" typedef bool (*EnumFunction)(cstring,cstring,cstring); #ifdef __cplusplus extern "C" { #endif // #ifdef __cplusplus string concat(int n,...); void EnumFiles(cstring BasePath,EnumFunction FileFunction,EnumFunction BeforeDirectoryFunction,EnumFunction AfterDirectoryFunction); string concat_filename(cstring BasePath,cstring RelativePath,cstring FileName); string read_entire_file(int fd,int * size); #ifdef __cplusplus }; #endif // #ifdef __cplusplus #endif // #ifndef MAIN_C_H |
From: <bo...@us...> - 2003-11-26 02:03:39
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv21800 Modified Files: ParseClass.cpp Log Message: Allow zero-sized arrays Index: ParseClass.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/ParseClass.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ParseClass.cpp 26 Nov 2003 01:22:56 -0000 1.10 +++ ParseClass.cpp 26 Nov 2003 02:03:36 -0000 1.11 @@ -234,7 +234,7 @@ assert(size); tmp=reinterpret_cast<unsigned char*>(realloc(data,size*n)); - if (!tmp) { + if (!tmp && n) { fprintf( stderr, "%s:%s:%i: realloc failed\n", |
From: <bo...@us...> - 2003-11-26 01:23:00
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv14868 Modified Files: Ed2kConnection.h ParseClass.cpp ParseClass.h parse-ed2k.c test.cpp Log Message: Pre-support of sending the OfferFile packet to the server Index: Ed2kConnection.h =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Ed2kConnection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Ed2kConnection.h 20 Nov 2003 16:27:25 -0000 1.3 +++ Ed2kConnection.h 26 Nov 2003 01:22:56 -0000 1.4 @@ -40,6 +40,7 @@ // Accepted connections on tcp serverport: SERVER_TCP_SENDING_LOGIN_REQUEST, SERVER_TCP_WAITING_FOR_LOGIN_ANSWER, + SERVER_TCP_INITIAL_OFFER_FILES, // Our udp serverport listening for incoming connections SERVER_UDP_LISTENING, // we are contacting a server: Index: ParseClass.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/ParseClass.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ParseClass.cpp 22 Nov 2003 02:41:25 -0000 1.9 +++ ParseClass.cpp 26 Nov 2003 01:22:56 -0000 1.10 @@ -199,7 +199,7 @@ tmp=ps->first_referer+ps->num_referer; numPCs=numPCs>tmp?numPCs:tmp; - size=ps->offset+ps->size+(numPCs?sizeof(ParseClass*):0); + size=ps->offset+ps->size+numPCs*sizeof(ParseClass*); } else { if (IsStruct()) { assert(!IsStruct()); @@ -211,22 +211,23 @@ return; } +ParseClass * * ParseClass::FirstParseClassPointer(unsigned idx) const { + return (ParseClass**)(data+size*(idx+1)-sizeof(ParseClass*)*numPCs); +} + void ParseClass::Resize(size_t n) { unsigned char * tmp; - size_t offset,i,p; + size_t i,p; const struct parsestruct * ps; // printf(">> Resize(n=%i), size=%i\n",n,size); if (numPCs && n<nume) { - offset=size-sizeof(ParseClass*); - for (i=n;i<nume;++i) { - ParseClass * PC=(*(ParseClass**)(data+size*i+offset)); + ParseClass * * PC=FirstParseClassPointer(i); for (p=0;p<numPCs;++p,++PC) { - PC->~ParseClass(); + (*PC)->~ParseClass(); } - free(*(ParseClass**)(data+size*i+offset)); } } @@ -244,27 +245,23 @@ data=tmp; if (numPCs && n>nume) { - offset=size-sizeof(ParseClass*); int * constructed=new int[numPCs]; for (i=nume;i<n;++i) { - class ParseClass * PCp=reinterpret_cast<ParseClass*>( - malloc(sizeof(ParseClass)*numPCs) - ); + class ParseClass * * PC=FirstParseClassPointer(i); for (size_t j=0;j<numPCs;++j) constructed[j]=0; - *(ParseClass**)(data+size*i+offset)=PCp; for (ps=type;ps;ps=ps->next) { if (ps->flags&PF_ARRAY0 || ps->type_id==STRUCT) { assert(ps->referer_id<numPCs); if (ps->type_id==STRUCT) { - new (PCp+ps->referer_id) + (*(PC+ps->referer_id))=new ParseClass(this,reinterpret_cast< struct parsestruct * >(ps->default_value)); } else { - new (PCp+ps->referer_id) + (*(PC+ps->referer_id))=new ParseClass(this,ps); } assert (!constructed[ps->referer_id]); @@ -449,10 +446,6 @@ exit(1); } -ParseClass * ParseClass::FirstParseClassPointer(int idx) { - return *(ParseClass**)(data+size*(idx+1)-sizeof(ParseClass*)*numPCs); -} - size_t ParseClass::IncrementalReadNonArray( const u8 * buffer,size_t buffsize ) { @@ -519,12 +512,12 @@ if (num) { size_t call_done; - ParseClass * PC; + ParseClass * * PC; PC=FirstParseClassPointer(i); PC+=ps->referer_id; - call_done=PC->IncrementalRead( + call_done=(*PC)->IncrementalRead( buffer,buffsize,num ); if (call_done==(size_t)-1) { @@ -543,10 +536,10 @@ */ } } else { - ParseClass * PC; - u32 val; - unsigned j; - bool scalar; + ParseClass * * PC; + u32 val; + unsigned j; + bool scalar; /* printf("."); fflush(stdout); @@ -578,8 +571,9 @@ } PC=FirstParseClassPointer(i); + PC+=ps->first_referer; for (j=0;j<ps->num_referer;++j,++PC) { - PC->Resize(val); + (*PC)->Resize(val); } } Index: ParseClass.h =================================================================== RCS file: /cvsroot/sharedaemon/core/src/ParseClass.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ParseClass.h 22 Nov 2003 02:50:17 -0000 1.9 +++ ParseClass.h 26 Nov 2003 01:22:56 -0000 1.10 @@ -220,7 +220,7 @@ /* * Helpers for IncrementalRead. */ - ParseClass * FirstParseClassPointer(int idx); + ParseClass * * FirstParseClassPointer(unsigned idx) const; size_t IncrementalReadNonArray(const u8 * buffer,size_t buffsize); size_t IncrementalReadArray(const u8 * buffer,size_t buffsize); @@ -322,12 +322,11 @@ abort(); } } else { - ParseClass * PC=*(ParseClass**) - (data+size*(index+1)-sizeof(ParseClass*)); + ParseClass * * PC=FirstParseClassPointer(index); if (struc) { - PC[ps->referer_id].Get(var,next_index,subexpr); + PC[ps->referer_id]->Get(var,next_index,subexpr); } else { - var=*(T*)(PC->data+PC->size*next_index); + var=*(T*)(PC[ps->referer_id]->data+PC[ps->referer_id]->size*next_index); } } } Index: parse-ed2k.c =================================================================== RCS file: /cvsroot/sharedaemon/core/src/parse-ed2k.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- parse-ed2k.c 20 Nov 2003 16:27:25 -0000 1.13 +++ parse-ed2k.c 26 Nov 2003 01:22:56 -0000 1.14 @@ -784,7 +784,9 @@ printf("STRUCT w/o ARRAY!\n"); i->referer_id=max_referer++; } else { +/* i->referer_id=0; +*/ } } } Index: test.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/test.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- test.cpp 22 Nov 2003 02:46:32 -0000 1.27 +++ test.cpp 26 Nov 2003 01:22:56 -0000 1.28 @@ -543,40 +543,6 @@ return true; } -#define RD_1_ARG(function,need,arg1) do { \ - if (need<=buffered) { \ - rc=(function)(buffer+offset,arg1); \ - } else { \ - rc=-1; \ - } \ - if (-1==rc && fill_buffer(file,buffer,BUFFER_SIZE,offset,&buffered)) { \ - offset=0; \ - if (need<=buffered) { \ - rc=(function)(buffer+offset,arg1); \ - } else { \ - rc=-1; \ - } \ - } \ - if (-1==rc) return false; \ - buffered-=rc; \ - offset+=rc; \ -} while (0) - -#define RDLONG(argument) RD_1_ARG(rdlong,4,argument) -#define RDWORD(argument) RD_1_ARG(rdword,2,argument) -#define RDBYTE(argument) RD_1_ARG(rdbyte,1,argument) -#define RDTAG(argument) do { \ - rc=rdtag(buffer+offset,argument,buffered); \ - if (-1==rc && fill_buffer(file,buffer,BUFFER_SIZE,offset,&buffered)) { \ - offset=0; \ - rc=rdtag(buffer+offset,argument,buffered); \ - } \ - if (-1==rc) return false; \ - buffered-=rc; \ - offset+=rc; \ -} while (0) - - #define BUFFER_SIZE 4096 #define load_server_met new_load_server_met @@ -591,10 +557,7 @@ struct tag * tp; u32 nt; - fprintf(stderr,">>ServerMet->Read(server_met)\n"); ServerMet->Read(server_met); - fprintf(stderr,"<<ServerMet->Read(server_met)\n"); - ServerMet->Get(server_met_magic,"magic"); ServerMet->Get(num_servers,"num_servers"); @@ -623,25 +586,137 @@ } struct parsestruct * server_met_ps; +struct parsestruct * part_met_ps; +int num_partfiles=0; +int max_partfiles=0; +std::string IncomingDirectory="/mnt/Fat_C/gesaugt/Internet/eMule/Incoming"; +std::map<std::string,ParseClass *> partfile; + +void printhash(hash h) { + int i; + + for (i=0;i<16;++i) printf("%02X",h.b[i]); +} + +bool load_part_met(std::string part_met) { + u8 part_met_magic; + u32 part_met_date; + hash part_met_filehash; + u32 part_met_chunkcount; + hash part_met_chunkhash; + u32 part_met_tagcount; + + u32 i; + + printf("Loading part file %s ...",part_met.c_str()); + + ParseClass * & PartFile=partfile[part_met]; + + if (!PartFile) { + PartFile=new ParseClass(part_met_ps); + } + + PartFile->Read(part_met.c_str()); + PartFile->Get(part_met_magic ,"magic"); printf("Magic =0x%02x\n",(unsigned)part_met_magic); + PartFile->Get(part_met_date ,"date"); printf("Date =0x%08x\n",(unsigned)part_met_date); + PartFile->Get(part_met_filehash ,"filehash"); printf("File hash ="); printhash(part_met_filehash); putchar('\n'); + PartFile->Get(part_met_chunkcount,"chunkcount"); printf("Chunk count=%u\n",(unsigned)part_met_chunkcount); + for (i=0;i<part_met_chunkcount;++i) { + PartFile->GetF(part_met_chunkhash,"chunkhash[%i]",(unsigned)i); + printf("\tChunk hash[%u]=",(unsigned)i); + printhash(part_met_chunkhash); + putchar('\n'); + } + PartFile->Get(part_met_tagcount ,"tagcount"); printf("Tag count =%u\n",(unsigned)part_met_tagcount); + + printf(" done.\n"); + + return true; +} void parse_something() { server_met_ps=parse_line( "<BYTE>magic<DWORD>num_servers{<IPPORT>ip<DWORD>num_tags<TAG>tag[num_tags]}server[num_servers]" ); + part_met_ps=parse_line( + /* + * According to eDonkey-protocol-0.6.1, the field magic is + * 0xe1 (or 0xe0 for old clients). + */ + "<BYTE>magic<DWORD>date<HASH>filehash" + /* + * According to eDonkey-protocol-0.6.1, there are existing + * broken clients, which doubles the list of chunkhashs. + * So, numchunks may be 2*real_num_chunks. Keep this in mind. + */ + "<WORD>chunkcount<HASH>chunkhash[chunkcount]" + "<DWORD>tagcount<TAG>tag[tagcount]" + ); + /* print_parsestruct(server_met_ps,0); */ + print_parsestruct(part_met_ps,0); ServerMet=new ParseClass(server_met_ps); } -// class Connection Connection::empty; -int num_connected=0; +/* +3.2. part.met +------------------------- +<part.met> ::= 0xe1 <File details> // 0xe0 in older versions +<File details> ::= <Date> <File hash> <Part hash list> <Meta tag list> +<Date> ::= DWORD + +<Meta tag list> ::= DWORD <Meta tag>* +<Meta tag> ::= 0x00 Undefined + ||= 0x01 <Meta tag name> HASH + ||= 0x02 <Meta tag name> <String> + ||= 0x03 <Meta tag name> DWORD + ||= 0x04 <Meta tag name> FLOAT + ||= 0x05 <Meta tag name> BOOL // ?? + ||= 0x06 <Meta tag name> BOOL Array // ?? + ||= 0x07 <Meta tag name> BLOB // ?? +<Meta tag name> ::= WORD <Special tag> // WORD is the number of bytes in <Special tag> + ||= <String> +<Special tag> ::= 0x01 // name + ||= 0x02 // size: size of file + ||= 0x03 // type: Audio, Video, Image, Pro, Doc, Col + ||= 0x04 // format: file extension + ||= 0x05 // Collection (depricated) // ?? + ||= 0x06 // Part Path // ?? + ||= 0x07 // Part Hash // ?? + ||= 0x08 // copied + ||= 0x09 DATA // gap start: DATA keeps number of gap as string + ||= 0x0a DATA // gap end: DATA keeps number of gap as string + ||= 0x0b // description + ||= 0x0c // ping + ||= 0x0d // fail + ||= 0x0e // preference + ||= 0x0f // port + ||= 0x10 // ip + ||= 0x11 // version + ||= 0x12 // tempfile + ||= 0x13 // priority + ||= 0x14 // status + ||= 0x15 // availability + ||= 0x16 // QTime // ?? + ||= 0x17 // Parts // ?? + ||= <eMule special tag> + +<eMule special tag> ::= 0x20 // Compression + ||= 0x21 // UDP client port + ||= 0x22 // UDP version + ||= 0x23 // Source exchange + ||= 0x24 // Comments + ||= 0x25 // Extended request + ||= 0x26 // Compatible client +*/ std::map<std::string,ParseClass *> PClist; -void Log(char * msg) { +void Log(const char * msg) { struct tm * t; time_t tmp; @@ -651,6 +726,24 @@ printf("%04u-%02u-%02u %02u:%02u'%02u: %s\n",1900+t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec,msg); } +void LogF(const char * fmt,...) { + char * msg; + va_list ap; + + va_start(ap,fmt); + msg=vmprintf(fmt,ap); + va_end(ap); + + Log(msg); +} + +// class Connection Connection::empty; + +int num_connected=0; +int max_connected=0; +u32 * OurClientID=NULL; +u32 * connection_id=NULL; + void Client_Tcp_Sending_Hello_Packet(u32 id) { bool rc; Ed2kPacket p; @@ -766,18 +859,25 @@ return false; } + char proto_opcode[5]; + + sprintf( + proto_opcode, + "%04x", + (unsigned)((u16)p.GetProtocol()*0x100+p.GetOpcode()) + ); + + if (!PClist[proto_opcode]) PClist[proto_opcode]=new ParseClass(ps); + PC=PClist[proto_opcode]; + PC->Read(p.GetPtr(),p.GetSize()); + switch ((u16)p.GetProtocol()*0x100+p.GetOpcode()) { case 0xe338: // Servermessage u16 msglen,i; char * msg; - if (!PClist["e338"]) { - PClist["e338"]=new ParseClass(ps); - } - PC=PClist["e338"]; printf("Servermessage:\n"); // Log Message. - PC->Read(p.GetPtr(),p.GetSize()); PC->Get(msglen,"message_len"); printf("msglen=%u\n",msglen); msg=new char[msglen+1]; @@ -786,19 +886,58 @@ } msg[i]=0; Log(msg); + delete msg; break; case 0xe334: // Serverstatus printf("Serverstatus:\n"); - printf("%s:%i: \n",__FILE__,__LINE__); HexDump(p.GetPtr(),p.GetSize(),false); // Update ServerMet // Schedule ServerMet to write back to disk break; case 0xe340: // IDchange printf("IDchange:\n"); - printf("%s:%i: \n",__FILE__,__LINE__); HexDump(p.GetPtr(),p.GetSize(),false); - // ??? + if (num_connected) { + Log("Duh, we are already connected.\n"); + } + if (num_connected==max_connected) { + max_connected=1+2*max_connected; + OurClientID =(u32*)realloc(OurClientID , + max_connected*sizeof(*OurClientID )); + connection_id=(u32*)realloc(connection_id, + max_connected*sizeof(*connection_id)); + if (!OurClientID || !connection_id) { + LogF( + "%s:%s:%i: FATAL: " + "Out of memory.\n" + ,__FILE__,__FUNCTION__,__LINE__ + ); + } + } + connection_id[num_connected]=id; + PC->Get(OurClientID[num_connected],"new_id"); + char * tmp,*t; + if (OurClientID[num_connected]<0x1000000) { + t=strdup("LowID"); + } else { + t=mprintf( + "%u.%u.%u.%u" + ,( OurClientID[num_connected] &255) + ,((OurClientID[num_connected]>> 8)&255) + ,((OurClientID[num_connected]>>16)&255) + ,((OurClientID[num_connected]>>24)&255) + ); + } + tmp=mprintf( + "We are connected now. " + "New client ID is %u (%s)" + ,OurClientID[num_connected],t + ); + free(t); + Log(tmp); + free(tmp); + Connection::SetStatus(id,SERVER_TCP_INITIAL_OFFER_FILES); + ++num_connected; break; case 0xe341: // ServerIdent @@ -873,6 +1012,10 @@ Connection::GetSocket(id).Close(); Connection::SetStatus(id,ILLEGAL); Connection::Free(id); + LogF( + "Connection lost. [ID %u]" + ,id + ); return; } } @@ -1031,6 +1174,8 @@ } // print_server_met(); + load_part_met(IncomingDirectory+"/"+"004.part.met"); + u32 clienttcpportid=Connection::Alloc(); rc=ClientTcpListen(clienttcpportid,DEFAULT_CLIENTPORT); @@ -1059,6 +1204,11 @@ ip=server[serverindex].ip; port=server[serverindex].port; } + LogF( + "Trying to connect to %u.%u.%u.%u:%u ... [ID %u]" + ,(ip>>24)&255,(ip>>16)&255,(ip>>8)&255,ip&255 + ,port,serverid + ); rc=ServerTcpConnect(serverid,ip,port); printf( "ServerTcpConnect(ip=%u.%u.%u.%u,port=%u)=%i\n" @@ -1068,7 +1218,13 @@ ,(unsigned)((ip )&255) ,(unsigned)port,rc ); - if (!rc) Connection::Free(serverid); + if (!rc) { + Connection::Free(serverid); + LogF( + "Connection could not be established. [ID %u]" + ,serverid + ); + } } } |
From: <bo...@us...> - 2003-11-26 01:21:43
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv14546 Modified Files: Makefile.cvs Log Message: Improved Makefile.cvs (now Win32 executables get extension .exe) Index: Makefile.cvs =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Makefile.cvs,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.cvs 22 Nov 2003 03:22:56 -0000 1.11 +++ Makefile.cvs 26 Nov 2003 01:21:39 -0000 1.12 @@ -18,8 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -all: test - CPPFLAGS = # Ok, you have to tell me, what OS you are using @@ -52,8 +50,19 @@ CXX = g++ -b i686-mingw32msvc CC = gcc -b i686-mingw32msvc LDFLAGS += -lwsock32 +BINARY = test.exe +endif + +ifdef LINUX +BINARY = test +endif + +ifdef MAXOSX +BINARY = test endif +all: $(BINARY) + CFLAGS += -g -Wall -O3 -std=c99 CXXFLAGS += -g -Wall -O3 CPPFLAGS += -DXMULE2 @@ -65,6 +74,9 @@ ParseClass.oo mprintf.o Ed2kConnection.oo test: $(OBJS) + $(CXX) $^ $(LDFLAGS) -o $@ + +test.exe: $(OBJS) $(CXX) $^ $(LDFLAGS) -o $@ %.o: %.c |
From: <ma...@us...> - 2003-11-25 08:35:38
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv32745 Modified Files: MainDlg.cpp Log Message: Layout mainframe after (re)creating toolbar. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- MainDlg.cpp 24 Nov 2003 14:21:58 -0000 1.11 +++ MainDlg.cpp 25 Nov 2003 04:19:47 -0000 1.12 @@ -112,7 +112,7 @@ /* Load dialog pages */ LoadAndShowDialogPages(); - /* Generate images for toolbar */ + /* Generate toolbar images if needed */ #if !defined(__WXGTK__) img->MakeToolImages(); #endif @@ -311,6 +311,8 @@ if (activewnd == statisticswnd) { tb->ToggleTool(ID_BTN_STATISTICS, true); } + + Layout(); } /** |
From: <ma...@us...> - 2003-11-25 06:29:40
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1659 Modified Files: wxInterface_wdr.cpp wxInterface.wdr Log Message: Adds some extra space between controls to statusbar. Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- wxInterface_wdr.cpp 24 Nov 2003 16:06:32 -0000 1.6 +++ wxInterface_wdr.cpp 25 Nov 2003 04:27:08 -0000 1.7 @@ -869,52 +869,52 @@ item2->AddGrowableCol( 0 ); wxStaticText *item3 = new wxStaticText( parent, ID_STATUS_TXT, _("ShareDaemon wxInterface ready!"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL, 5 ); + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); item2->Add( item4, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item5 = new wxStaticBitmap( parent, ID_BMP_STATUS_USERS, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item5, 0, wxALIGN_CENTER, 5 ); + item2->Add( item5, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item6 = new wxStaticText( parent, ID_STATUS_USERS, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item6, 0, wxALIGN_CENTER, 5 ); + item2->Add( item6, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); wxStaticLine *item7 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); item2->Add( item7, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item8 = new wxStaticBitmap( parent, ID_BMP_STATUS_FILES, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item8, 0, wxALIGN_CENTER, 5 ); + item2->Add( item8, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item9 = new wxStaticText( parent, ID_STATUS_FILES, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item9, 0, wxALIGN_CENTER, 5 ); + item2->Add( item9, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); wxStaticLine *item10 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); item2->Add( item10, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item11 = new wxStaticBitmap( parent, ID_BMP_STATUS_UPLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item11, 0, wxALIGN_CENTER, 5 ); + item2->Add( item11, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item12 = new wxStaticText( parent, ID_STATUS_UPLOAD, wxT("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item12, 0, wxALIGN_CENTER, 5 ); + item2->Add( item12, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); wxStaticLine *item13 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); item2->Add( item13, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item14 = new wxStaticBitmap( parent, ID_BMP_STATUS_DLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item14, 0, wxALIGN_CENTER, 5 ); + item2->Add( item14, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item15 = new wxStaticText( parent, ID_STATUS_DLOAD, _("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item15, 0, wxALIGN_CENTER, 5 ); + item2->Add( item15, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); wxStaticLine *item16 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); item2->Add( item16, 0, wxALIGN_CENTER, 5 ); wxStaticBitmap *item17 = new wxStaticBitmap( parent, ID_BMP_STATUS_CONNECTION, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item17, 0, wxALIGN_CENTER, 5 ); + item2->Add( item17, 0, wxALIGN_CENTER|wxLEFT, 5 ); wxStaticText *item18 = new wxStaticText( parent, ID_STATUS_CONNECTION, _("Disconnected"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item18, 0, wxALIGN_CENTER, 5 ); + item2->Add( item18, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Binary files /tmp/cvsgd4KJq and /tmp/cvseidotJ differ |
From: <ma...@us...> - 2003-11-25 06:29:24
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv602 Modified Files: MainDlg.cpp MainDlg.h Log Message: Update menubar view section on page changing. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- MainDlg.cpp 25 Nov 2003 04:19:47 -0000 1.12 +++ MainDlg.cpp 25 Nov 2003 04:21:14 -0000 1.13 @@ -130,6 +130,8 @@ * Destructor for MainDlg. */ CMainDlg::~CMainDlg() { + short startpage = 0; + int remember_last; /** * Don't save the settings if we are iconized, otherwise we save our * size and position to nulls or smth, and it seriously screws us on @@ -151,11 +153,9 @@ * serverwnd, 1 for transferwnd etc, thus matching the codes we use * from CGUISettingsDlg class. */ - int remember_last; m_config->SetPath(wxT("/General")); m_config->Read(wxT("Remember last"), &remember_last, true); if (remember_last) { - short startpage; if (GetCurPage() == serverwnd) startpage = 0; if (GetCurPage() == searchwnd) startpage = 1; if (GetCurPage() == transferwnd) startpage = 2; @@ -549,6 +549,31 @@ } /** + * Here we update menubar view menu radio buttons. + */ +void CMainDlg::UpdateMenuBar() { +#ifdef wxHAS_RADIO_MENU_ITEMS + if (GetMenuBar() == NULL) { + return; + } + + if (GetCurPage() == serverwnd) { + GetViewServerWnd()->Check(); + } else if (GetCurPage() == searchwnd) { + GetViewSearchWnd()->Check(); + } else if (GetCurPage() == transferwnd) { + GetViewTransferWnd()->Check(); + } else if (GetCurPage() == sharedfileswnd) { + GetViewSharedWnd()->Check(); + } else if (GetCurPage() == messageswnd) { + GetViewMessagesWnd()->Check(); + } else if (GetCurPage() == statisticswnd) { + GetViewStatisticsWnd()->Check(); + } +#endif +} + +/** * We handle menubar events here. */ void CMainDlg::MenuEvent(wxCommandEvent &event) { @@ -649,6 +674,7 @@ ToolEvent(event); MenuEvent(event); UpdateToolButtons(); + UpdateMenuBar(); } else { event.Skip(); } Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MainDlg.h 24 Nov 2003 16:06:31 -0000 1.6 +++ MainDlg.h 25 Nov 2003 04:21:14 -0000 1.7 @@ -106,15 +106,19 @@ bool ShowPage(wxWindow* dlg); void ShowGUISettingsDlg(); void UpdateToolButtons(); + void UpdateMenuBar(); wxWindow* GetCurPage() { return activewnd; } /* Getters */ - wxMenuItem* GetViewMenuBar() { - return GetMenuBar()->FindItem(ID_VIEW_MENUBAR); - } - wxMenuItem* GetViewToolBar() { - return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR); - } + wxMenuItem* GetViewMenuBar() {return GetMenuBar()->FindItem(ID_VIEW_MENUBAR);} + wxMenuItem* GetViewToolBar() {return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR);} + wxMenuItem* GetViewServerWnd() {return GetMenuBar()->FindItem(ID_VIEW_SERVERS);} + wxMenuItem* GetViewSearchWnd() {return GetMenuBar()->FindItem(ID_VIEW_SEARCH);} + wxMenuItem* GetViewTransferWnd() {return GetMenuBar()->FindItem(ID_VIEW_TRANSFER);} + wxMenuItem* GetViewSharedWnd() {return GetMenuBar()->FindItem(ID_VIEW_SHARED_FILES);} + wxMenuItem* GetViewMessagesWnd() {return GetMenuBar()->FindItem(ID_VIEW_MESSAGES);} + wxMenuItem* GetViewStatisticsWnd() {return GetMenuBar()->FindItem(ID_VIEW_STATISTICS);} + wxStaticBitmap* GetBmpStatusConnection() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_CONNECTION ); } wxStaticBitmap* GetBmpStatusDload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_DLOAD ); } wxStaticBitmap* GetBmpStatusUpload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_UPLOAD ); } |
From: <ma...@us...> - 2003-11-25 06:28:42
|
Update of /cvsroot/sharedaemon/ui-wx/src/lang In directory sc8-pr-cvs1:/tmp/cvs-serv32642 Modified Files: Estonian.po German.po empty.po Log Message: Updated language files. Index: Estonian.po =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/lang/Estonian.po,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Estonian.po 9 Sep 2003 08:27:59 -0000 1.2 +++ Estonian.po 25 Nov 2003 04:18:59 -0000 1.3 @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-09-09 01:09+0300\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2003-11-24 20:00+0200\n" "PO-Revision-Date: 2003-09-09 01:10+0300\n" "Last-Translator: Alo Sarv <ma...@us...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -14,21 +15,16 @@ "Content-Type: text/plain; charset=iso-8859-1\n" [...1180 lines suppressed...] +#~ msgid "Restart needed" +#~ msgstr "Vajab taaskäivitust" + +#~ msgid "xMule v2 ready!" +#~ msgstr "xMule v2 valmis!" + +#~ msgid "Change GUI Settings" +#~ msgstr "Muuda kasutajaliidese seadeid" + +#~ msgid "Change Core Settings" +#~ msgstr "Muuda Tuuma Seadeid" + +#~ msgid "User Interface Settings" +#~ msgstr "Kasutajaliidese seaded" + +#~ msgid "Close xmule2-ui-wx?" +#~ msgstr "Sulge xmule2+ui+wx?" + +#~ msgid "Server Info" +#~ msgstr "Serveri info" Index: German.po =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/lang/German.po,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- German.po 9 Sep 2003 08:27:59 -0000 1.3 +++ German.po 25 Nov 2003 04:18:59 -0000 1.4 @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-09-09 01:09+0300\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2003-11-24 20:00+0200\n" "PO-Revision-Date: 2003-09-09 01:25+0300\n" "Last-Translator: Alo Sarv <ma...@us...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -14,21 +15,16 @@ "Content-Type: text/plain; charset=iso-8859-1\n" [...1181 lines suppressed...] +#~ msgid "Restart needed" +#~ msgstr "Neustart erfoderlich" + +#~ msgid "xMule v2 ready!" +#~ msgstr "xMule v2 bereit!" + +#~ msgid "Change GUI Settings" +#~ msgstr "GUI Einstellungen ändern" + +#~ msgid "Change Core Settings" +#~ msgstr "Kern Einstellungen ändern" + +#~ msgid "User Interface Settings" +#~ msgstr "User Interface Einstellungen" + +#~ msgid "Close xmule2-ui-wx?" +#~ msgstr "xmule2+ui+wx beenden?" + +#~ msgid "Server Info" +#~ msgstr "Server Info" Index: empty.po =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/lang/empty.po,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- empty.po 9 Sep 2003 08:27:59 -0000 1.1 +++ empty.po 25 Nov 2003 04:18:59 -0000 1.2 @@ -7,7 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-09-09 01:43+0300\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2003-11-24 20:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -23,8 +24,8 @@ msgid "Size" [...993 lines suppressed...] +"The iconset files must be in PNG format and filenames must\n" +"match what they are in other sets. The files are looked for\n" +"in the images/youriconsetname (lowercased!). So if your\n" +"iconset name is MyNewIconSet, it will be looked for in\n" +"images/mynewiconset dir." msgstr "" -#: xMuleGUI_wdr.cpp:1239 -msgid "Apply changes" +#: wxInterface_wdr.cpp:871 +msgid "ShareDaemon wxInterface ready!" +msgstr "" + +#: wxInterface_wdr.cpp:907 +msgid "0 kb/s" +msgstr "" + +#: wxInterface_wdr.cpp:916 +msgid "Disconnected" msgstr "" |
From: <ma...@us...> - 2003-11-24 17:34:07
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv6325 Added Files: AUTHORS Log Message: authors file :) --- NEW FILE: AUTHORS --- ################################### # ShareDaemon wxInterface Authors # ################################### Original code author: Alo Sarv <ma...@us...> |
From: <ma...@us...> - 2003-11-24 16:07:21
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv18875 Modified Files: Changelog Log Message: checkboxes fix Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- Changelog 24 Nov 2003 15:27:23 -0000 1.97 +++ Changelog 24 Nov 2003 16:07:19 -0000 1.98 @@ -23,6 +23,8 @@ 2003/11/24 Alo Sarv * New splashscreen by Avi Vahl. * New statusbar that works and looks the same on all platforms. + * Finally fixed win32 checkboxes. Now dialogs look good on wxMSW + and wxX11. 2003/11/23 Alo Sarv * ToolBar images are now generated during runtime and texts added |
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv18724 Modified Files: DownloadListCtrl.h GUISettingsDlg.cpp GUISettingsDlg.h KnownListCtrl.h MainDlg.h MessagesWnd.h QueueListCtrl.h SearchListCtrl.h ServerListCtrl.h ServerWnd.cpp ServerWnd.h SharedFilesListCtrl.h SharedFilesWnd.h StatisticsTreeCtrl.h TransferWnd.h UploadListCtrl.h defines.h wxInterface.wdr wxInterface_wdr.cpp wxInterface_wdr.h Log Message: Finally fixed win32 checkboxes by moving relevant control generation functions out from wxDesigner generated code and ifdefing flags as neccesery. Now works perfectly on wxMSW and wxX11. Index: DownloadListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/DownloadListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DownloadListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ DownloadListCtrl.h 24 Nov 2003 16:06:31 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CDownloadListCtrl: public CMListCtrl { Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- GUISettingsDlg.cpp 23 Nov 2003 12:14:52 -0000 1.20 +++ GUISettingsDlg.cpp 24 Nov 2003 16:06:31 -0000 1.21 @@ -52,7 +52,7 @@ wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize &size, long style ) : wxDialog(parent, id, title, position, size, style) { - Dlg_GUI_Settings(this, true, true); + CreateControls(); Center(); LoadSettings(); @@ -348,6 +348,182 @@ GetIconSet()->Delete(GetIconSet()->GetSelection()); } GetIconSet()->SetSelection(0); +} + +void CGUISettingsDlg::CreateControls() { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxGridSizer *item1 = new wxGridSizer( 2, 0, 0, 0 ); + + wxStaticBox *item3 = new wxStaticBox( this, -1, _("Language") ); + wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL ); + + wxString *strs4 = (wxString*) NULL; + wxChoice *item4 = new wxChoice( this, ID_LANG, wxDefaultPosition, wxSize(100,-1), 0, strs4, 0 ); +#ifndef __WXX11__ + item4->SetToolTip( _("Change the language of the interface. Requires interface restart to take effect") ); +#endif + item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxGridSizer *item5 = new wxGridSizer( 2, 0, 0 ); + + wxButton *item6 = new wxButton( this, ID_BTN_ADDLANG, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Add new language") ); +#endif + item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxButton *item7 = new wxButton( this, ID_BTN_REMOVELANG, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item7->SetToolTip( _("Remove currently selected language") ); +#endif + item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); + + item2->Add( item5, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item2, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + wxStaticBox *item9 = new wxStaticBox( this, -1, _("Icon set") ); + wxStaticBoxSizer *item8 = new wxStaticBoxSizer( item9, wxVERTICAL ); + + wxString *strs10 = (wxString*) NULL; + wxChoice *item10 = new wxChoice( this, ID_ICONSET, wxDefaultPosition, wxSize(100,-1), 0, strs10, 0 ); +#ifndef __WXX11__ + item10->SetToolTip( _("Change the iconet the interface should use. Requires restart to take effect") ); +#endif + item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxGridSizer *item11 = new wxGridSizer( 2, 0, 0 ); + + wxButton *item12 = new wxButton( this, ID_BTN_ADDICONSET, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item12->SetToolTip( _("Add new iconset") ); +#endif + item11->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxButton *item13 = new wxButton( this, ID_BTN_REMOVEICONSET, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item13->SetToolTip( _("Remove currently selected iconset") ); +#endif + item11->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 ); + + item8->Add( item11, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item8, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxFlexGridSizer *item14 = new wxFlexGridSizer( 2, 0, 0 ); + + wxStaticBox *item16 = new wxStaticBox( this, -1, _("Font") ); + wxStaticBoxSizer *item15 = new wxStaticBoxSizer( item16, wxVERTICAL ); + + wxString strs17[] = { + _("Default") + }; + wxChoice *item17 = new wxChoice( this, ID_FONT, wxDefaultPosition, wxSize(100,-1), 1, strs17, 0 ); +#ifndef __WXX11__ + item17->SetToolTip( _("Change the font") ); +#endif + item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxStaticText *item18 = new wxStaticText( this, ID_TEXT, _("Font Test :)"), wxDefaultPosition, wxDefaultSize, 0 ); + item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 ); + + item14->Add( item15, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + wxStaticBox *item20 = new wxStaticBox( this, -1, _("Startup page") ); + wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); + + wxString strs21[] = { + _("Server"), + _("Transfer"), + _("Search"), + _("Shared Files"), + _("Messages"), + _("Statistics") + }; + wxChoice *item21 = new wxChoice( this, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1), 6, strs21, 0 ); +#ifndef __WXX11__ + item21->SetToolTip( _("Set which page will be displayed on program startup") ); +#endif + item19->Add( item21, 0, wxGROW|border_style, 5 ); + + wxCheckBox *item22 = new wxCheckBox( this, ID_REMEMBER_LAST, _("Remember last"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item22->SetToolTip( _("Automatically remember which page was open between sessions") ); +#endif + item19->Add( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item14->Add( item19, 0, wxLEFT|wxRIGHT, 5 ); + + item0->Add( item14, 0, 0, 5 ); + + wxBoxSizer *item23 = new wxBoxSizer( wxVERTICAL ); + + wxCheckBox *item24 = new wxCheckBox( this, ID_SHOWSPLASH, _("Show splashscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + item24->SetValue( TRUE ); +#ifndef __WXX11__ + item24->SetToolTip( _("Toggle wether splashscreen should be shown on program startup or not. Speeds up application starting if turned off. Default: On") ); +#endif + item23->Add( item24, 0, wxGROW|wxLEFT|border_style, 5 ); + + wxCheckBox *item25 = new wxCheckBox( this, ID_PROMPTEXIT, _("Prompt on exit"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item25->SetToolTip( _("Toggle wether confirmation is requested when closing program.") ); +#endif + item23->Add( item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item27 = new wxCheckBox( this, ID_SHOWTOOL, _("Show ToolBar"), wxDefaultPosition, wxDefaultSize, 0 ); + item27->SetValue( TRUE ); +#ifndef __WXX11__ + item27->SetToolTip( _("Toggle wether toolbar is shown or not. Requires restart to take effect.") ); +#endif + item26->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + wxString strs28[] = { + _("Horizontal"), + _("Vertical") + }; + wxChoice *item28 = new wxChoice( this, ID_TOOLALIGN, wxDefaultPosition, wxSize(100,-1), 2, strs28, 0 ); +#ifndef __WXX11__ + item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window. Requires restart to take effect.") ); +#endif + item26->Add( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxCheckBox *item29 = new wxCheckBox( this, ID_SHOWMENU, _("Show MenuBar"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not. Requires restart to take effect.") ); +#endif + item23->Add( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + item0->Add( item23, 0, wxGROW, 5 ); + + wxBoxSizer *item30 = new wxBoxSizer( wxHORIZONTAL ); + + wxButton *item31 = new wxButton( this, GUI_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); + item31->SetDefault(); +#ifndef __WXX11__ + item31->SetToolTip( _("Save settings and close dialog") ); +#endif + item30->Add( item31, 0, wxALIGN_CENTER|wxALL, 5 ); + + wxButton *item32 = new wxButton( this, GUI_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item32->SetToolTip( _("Abort changes and close dialog") ); +#endif + item30->Add( item32, 0, wxALIGN_CENTER|wxALL, 5 ); + + item0->Add( item30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + SetAutoLayout( TRUE ); + SetSizer( item0 ); + item0->Fit( this ); + item0->SetSizeHints( this ); } /******************** Index: GUISettingsDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- GUISettingsDlg.h 20 Nov 2003 01:27:26 -0000 1.11 +++ GUISettingsDlg.h 24 Nov 2003 16:06:31 -0000 1.12 @@ -55,6 +55,7 @@ /* Other functions */ void SaveSettings(); void LoadSettings(); + void CreateControls(); /* Getters for dialog controls */ wxCheckBox* GetShowMenu() { Index: KnownListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/KnownListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- KnownListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ KnownListCtrl.h 24 Nov 2003 16:06:31 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CKnownListCtrl: public CMListCtrl { Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MainDlg.h 24 Nov 2003 14:21:58 -0000 1.5 +++ MainDlg.h 24 Nov 2003 16:06:31 -0000 1.6 @@ -39,6 +39,8 @@ #include "MessagesWnd.h" #include "StatisticsWnd.h" #include "SysTray.h" +#include "Images.h" +#include "GUISettingsDlg.h" /* * Constants for MainDlg Index: MessagesWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MessagesWnd.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MessagesWnd.h 20 Nov 2003 01:27:26 -0000 1.7 +++ MessagesWnd.h 24 Nov 2003 16:06:32 -0000 1.8 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" class CMessagesWnd: public wxPanel { public: Index: QueueListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/QueueListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- QueueListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ QueueListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CQueueListCtrl: public CMListCtrl { Index: SearchListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchListCtrl.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SearchListCtrl.h 20 Nov 2003 01:27:26 -0000 1.5 +++ SearchListCtrl.h 24 Nov 2003 16:06:32 -0000 1.6 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CSearchListCtrl: public CMListCtrl { Index: ServerListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerListCtrl.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ServerListCtrl.h 20 Nov 2003 01:27:26 -0000 1.7 +++ ServerListCtrl.h 24 Nov 2003 16:06:32 -0000 1.8 @@ -30,6 +30,8 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" +#include "Images.h" #include "ServerWnd.h" extern class CServerListCtrl *serverlistctrl; Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- ServerWnd.cpp 24 Nov 2003 14:21:58 -0000 1.39 +++ ServerWnd.cpp 24 Nov 2003 16:06:32 -0000 1.40 @@ -49,7 +49,7 @@ */ CServerWnd::CServerWnd( wxWindow *parent, wxWindowID id, const wxPoint &position, - const wxSize& size, long style ) + const wxSize& size, long style ) : wxPanel( parent, id, position, size, style ) { bool show_sidebar; @@ -191,7 +191,7 @@ sidebar, -1, _("Add new server"), wxT("SideBar_AddServer") ); wxPanel *addserver_cnt = new wxPanel(addserver, -1); - Server_AddServerPanel(addserver_cnt); + AddServerPanel(addserver_cnt); addserver->SetContent(addserver_cnt); sbmain->Add(addserver, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -199,7 +199,7 @@ sidebar, -1, _("Update from URL"), wxT("SideBar_UpdateServer") ); wxPanel *updatelist_cnt = new wxPanel(updatelist, -1); - Server_UpdatePanel(updatelist_cnt); + UpdatePanel(updatelist_cnt); updatelist->SetContent(updatelist_cnt); sbmain->Add(updatelist, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -207,7 +207,7 @@ sidebar, -1, _("Server settings"), wxT("SideBar_ServerSettings") ); wxPanel *serversettings_cnt = new wxPanel(serversettings, -1); - Server_SettingsPanel(serversettings_cnt); + SettingsPanel(serversettings_cnt); serversettings->SetContent(serversettings_cnt); sbmain->Add(serversettings, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -215,7 +215,7 @@ sidebar, -1, _("Port settings"), wxT("SideBar_PortSettings") ); wxPanel *portsettings_cnt = new wxPanel(portsettings, -1); - Server_PortSettingsPanel(portsettings_cnt); + PortSettingsPanel(portsettings_cnt); portsettings->SetContent(portsettings_cnt); sbmain->Add(portsettings, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -223,7 +223,7 @@ sidebar, -1, _("Log options"), wxT("SideBar_LoggingOptions") ); wxPanel *logoptions_cnt = new wxPanel(logoptions, -1); - Server_LogOptionsPanel(logoptions_cnt); + LogOptionsPanel(logoptions_cnt); logoptions->SetContent(logoptions_cnt); sbmain->Add(logoptions, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -299,4 +299,262 @@ Layout(); Refresh(); #endif +} + +/** + * Control generation for Server Page SideBar Settings Panel. Moved here from + * wxInterface_wdr.cpp to fix wxCheckBox borders (need wxALL on wxMSW and none + * on wxGTK. + */ +wxSizer* CServerWnd::SettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxCheckBox *item1 = new wxCheckBox( parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item1->SetToolTip( _("Toggle wether application should automatically connect to any server on startup") ); +#endif + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item3 = new wxCheckBox( parent, ID_SS_AC_STATIC_ONLY, _("To static only"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Toggle wether application should connect to servers marked as \"static\" only") ); +#endif + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 15 ); + + wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); + item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item5->Add( item6, 0, wxALIGN_CENTER|wxLEFT, 5 ); + + wxStaticText *item7 = new wxStaticText( parent, ID_SS_SERVER_NAME, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); + item5->Add( item7, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); + + item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); + + wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item10 = new wxCheckBox( parent, ID_CHECK_SS_STATIC, _("Static"), wxDefaultPosition, wxSize(130,-1), 0 ); +#ifndef __WXX11__ + item10->SetToolTip( _("Set server static. Static servers are not removed from list if they do not respond") ); +#endif + item9->Add( item10, 0, wxALIGN_CENTER|border_style, 5 ); + + item8->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer *item11 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticText *item12 = new wxStaticText( parent, ID_TEXT, _("Priority:"), wxDefaultPosition, wxDefaultSize, 0 ); + item11->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxString strs13[] = { + _("High"), + _("Normal"), + _("Low") + }; + wxChoice *item13 = new wxChoice( parent, ID_SS_PRIO, wxDefaultPosition, wxSize(80,-1), 3, strs13, 0 ); +#ifndef __WXX11__ + item13->SetToolTip( _("Change server priority") ); +#endif + item11->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + item8->Add( item11, 0, wxALIGN_CENTER, 5 ); + + item0->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +/** + * Control generation for Server SideBar Page Log Options Panel. Moved here from + * wxInterface_wdr.cpp to fix wxCheckBox borders (need wxALL on wxMSW and none + * on wxGTK. + */ +wxSizer* CServerWnd::LogOptionsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item2 = new wxCheckBox( parent, ID_CHECK_LINE_LIMIT, _("Line limit"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item2->SetToolTip( _("Toggle wether there should be a line limit for log boxes (saves memory)") ); +#endif + item1->Add( item2, 0, wxGROW|border_style, 5 ); + + wxTextCtrl *item3 = new wxTextCtrl( parent, ID_TXT_LINE_LIMIT, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Maximum number of lines in log boxes") ); +#endif + item1->Add( item3, 0, wxALIGN_CENTER|wxRIGHT, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxCheckBox *item4 = new wxCheckBox( parent, ID_CHECK_SAVE_TO_DISK, _("Save to disk"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item4->SetToolTip( _("Save logs to disc also") ); +#endif + item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxButton *item5 = new wxButton( parent, ID_BTN_CLEAR_LOGS, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item5->SetToolTip( _("Clear all logs") ); +#endif + item0->Add( item5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::AddServerPanel( wxWindow *parent, bool call_fit, bool set_sizer ) +{ + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer *item1 = new wxFlexGridSizer( 4, 0, 0, 0 ); + item1->AddGrowableCol( 0 ); + + wxStaticText *item2 = new wxStaticText( parent, ID_SERVER_IP, _("IP address:Port"), wxDefaultPosition, wxDefaultSize, 0 ); + item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + wxTextCtrl *item3 = new wxTextCtrl( parent, ID_SERVER_IP, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Type in the ip address and port of the new server, separated by :") ); +#endif + item1->Add( item3, 0, wxGROW, 5 ); + + wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); + item1->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + wxTextCtrl *item5 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 ); +#ifndef __WXX11__ + item5->SetToolTip( _("Optional: Enter the name of the new server") ); +#endif + item1->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + item0->Add( item1, 0, wxGROW|wxRIGHT, 5 ); + + wxButton *item6 = new wxButton( parent, ID_ADDTOLIST, _("Add to List"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Add the server to list") ); +#endif + item0->Add( item6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::UpdatePanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxTextCtrl *item1 = new wxTextCtrl( parent, ID_SERVERLISTURL, wxT("http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-best.met"), wxDefaultPosition, wxSize(-1,100), wxTE_MULTILINE|wxTE_PROCESS_TAB ); +#ifndef __WXX11__ + item1->SetToolTip( wxT("Enter the URL or .met file location to update list from") ); +#endif + item0->Add( item1, 0, wxGROW, 5 ); + + wxButton *item2 = new wxButton( parent, ID_UPDATE, _("Update"), wxDefaultPosition, wxDefaultSize, 0 ); + item0->Add( item2, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::PortSettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer *item2 = new wxBoxSizer( wxVERTICAL ); + + wxStaticText *item3 = new wxStaticText( parent, ID_TEXT, wxT("TCP"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); + + wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, wxT("UDP"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); + + item1->Add( item2, 0, wxALIGN_CENTER, 5 ); + + wxBoxSizer *item5 = new wxBoxSizer( wxVERTICAL ); + + wxTextCtrl *item6 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Enter the TCP port for connections (default: 4662)") ); +#endif + item5->Add( item6, 0, wxALIGN_CENTER, 5 ); + + wxTextCtrl *item7 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item7->SetToolTip( _("Enter the UDP port for connections (default: 4672)") ); +#endif + item5->Add( item7, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item5, 0, wxALIGN_CENTER, 5 ); + + wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); + + item8->Add( 10, 20, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + + wxCheckBox *item9 = new wxCheckBox( parent, ID_CHECK_DISABLE_UDP, _("Disable"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item9->SetToolTip( _("Disable UDP port. This can somewhat lower traffic, but also results in less sources as client<->client source exchange is done via UDP") ); +#endif + item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 ); + + item1->Add( item8, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxButton *item10 = new wxButton( parent, ID_BUTTON, _("Apply changes"), wxDefaultPosition, wxDefaultSize, 0 ); + item0->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; } Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ServerWnd.h 23 Nov 2003 09:52:43 -0000 1.28 +++ ServerWnd.h 24 Nov 2003 16:06:32 -0000 1.29 @@ -68,6 +68,21 @@ void AddNewServer(); void UpdateFromURL(); void CreateControls(); + wxSizer* SettingsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* LogOptionsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* AddServerPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* UpdatePanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* PortSettingsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); /* Member variable declarations */ wxImageList *m_imagelist; @@ -102,7 +117,7 @@ return (wxButton*) FindWindow( ID_ADDTOLIST ); } wxTextCtrl* GetServerip() { - return (wxTextCtrl*) FindWindow( ID_SERVERIP ); + return (wxTextCtrl*) FindWindow( ID_SERVER_IP ); } wxSplitterWindow* GetHorizontalSplitter() { return (wxSplitterWindow*) Index: SharedFilesListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SharedFilesListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SharedFilesListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ SharedFilesListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CSharedFilesListCtrl: public CMListCtrl { Index: SharedFilesWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SharedFilesWnd.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SharedFilesWnd.h 20 Nov 2003 01:27:26 -0000 1.8 +++ SharedFilesWnd.h 24 Nov 2003 16:06:32 -0000 1.9 @@ -31,6 +31,7 @@ #include "wxInterface_wdr.h" #include "defines.h" #include "SharedFilesListCtrl.h" +#include "Images.h" class CSharedFilesWnd: public wxPanel { public: Index: StatisticsTreeCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/StatisticsTreeCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- StatisticsTreeCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ StatisticsTreeCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" class CStatisticsTreeCtrl: public wxTreeCtrl { public: Index: TransferWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/TransferWnd.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TransferWnd.h 20 Nov 2003 01:27:26 -0000 1.11 +++ TransferWnd.h 24 Nov 2003 16:06:32 -0000 1.12 @@ -31,6 +31,7 @@ /* Global includes for resources */ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" /* Private includes for list control classes */ #include "DownloadListCtrl.h" Index: UploadListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/UploadListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- UploadListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ UploadListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CUploadListCtrl: public CMListCtrl { Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- defines.h 23 Nov 2003 20:17:34 -0000 1.37 +++ defines.h 24 Nov 2003 16:06:32 -0000 1.38 @@ -30,11 +30,6 @@ #include <wx/splash.h> #include <wx/taskbar.h> -/* Include local headers */ -#include "MListCtrl.h" -#include "GUISettingsDlg.h" -#include "Images.h" - /* Some defines to make accessing dialog controls easier */ #define GetDlgItem(X) ((wxTextCtrl*)FindWindowById(X)) #define m_logbook ((wxNotebook*)FindWindowById(ID_LOGBOOK)) @@ -50,6 +45,17 @@ #define wxHAS_TASK_BAR_ICON #endif +/** + * On wxMSW and wxX11, we need to use wxALL border flag on various controls + * (wxCheckBox is best example), while on wxGTK and wxMac, no border flag is + * required. Thus we define it here and use where needed. + */ +#if defined(__WXMSW__) || defined (__WXX11__) + #define border_style wxALL +#else + #define border_style 0 +#endif + extern class CServerWnd *serverwnd; extern class CSearchWnd *searchwnd; extern class CTransferWnd *transferwnd; @@ -89,7 +95,26 @@ ID_VIEW_TBAR_ALIGN_VER, ID_HELP_HELP, ID_HELP_ABOUT, - + + /* Server page */ + ID_SERVER_SPLITTER_HORIZONTAL, + ID_BTN_TOGGLE_SIDEBAR, + ID_SS_SERVER_IMG , + ID_SS_SERVER_NAME, + ID_CHECK_SS_STATIC, + ID_SS_AUTO_CONNECT, + ID_SS_AC_STATIC_ONLY, + ID_SS_PRIO, + ID_CHECK_LINE_LIMIT, + ID_TXT_LINE_LIMIT, + ID_CHECK_SAVE_TO_DISK, + ID_BTN_CLEAR_LOGS, + ID_ADDTOLIST, + ID_SERVER_IP, + ID_UPDATE, + ID_SERVERLISTURL, + ID_CHECK_DISABLE_UDP, + /* Transfer page */ ID_SPLITTER, ID_CATEGORY, @@ -97,10 +122,24 @@ ID_QUEUE, ID_KNOWN, - /* Server page */ - ID_SERVER_SPLITTER_HORIZONTAL, - ID_BTN_TOGGLE_SIDEBAR, - + /* GUI Settings Dialog */ + ID_SHOWMENU, + ID_TOOLALIGN, + ID_STARTPAGE, + ID_REMEMBER_LAST, + ID_SHOWTOOL, + ID_PROMPTEXIT, + ID_SHOWSPLASH, + ID_ICONSET, + ID_FONT, + ID_LANG, + GUI_OK, + GUI_CANCEL, + ID_BTN_ADDLANG, + ID_BTN_REMOVELANG, + ID_BTN_ADDICONSET, + ID_BTN_REMOVEICONSET, + /* Systray context menu entries */ MENU_TRAY_HIDESHOW_GUI, MENU_TRAY_CHANGE_GUI_SETTINGS, Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsVx5Xio and /tmp/cvskeKtyE differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- wxInterface_wdr.cpp 24 Nov 2003 14:23:10 -0000 1.5 +++ wxInterface_wdr.cpp 24 Nov 2003 16:06:32 -0000 1.6 @@ -743,162 +743,6 @@ return item0; } -wxSizer *Dlg_GUI_Settings( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxGridSizer *item1 = new wxGridSizer( 2, 0, 0, 0 ); - - wxStaticBox *item3 = new wxStaticBox( parent, -1, _("Language") ); - wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL ); - - wxString *strs4 = (wxString*) NULL; - wxChoice *item4 = new wxChoice( parent, ID_LANG, wxDefaultPosition, wxSize(100,-1), 0, strs4, 0 ); - item4->SetToolTip( _("Change the language of the interface. Requires interface restart to take effect") ); - item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxGridSizer *item5 = new wxGridSizer( 2, 0, 0 ); - - wxButton *item6 = new wxButton( parent, ID_BTN_ADDLANG, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - item6->SetToolTip( _("Add new language") ); - item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxButton *item7 = new wxButton( parent, ID_BTN_REMOVELANG, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - item7->SetToolTip( _("Remove currently selected language") ); - item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); - - item2->Add( item5, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item2, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - wxStaticBox *item9 = new wxStaticBox( parent, -1, _("Icon set") ); - wxStaticBoxSizer *item8 = new wxStaticBoxSizer( item9, wxVERTICAL ); - - wxString *strs10 = (wxString*) NULL; - wxChoice *item10 = new wxChoice( parent, ID_ICONSET, wxDefaultPosition, wxSize(100,-1), 0, strs10, 0 ); - item10->SetToolTip( _("Change the iconet the interface should use. Requires restart to take effect") ); - item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxGridSizer *item11 = new wxGridSizer( 2, 0, 0 ); - - wxButton *item12 = new wxButton( parent, ID_BTN_ADDICONSET, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - item12->SetToolTip( _("Add new iconset") ); - item11->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxButton *item13 = new wxButton( parent, ID_BTN_REMOVEICONSET, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - item13->SetToolTip( _("Remove currently selected iconset") ); - item11->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 ); - - item8->Add( item11, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item8, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxFlexGridSizer *item14 = new wxFlexGridSizer( 2, 0, 0 ); - - wxStaticBox *item16 = new wxStaticBox( parent, -1, _("Font") ); - wxStaticBoxSizer *item15 = new wxStaticBoxSizer( item16, wxVERTICAL ); - - wxString strs17[] = - { - _("Default") - }; - wxChoice *item17 = new wxChoice( parent, ID_FONT, wxDefaultPosition, wxSize(100,-1), 1, strs17, 0 ); - item17->SetToolTip( _("Change the font") ); - item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxStaticText *item18 = new wxStaticText( parent, ID_TEXT, _("Font Test :)"), wxDefaultPosition, wxDefaultSize, 0 ); - item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 ); - - item14->Add( item15, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - wxStaticBox *item20 = new wxStaticBox( parent, -1, _("Startup page") ); - wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); - - wxString strs21[] = - { - _("Server"), - _("Transfer"), - _("Search"), - _("Shared Files"), - _("Messages"), - _("Statistics") - }; - wxChoice *item21 = new wxChoice( parent, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1), 6, strs21, 0 ); - item21->SetToolTip( _("Set which page will be displayed on program startup") ); - item19->Add( item21, 0, wxGROW|wxALL, 5 ); - - wxCheckBox *item22 = new wxCheckBox( parent, ID_REMEMBER_LAST, _("Remember last"), wxDefaultPosition, wxDefaultSize, 0 ); - item22->SetToolTip( _("Automatically remember which page was open between sessions") ); - item19->Add( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item14->Add( item19, 0, wxLEFT|wxRIGHT, 5 ); - - item0->Add( item14, 0, 0, 5 ); - - wxBoxSizer *item23 = new wxBoxSizer( wxVERTICAL ); - - wxCheckBox *item24 = new wxCheckBox( parent, ID_SHOWSPLASH, _("Show splashscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - item24->SetValue( TRUE ); - item24->SetToolTip( _("Toggle wether splashscreen should be shown on program startup or not. Speeds up application starting if turned off. Default: On") ); - item23->Add( item24, 0, wxGROW|wxLEFT, 5 ); - - wxCheckBox *item25 = new wxCheckBox( parent, ID_PROMPTEXIT, _("Prompt on exit"), wxDefaultPosition, wxDefaultSize, 0 ); - item25->SetToolTip( _("Toggle wether confirmation is requested when closing program.") ); - item23->Add( item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item27 = new wxCheckBox( parent, ID_SHOWTOOL, _("Show ToolBar"), wxDefaultPosition, wxDefaultSize, 0 ); - item27->SetValue( TRUE ); - item27->SetToolTip( _("Toggle wether toolbar is shown or not. Requires restart to take effect.") ); - item26->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxString strs28[] = - { - _("Horizontal"), - _("Vertical") - }; - wxChoice *item28 = new wxChoice( parent, ID_TOOLALIGN, wxDefaultPosition, wxSize(100,-1), 2, strs28, 0 ); - item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window. Requires restart to take effect.") ); - item26->Add( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxCheckBox *item29 = new wxCheckBox( parent, ID_SHOWMENU, _("Show MenuBar"), wxDefaultPosition, wxDefaultSize, 0 ); - item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not. Requires restart to take effect.") ); - item23->Add( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - item0->Add( item23, 0, wxGROW, 5 ); - - wxBoxSizer *item30 = new wxBoxSizer( wxHORIZONTAL ); - - wxButton *item31 = new wxButton( parent, GUI_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - item31->SetDefault(); - item31->SetToolTip( _("Save settings and close dialog") ); - item30->Add( item31, 0, wxALIGN_CENTER|wxALL, 5 ); - - wxButton *item32 = new wxButton( parent, GUI_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - item32->SetToolTip( _("Abort changes and close dialog") ); - item30->Add( item32, 0, wxALIGN_CENTER|wxALL, 5 ); - - item0->Add( item30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - wxSizer *Server_Logs( wxWindow *parent, bool call_fit, bool set_sizer ) { wxFlexGridSizer *item0 = new wxFlexGridSizer( 2, 0, 0 ); @@ -932,256 +776,6 @@ return item0; } -wxSizer *sizer_updateserver; -wxSizer *sizer_serversettings; -wxSizer *sizer_portsettings; -wxSizer *sizer_addserver; -wxSizer *sizer_logoptions; -wxSizer *Server_Sidebar( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxFlexGridSizer *item0 = new wxFlexGridSizer( 1, 0, 0 ); - item0->AddGrowableCol( 0 ); - - wxFlexGridSizer *item1 = new wxFlexGridSizer( 1, 0, 0 ); - item1->AddGrowableCol( 0 ); - sizer_updateserver = item1; - - wxButton *item2 = new wxButton( parent, ID_BTN_SHOW_UPDATELIST, wxT("Update from URL"), wxDefaultPosition, wxSize(150,-1), 0 ); - item2->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item1->Add( item2, 0, wxGROW, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item3 = new wxFlexGridSizer( 1, 0, 0 ); - item3->AddGrowableCol( 0 ); - sizer_serversettings = item3; - - wxButton *item4 = new wxButton( parent, ID_BTN_SHOW_SERVERSETTINGS, wxT("Server settings"), wxDefaultPosition, wxSize(140,-1), 0 ); - item4->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item3->Add( item4, 0, wxGROW, 5 ); - - item0->Add( item3, 0, wxGROW|wxLEFT, 5 ); - - wxFlexGridSizer *item5 = new wxFlexGridSizer( 1, 0, 0 ); - item5->AddGrowableCol( 0 ); - sizer_portsettings = item5; - - wxButton *item6 = new wxButton( parent, ID_BTN_SHOW_PORT_OPTIONS, _("Port settings"), wxDefaultPosition, wxSize(140,-1), 0 ); - item6->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item7 = new wxFlexGridSizer( 1, 0, 0 ); - item7->AddGrowableCol( 0 ); - sizer_addserver = item7; - - wxButton *item8 = new wxButton( parent, ID_BTN_SHOW_ADDSERVER, wxT("Add a server"), wxDefaultPosition, wxSize(140,-1), 0 ); - item8->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item7->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item9 = new wxFlexGridSizer( 1, 0, 0 ); - item9->AddGrowableCol( 0 ); - sizer_logoptions = item9; - - wxButton *item10 = new wxButton( parent, ID_BTN_SHOW_LOGGINGOPTIONS, wxT("Logging options"), wxDefaultPosition, wxSize(140,-1), 0 ); - item10->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item9->Add( item10, 0, wxGROW, 5 ); - - item0->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_AddServerPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer *item1 = new wxFlexGridSizer( 4, 0, 0, 0 ); - item1->AddGrowableCol( 0 ); - - wxStaticText *item2 = new wxStaticText( parent, ID_SERVER_IP, _("IP address:Port"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - - wxTextCtrl *item3 = new wxTextCtrl( parent, ID_SERVERIP, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); - item3->SetToolTip( _("Type in the ip address and port of the new server, separated by :") ); - item1->Add( item3, 0, wxGROW, 5 ); - - wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - - wxTextCtrl *item5 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 ); - item5->SetToolTip( _("Optional: Enter the name of the new server") ); - item1->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item1, 0, wxGROW|wxRIGHT, 5 ); - - wxButton *item6 = new wxButton( parent, ID_ADDTOLIST, _("Add to List"), wxDefaultPosition, wxDefaultSize, 0 ); - item6->SetToolTip( _("Add the server to list") ); - item0->Add( item6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_UpdatePanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxTextCtrl *item1 = new wxTextCtrl( parent, ID_SERVERLISTURL, wxT("http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-best.met"), wxDefaultPosition, wxSize(-1,100), wxTE_MULTILINE|wxTE_PROCESS_TAB ); - item1->SetToolTip( wxT("Enter the URL or .met file location to update list from") ); - item0->Add( item1, 0, wxGROW, 5 ); - - wxButton *item2 = new wxButton( parent, ID_UPDATE, _("Update"), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( item2, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_SettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxCheckBox *item1 = new wxCheckBox( parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->SetToolTip( _("Toggle wether application should automatically connect to any server on startup") ); - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item3 = new wxCheckBox( parent, ID_SS_AC_STATIC_ONLY, _("To static only"), wxDefaultPosition, wxDefaultSize, 0 ); - item3->SetToolTip( _("Toggle wether application should connect to servers marked as \"static\" only") ); - item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 15 ); - - wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); - item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item5->Add( item6, 0, wxALIGN_CENTER|wxLEFT, 5 ); - - wxStaticText *item7 = new wxStaticText( parent, ID_SS_SERVER_NAME, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); - item5->Add( item7, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - - wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item10 = new wxCheckBox( parent, ID_CHECK_SS_STATIC, _("Static"), wxDefaultPosition, wxSize(130,-1), 0 ); - item10->SetToolTip( _("Set server static. Static servers are not removed from list if they do not respond") ); - item9->Add( item10, 0, wxALIGN_CENTER, 5 ); - - item8->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item11 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticText *item12 = new wxStaticText( parent, ID_TEXT, _("Priority:"), wxDefaultPosition, wxDefaultSize, 0 ); - item11->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxString strs13[] = - { - _("High"), - _("Normal"), - _("Low") - }; - wxChoice *item13 = new wxChoice( parent, ID_SS_PRIO, wxDefaultPosition, wxSize(80,-1), 3, strs13, 0 ); - item13->SetToolTip( _("Change server priority") ); - item11->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - item8->Add( item11, 0, wxALIGN_CENTER, 5 ); - - item0->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_LogOptionsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item2 = new wxCheckBox( parent, ID_CHECK_LINE_LIMIT, _("Line limit"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->SetToolTip( _("Toggle wether there should be a line limit for log boxes (saves memory)") ); - item1->Add( item2, 0, wxGROW, 5 ); - - wxTextCtrl *item3 = new wxTextCtrl( parent, ID_TXT_LINE_LIMIT, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item3->SetToolTip( _("Maximum number of lines in log boxes") ); - item1->Add( item3, 0, wxALIGN_CENTER|wxRIGHT, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxCheckBox *item4 = new wxCheckBox( parent, ID_CHECK_SAVE_TO_DISK, _("Save to disk"), wxDefaultPosition, wxDefaultSize, 0 ); - item4->SetToolTip( _("Save logs to disc also") ); - item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxButton *item5 = new wxButton( parent, ID_BTN_CLEAR_LOGS, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); - item5->SetToolTip( _("Clear all logs") ); - item0->Add( item5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit, bool set_sizer ) { wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); @@ -1207,63 +801,6 @@ item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 ); item0->Add( item3, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_PortSettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer *item2 = new wxBoxSizer( wxVERTICAL ); - - wxStaticText *item3 = new wxStaticText( parent, ID_TEXT, wxT("TCP"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - - wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, wxT("UDP"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - - item1->Add( item2, 0, wxALIGN_CENTER, 5 ); - - wxBoxSizer *item5 = new wxBoxSizer( wxVERTICAL ); - - wxTextCtrl *item6 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item6->SetToolTip( _("Enter the TCP port for connections (default: 4662)") ); - item5->Add( item6, 0, wxALIGN_CENTER, 5 ); - - wxTextCtrl *item7 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item7->SetToolTip( _("Enter the UDP port for connections (default: 4672)") ); - item5->Add( item7, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item5, 0, wxALIGN_CENTER, 5 ); - - wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); - - item8->Add( 10, 20, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); - - wxCheckBox *item9 = new wxCheckBox( parent, ID_CHECKBOX, _("Disable"), wxDefaultPosition, wxDefaultSize, 0 ); - item9->SetToolTip( _("Disable UDP port. This can somewhat lower traffic, but also results in less sources as client<->client source exchange is done via UDP") ); - item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 ); - - item1->Add( item8, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxButton *item10 = new wxButton( parent, ID_BUTTON, _("Apply changes"), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 ); if (set_sizer) { Index: wxInterface_wdr.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wxInterface_wdr.h 24 Nov 2003 14:21:58 -0000 1.3 +++ wxInterface_wdr.h 24 Nov 2003 16:06:32 -0000 1.4 @@ -89,86 +89,30 @@ #define ID_UL_GRAPH 10044 wxSizer *StatisticsWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_LANG 10045 -#define ID_BTN_ADDLANG 10046 -#define ID_BTN_REMOVELANG 10047 -#define ID_ICONSET 10048 -#define ID_BTN_ADDICONSET 10049 -#define ID_BTN_REMOVEICONSET 10050 -#define ID_FONT 10051 -#define ID_STARTPAGE 10052 -#define ID_REMEMBER_LAST 10053 -#define ID_SHOWSPLASH 10054 -#define ID_PROMPTEXIT 10055 -#define ID_SHOWTOOL 10056 -#define ID_TOOLALIGN 10057 -#define ID_SHOWMENU 10058 -#define GUI_OK 10059 -#define GUI_CANCEL 10060 -wxSizer *Dlg_GUI_Settings( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_LOGBOOK 10061 +#define ID_LOGBOOK 10045 wxSizer *Server_Logs( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -extern wxSizer *sizer_updateserver; -#define ID_BTN_SHOW_UPDATELIST 10062 -extern wxSizer *sizer_serversettings; -#define ID_BTN_SHOW_SERVERSETTINGS 10063 -extern wxSizer *sizer_portsettings; -#define ID_BTN_SHOW_PORT_OPTIONS 10064 -extern wxSizer *sizer_addserver; -#define ID_BTN_SHOW_ADDSERVER 10065 -extern wxSizer *sizer_logoptions; -#define ID_BTN_SHOW_LOGGINGOPTIONS 10066 -wxSizer *Server_Sidebar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SERVER_IP 10067 -#define ID_SERVERIP 10068 -#define ID_ADDTOLIST 10069 -wxSizer *Server_AddServerPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SERVERLISTURL 10070 -#define ID_UPDATE 10071 -wxSizer *Server_UpdatePanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SS_AUTO_CONNECT 10072 -#define ID_SS_AC_STATIC_ONLY 10073 -#define ID_LINE 10074 -#define ID_SS_SERVER_IMG 10075 -#define ID_SS_SERVER_NAME 10076 -#define ID_CHECK_SS_STATIC 10077 -#define ID_SS_PRIO 10078 -wxSizer *Server_SettingsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_CHECK_LINE_LIMIT 10079 -#define ID_TXT_LINE_LIMIT 10080 -#define ID_CHECK_SAVE_TO_DISK 10081 -#define ID_BTN_CLEAR_LOGS 10082 -wxSizer *Server_LogOptionsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_LANG_NAME 10083 -#define ID_BTN_ADD_LANG_OK 10084 -#define ID_BTN_ADD_LANG_CANCEL 10085 +#define ID_LANG_NAME 10046 +#define ID_BTN_ADD_LANG_OK 10047 +#define ID_BTN_ADD_LANG_CANCEL 10048 wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_CHECKBOX 10086 -wxSizer *Server_PortSettingsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_BTN_ADDICONSET_OK 10087 -#define ID_BTN_ADDICONSET_CANCEL 10088 +#define ID_BTN_ADDICONSET_OK 10049 +#define ID_BTN_ADDICONSET_CANCEL 10050 wxSizer *Dlg_AddIconSet( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_STATUS_TXT 10089 -#define ID_BMP_STATUS_USERS 10090 -#define ID_STATUS_USERS 10091 -#define ID_BMP_STATUS_FILES 10092 -#define ID_STATUS_FILES 10093 -#define ID_BMP_STATUS_UPLOAD 10094 -#define ID_STATUS_UPLOAD 10095 -#define ID_BMP_STATUS_DLOAD 10096 -#define ID_STATUS_DLOAD 10097 -#define ID_BMP_STATUS_CONNECTION 10098 -#define ID_STATUS_CONNECTION 10099 +#define ID_LINE 10051 +#define ID_STATUS_TXT 10052 +#define ID_BMP_STATUS_USERS 10053 +#define ID_STATUS_USERS 10054 +#define ID_BMP_STATUS_FILES 10055 +#define ID_STATUS_FILES 10056 +#define ID_BMP_STATUS_UPLOAD 10057 +#define ID_STATUS_UPLOAD 10058 +#define ID_BMP_STATUS_DLOAD 10059 +#define ID_STATUS_DLOAD 10060 +#define ID_BMP_STATUS_CONNECTION 10061 +#define ID_STATUS_CONNECTION 10062 wxSizer *StatusBar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); // Declare menubar functions @@ -177,7 +121,7 @@ // Declare bitmap functions -#define ID_NULL_BMP 10100 +#define ID_NULL_BMP 10063 wxBitmap Icons( size_t index ); #endif |