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 ); |