Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv31500/src Modified Files: ColorFrameCtrl.cpp ColorFrameCtrl.h DownloadListCtrl.cpp DownloadListCtrl.h GUISettingsDlg.cpp GUISettingsDlg.h Images.cpp Images.h KnownListCtrl.cpp KnownListCtrl.h MListCtrl.cpp MListCtrl.h Makefile Makefile.b32 MessagesWnd.cpp MessagesWnd.h QueueListCtrl.cpp QueueListCtrl.h SBPanel.cpp SBPanel.h SearchListCtrl.cpp SearchListCtrl.h SearchWnd.cpp SearchWnd.h ServerListCtrl.cpp ServerListCtrl.h ServerWnd.cpp ServerWnd.h SharedFilesListCtrl.cpp SharedFilesListCtrl.h SharedFilesWnd.cpp SharedFilesWnd.h StatisticsTreeCtrl.cpp StatisticsTreeCtrl.h StatisticsWnd.cpp StatisticsWnd.h StatusBar.cpp StatusBar.h SysTray.cpp SysTray.h TransferWnd.cpp TransferWnd.h UploadListCtrl.cpp UploadListCtrl.h defines.h Added Files: MainDlg.cpp MainDlg.h wxInterface.cpp wxInterface.dev wxInterface.h wxInterface.ico wxInterface.wdr wxInterface_private.h wxInterface_private.rc wxInterface_wdr.cpp wxInterface_wdr.h Removed Files: xMuleDlg.cpp xMuleDlg.h xMuleGUI.cpp xMuleGUI.h xMuleGUI.wdr xMuleGUI_wdr.cpp xMuleGUI_wdr.h xmule2-ui-wx.dev xmule2-ui-wx.ico xmule2-ui-wx_private.h xmule2-ui-wx_private.rc Log Message: Renamed xMule* files to wxInterface*, renamed xMuleGUI class to wxInterface, xMuleDlg to CMainFrame and changed all xmule2 stuff in source to wxInterface. --- NEW FILE: MainDlg.cpp --- /* * This file is part of wxInterface. * Copyright (C) 2003 Alo Sarv <ma...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef __GNUG__ #pragma implementation "MainDlg.h" #endif // For compilers that support precompilation #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "MainDlg.h" /* Global classes */ class CServerWnd *serverwnd; class CTransferWnd *transferwnd; class CSearchWnd *searchwnd; class CSharedFilesWnd *sharedfileswnd; class CMessagesWnd *messageswnd; class CStatisticsWnd *statisticswnd; #ifdef __WXMSW__ class CSysTray *systray; #endif class CStatusBar *statusbar; /* * MainDlg class. The main dialog functions like Toolbar and Statusbar * stuff go in here. */ BEGIN_EVENT_TABLE(CMainDlg,wxFrame) /* Shutdown events */ EVT_CLOSE(CMainDlg::OnCloseWindow) /* Main toolbar button events */ EVT_TOOL(ID_BTN_CONNECT, CMainDlg::ConnectToAnyServer) EVT_TOOL(ID_BTN_SERVERS, CMainDlg::ShowServerWnd) EVT_TOOL(ID_BTN_TRANSFER, CMainDlg::ShowTransferWnd) EVT_TOOL(ID_BTN_SEARCH, CMainDlg::ShowSearchWnd) EVT_TOOL(ID_BTN_SHARED_FILES, CMainDlg::ShowSharedFilesWnd) EVT_TOOL(ID_BTN_MESSAGES, CMainDlg::ShowMessagesWnd) EVT_TOOL(ID_BTN_STATISTICS, CMainDlg::ShowStatisticsWnd) EVT_TOOL(ID_BTN_GUISETTINGS, CMainDlg::ShowGUISettingsDlg) /* Menubar events */ EVT_MENU(ID_FILE_CONNECT, CMainDlg::ConnectToAnyServer) EVT_MENU(ID_FILE_EXIT, CMainDlg::OnCloseWindow) EVT_MENU(ID_EDIT_GUI_SETTINGS, CMainDlg::ShowGUISettingsDlg) EVT_MENU(ID_VIEW_SERVERS, CMainDlg::ShowServerWnd) EVT_MENU(ID_VIEW_TRANSFER, CMainDlg::ShowTransferWnd) EVT_MENU(ID_VIEW_SEARCH, CMainDlg::ShowSearchWnd) EVT_MENU(ID_VIEW_SHARED_FILES, CMainDlg::ShowSharedFilesWnd) EVT_MENU(ID_VIEW_MESSAGES, CMainDlg::ShowMessagesWnd) EVT_MENU(ID_VIEW_STATISTICS, CMainDlg::ShowStatisticsWnd) END_EVENT_TABLE() /* * Main dialog constructor. Creates toolbar on the top, statusbar on the * bottom and loads the sub-dialogs (serverwnd, searchwnd etc). */ CMainDlg::CMainDlg( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style, wxLocale &l ) : wxFrame( parent, id, title, position, size, style ), m_locale(l) { int height, width, posx, posy; start_up = true; /* Create toolbar */ show_tool = true; m_config->Read(wxT("/General/Show toolbar"), &show_tool, true); if (show_tool) { CreateMyToolBar(); } /* Create status bar */ statusbar = new CStatusBar(this); SetStatusBar(statusbar); /* Create menu bar */ bool show_menu; m_config->Read(wxT("/General/Show menubar"), &show_menu, false); if (show_menu) { CreateMenuBar(); } /* Set application icon */ wxIcon icon; icon.CopyFromBitmap(img->mule); SetIcon(icon); #ifdef __WXMSW__ systray = new CSysTray(); #endif /* This adds a new sizer in the frame to make switching pages easier. */ m_mainsizer = ContentSizer(this, true); /** * Read position and size settings, and apply them before * loading dialog pages. */ m_config->Read(wxT("Frame/Height"), &height, 600); m_config->Read(wxT("Frame/Width"), &width, 800); SetSize(width, height); /** * If X and Y positions were not found in config object, we will not * use default values, but instead center the dialog (20,20 values * caused problems on OS X, better to center the whole thing and not * worry about it any more. */ bool isreadx = m_config->Read(wxT("Frame/PosX"), &posx, 20); bool isready = m_config->Read(wxT("Frame/PosY"), &posy, 20); if (!isreadx && !isready) { Center(); } else { Move(posx, posy); } /* Everything else should be done now, finally load the pages itself. */ LoadAndShowDialogPages(); } /* * Destructor for MainDlg. */ CMainDlg::~CMainDlg() { /** * 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 * next startup. */ if (!IsIconized()) { m_config->SetPath(wxT("/Frame")); m_config->Write(wxT("Height"), GetSize().GetHeight()); m_config->Write(wxT("Width"), GetSize().GetWidth()); m_config->Write(wxT("PosX"), GetPosition().x); m_config->Write(wxT("PosY"), GetPosition().y); } /* * If we are instructed to remember the last open page between sessions, * write current active page to config file. This is done by determining * which toolbar button is currently selected (stored in m_lastbtn * variable) and substracting 1001 from that value to get 0 for * serverwnd, 1 for transferwnd etc, thus matching the codes we use * from CGUISettingsDlg class. */ int remember_last; m_config->Read(wxT("/General/Remember last"), &remember_last, true); if (remember_last) { m_config->Write(wxT("/General/Start page"), m_lastbtn-1001); } #ifdef __WXMSW__ systray->RemoveIcon(); delete systray; #endif /* Clean up our mess before leaving */ delete serverwnd; delete transferwnd; delete searchwnd; delete sharedfileswnd; delete messageswnd; delete statisticswnd; } /* * Changes content of the main frame by removing the old panel from m_mainsizer * and attaching new one. [start_up] defaults to false, and is required true * if we are calling this function on application start-up (don't hide old * (nonexistent) frame then). */ void CMainDlg::SetActiveDialog(wxWindow* dlg) { /** * On startup, we don't have activewnd * here yet, so don't hide anything. */ if (!start_up) { activewnd->Show(FALSE); m_mainsizer->Remove(activewnd); } m_mainsizer->Add(dlg,1,wxALIGN_LEFT|wxEXPAND|wxALL); dlg->Show(TRUE); activewnd=dlg; Layout(); start_up = false; } /* * Creates the toolbar on the top end of the main dialog. */ void CMainDlg::CreateMyToolBar() { int tool_align; m_config->Read( wxT("/General/Toolbar alignment"), &tool_align, wxTB_HORIZONTAL ); /* Construct the toolbar object */ tb = CreateToolBar( tool_align|wxNO_BORDER|wxTB_TEXT|wxTB_FLAT|wxTB_3DBUTTONS ); tb->SetToolBitmapSize(wxSize(32, 32)); tb->SetMargins( 2, 2 ); /* Add the buttons */ tb->AddTool( ID_BTN_CONNECT, _("Connect"), img->btn_connect, wxNullBitmap, wxITEM_NORMAL, _("Connect to any server") ); tb->AddSeparator(); tb->AddTool( ID_BTN_SERVERS, _("Servers"), img->btn_servers, wxNullBitmap, wxITEM_CHECK, _("Server list") ); tb->AddTool( ID_BTN_SEARCH, _("Search"), img->btn_search, wxNullBitmap, wxITEM_CHECK, _("Search files") ); tb->AddTool( ID_BTN_TRANSFER, _("Transfer"), img->btn_transfer, wxNullBitmap, wxITEM_CHECK, _("File Transfer") ); tb->AddTool( ID_BTN_SHARED_FILES, _("Shared Files"), img->btn_shared, wxNullBitmap, wxITEM_CHECK, _("Show shared files") ); tb->AddTool( ID_BTN_MESSAGES, _("Messages"), img->btn_messages, wxNullBitmap, wxITEM_CHECK, _("Chatting") ); tb->AddTool( ID_BTN_STATISTICS, _("Statistics"), img->btn_statistics, wxNullBitmap, wxITEM_CHECK, _("Show live statistics") ); tb->AddSeparator(); tb->AddTool( ID_BTN_GUISETTINGS, _("Preferences"), img->btn_guisettings, wxNullBitmap, wxITEM_NORMAL, _("Modify settings") ); /* And go live */ tb->Realize(); } /* * CloseWindow event function. This should destroy all open dialogs. */ void CMainDlg::OnCloseWindow( wxCloseEvent &event ){ /* Read from config if we should ask for permission before closing. */ bool prompt_exit; m_config->Read(wxT("/General/Prompt on exit"), &prompt_exit, true); if (prompt_exit) { if (wxMessageBox(_("Close xmule2-ui-wx?"), _("Question"), wxYES_NO|wxCENTRE|wxICON_QUESTION) == wxNO) { return; } } /* We reach this line if prompt_exit was false, * or Yes was clicked in messagebox */ Destroy(); } /** * Shows server page */ void CMainDlg::ShowServerWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_SERVERS, true); } m_lastbtn = ID_BTN_SERVERS; SetActiveDialog(serverwnd); /** * We send the server page a sizeevent to get the log boxes columns get * correct column widths (they are calculated dynamically according to * listctrl width. */ wxSizeEvent null_event; serverwnd->OnSize(null_event); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Shows transfer page */ void CMainDlg::ShowTransferWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_TRANSFER, true); } m_lastbtn = ID_BTN_TRANSFER; SetActiveDialog(transferwnd); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Shows search page */ void CMainDlg::ShowSearchWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_SEARCH, true); } m_lastbtn = ID_BTN_SEARCH; SetActiveDialog(searchwnd); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Shows shared files page */ void CMainDlg::ShowSharedFilesWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_SHARED_FILES, true); } m_lastbtn = ID_BTN_SHARED_FILES; SetActiveDialog(sharedfileswnd); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Shows messages page */ void CMainDlg::ShowMessagesWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_MESSAGES, true); } m_lastbtn = ID_BTN_MESSAGES; SetActiveDialog(messageswnd); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Shows statistics page */ void CMainDlg::ShowStatisticsWnd(wxCommandEvent &event) { if (show_tool) { tb->ToggleTool(m_lastbtn, false); tb->ToggleTool(ID_BTN_STATISTICS, true); } m_lastbtn = ID_BTN_STATISTICS; SetActiveDialog(statisticswnd); /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Sends command to core to connect to any server */ void CMainDlg::ConnectToAnyServer(wxCommandEvent &event) { /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Displays GUI settings dialog */ void CMainDlg::ShowGUISettingsDlg(wxCommandEvent &event) { CGUISettingsDlg *guisettings = new CGUISettingsDlg( NULL, -1, _("Preferences"), wxDefaultPosition, wxDefaultSize ); guisettings->ShowModal(); delete guisettings; /** * Force toolbar refresh to fix OS X drawing problems */ tb->Refresh(); } /** * Loads all dialog pages, and displays either the one set from preferences, * last one, or default (server) page. */ void CMainDlg::LoadAndShowDialogPages() { int start_page; serverwnd = new CServerWnd(this); searchwnd = new CSearchWnd(this); transferwnd = new CTransferWnd(this); sharedfileswnd = new CSharedFilesWnd(this); messageswnd = new CMessagesWnd(this); statisticswnd = new CStatisticsWnd(this); m_config->Read(wxT("/General/Start page"), &start_page, 0); wxCommandEvent null_event; switch (start_page) { case 0: ShowServerWnd(null_event); break; case 1: ShowTransferWnd(null_event); break; case 2: ShowSearchWnd(null_event); break; case 3: ShowSharedFilesWnd(null_event); break; case 4: ShowMessagesWnd(null_event); break; case 5: ShowStatisticsWnd(null_event); break; default: ShowServerWnd(null_event); break; } } /** * Generates our menubar. */ void CMainDlg::CreateMenuBar() { wxMenu *file_menu = new wxMenu(); file_menu->Append(ID_FILE_CONNECT, _("Connect")); file_menu->Append(ID_FILE_EXIT, _("Quit")); wxMenu *edit_menu = new wxMenu(); edit_menu->Append(ID_EDIT_GUI_SETTINGS, _("Preferences")); wxMenu *view_menu = new wxMenu(); view_menu->Append(ID_VIEW_SERVERS, _("Servers")); view_menu->Append(ID_VIEW_TRANSFER, _("Transfer")); view_menu->Append(ID_VIEW_SEARCH, _("Search")); view_menu->Append(ID_VIEW_SHARED_FILES, _("Shared Files")); view_menu->Append(ID_VIEW_MESSAGES, _("Messages")); view_menu->Append(ID_VIEW_STATISTICS, _("Statistics")); wxMenu *help_menu = new wxMenu(); help_menu->Append(ID_HELP_HELP, _("Help")); help_menu->Append(ID_HELP_ABOUT, _("About...")); wxMenuBar *menubar = new wxMenuBar(); menubar->Append(file_menu, _("File")); menubar->Append(edit_menu, _("Edit")); menubar->Append(view_menu, _("View")); menubar->Append(help_menu, _("Help")); SetMenuBar(menubar); } --- NEW FILE: MainDlg.h --- /* * This file is part of wxInterface. * Copyright (C) 2003 Alo Sarv <ma...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MAINDLG_H__ #define __MAINDLG_H__ #ifdef __GNUG__ #pragma interface "MainDlg.h" #endif // Include wxWindows' headers #ifndef WX_PRECOMP #include <wx/wx.h> #endif /* Include local headers */ #include "wxInterface_wdr.h" #include "defines.h" #include "StatusBar.h" #include "ServerWnd.h" #include "TransferWnd.h" #include "SearchWnd.h" #include "SharedFilesWnd.h" #include "MessagesWnd.h" #include "StatisticsWnd.h" #include "SysTray.h" /* * Constants for MainDlg */ #define ID_QUIT 100 #define ID_ABOUT 101 /* * MainDlg class. The main dialog functions like Toolbar and Statusbar * stuff go in here. */ extern class CMainDlg *mainframe; class CMainDlg: public wxFrame { public: /* Constructors and destructors */ CMainDlg( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint& pos, const wxSize& size, long style, wxLocale &m_locale ); ~CMainDlg(); wxLocale &m_locale; private: DECLARE_EVENT_TABLE() /* Member event handler functions */ void OnCloseWindow( wxCloseEvent &event ); void OnBtnGUIOk(wxCommandEvent &event); void OnBtnGUICancel(wxCommandEvent &event); /* Member functions */ void SetActiveDialog(wxWindow* dlg); void CreateMyToolBar(); void CreateSysTray(); void CreateMenuBar(); void LoadAndShowDialogPages(); void ConnectToAnyServer(wxCommandEvent &event); void ShowServerWnd(wxCommandEvent &event); void ShowTransferWnd(wxCommandEvent &event); void ShowSearchWnd(wxCommandEvent &event); void ShowSharedFilesWnd(wxCommandEvent &event); void ShowMessagesWnd(wxCommandEvent &event); void ShowStatisticsWnd(wxCommandEvent &event); void ShowGUISettingsDlg(wxCommandEvent &event); /* Member variables */ bool show_tool; // Wether toolbar should be shown or not. bool start_up; // Should we remember last page // between sessions or not int m_lastbtn; // Last toggled toolbar button wxSizer *m_mainsizer; // Sizer to make dialog pages switching easier. wxToolBar *tb; // Main toolbar wxWindow *activewnd; // Current active dialog page }; #endif --- NEW FILE: wxInterface.cpp --- /* * This file is part of wxInterface. * Copyright (C) 2003 Alo Sarv <ma...@us...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef __GNUG__ #pragma implementation "wxInterface.h" #endif // For compilers that support precompilation #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wxInterface.h" #include "MainDlg.h" /* * Base class for wxInterface. Everything else starts from here. */ IMPLEMENT_APP(wxInterface) class CImages *img; wxConfigBase *m_config; class CMainDlg *mainframe; /* * Main program initialization. Command arguments should be checked here, and * main wxInterface Dialog drawn. */ bool wxInterface::OnInit() { int show_splash; SetVendorName(wxT("ShareDaemon")); SetAppName(wxT("wxInterface")); ::wxInitAllImageHandlers(); m_config = wxConfigBase::Get(); CheckAndAddSupportedIconSets(); img = new CImages(); m_config->Read(wxT("/General/Show splashscreen"), &show_splash); if (show_splash) { /* Display the splash screen */ splash = new wxSplashScreen( img->logo, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 2000, NULL, -1 ); } Localize(); /* Display the main dialog */ mainframe = new CMainDlg( NULL, -1, APPVER_LONG, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE| wxNO_FULL_REPAINT_ON_RESIZE, m_locale ); mainframe->Show( TRUE ); if (show_splash) { splash->Raise(); } return TRUE; } /* * Main program shutdown function. If anything needs to be cleaned up, do it * here. */ int wxInterface::OnExit() { /* Save configuration object to disk */ delete m_config->Set(NULL); /* Delete images class (it doesn't get automatically deleted by wx */ delete img; /* Return true :) */ return 0; } /** * First we call CheckAndAddSupportedLangs() to add built-in languages to config * object. Then we add catalog prefixes (note that we need ::Resources:lang also * to be compatible with Mac OS packaging standards). Then simply read active * language from config object, and add the catalog. */ void wxInterface::Localize() { wxString curlang; CheckAndAddSupportedLangs(); /* Set localization files directories */ m_locale.AddCatalogLookupPathPrefix(wxT("lang/")); #if defined(__WXMAC__) && !defined(__MACH__) m_locale.AddCatalogLookupPathPrefix(wxT("::Resources:lang")); #endif m_config->SetPath(wxT("/General/Lang")); m_config->Read(wxT("CurLang"), &curlang); m_locale.Init(GetLangType(curlang)); m_locale.AddCatalog(curlang); } /** * This method's purpose is ensuring that all supported languages * (translations shipped with releases) are added to config file. This is done * by creating a list of supported languages (supportedlangs), then reading * all languages from config object (conflangs), and then comparing those two * arrays, adding missing elements to conflangs. Finally, the new languages * array (conflangs) is written back into config object. */ void wxInterface::CheckAndAddSupportedLangs() { wxArrayString conflangs, supportedlangs; wxString tmpname; int numlang; int i; // loop counter /* List of supported langs - add new ones to the bottom */ supportedlangs.Add(wxT("Default")); supportedlangs.Add(wxT("German")); supportedlangs.Add(wxT("Estonian")); m_config->SetPath(wxT("/General/Lang")); m_config->Read(wxT("NumLang"), &numlang, 1); /* Loop through config and read all languages to conflangs array */ for (i=0; i<numlang; i++) { m_config->Read( wxString::Format(wxT("%d"), i), &tmpname, wxT("Default") ); conflangs.Add(tmpname); } /** * Loop through supportedlangs array * and add missing items to conflangs */ for (i=0; i<(int)supportedlangs.GetCount(); i++) { if (conflangs.Index(supportedlangs.Item(i)) == wxNOT_FOUND) { conflangs.Add(supportedlangs.Item(i)); } } /* Write conflangs array back to config */ for (i=0; i<(int)conflangs.GetCount(); i++) { m_config->Write( wxString::Format(wxT("%d"), i), conflangs.Item(i) ); } m_config->Write(wxT("NumLang"), (int)conflangs.GetCount()); } /** * Same as above in CheckAndAddSupportedLangs() function, we loop through our * built-in iconsets list and add the missing elements to config object. */ void wxInterface::CheckAndAddSupportedIconSets() { wxArrayString conficonsets, supportediconsets; wxString tmpname; int numiconsets; int i; // loop counter /* List of supported langs - add new ones to the bottom */ supportediconsets.Add(wxT("Default")); supportediconsets.Add(wxT("eMule_Greyscale")); supportediconsets.Add(wxT("eMule_Inverted")); m_config->SetPath(wxT("/General/IconSets")); m_config->Read(wxT("NumIconSets"), &numiconsets, 1); /* Loop through config and read all languages to conflangs array */ for (i=0; i<numiconsets; i++) { m_config->Read( wxString::Format(wxT("%d"), i), &tmpname, wxT("Default") ); conficonsets.Add(tmpname); } /** * Loop through supportedlangs array and *add missing items to conflangs */ for (i=0; i<(int)supportediconsets.GetCount(); i++) { if (conficonsets.Index(supportediconsets.Item(i)) == wxNOT_FOUND) { conficonsets.Add(supportediconsets.Item(i)); } } /* Write conflangs array back to config */ for (i=0; i<(int)conficonsets.GetCount(); i++) { m_config->Write( wxString::Format(wxT("%d"), i), conficonsets.Item(i) ); } m_config->Write(wxT("NumIconSets"), (int)conficonsets.GetCount()); } /** * This method's purpose is to determine the wxWindows constant for given * language (affects dates/times/currencies etc). Input variable [lang] * should be any language name. On success, correct localization setting * is returned, while if no match is found, wxLANGUAGE_DEFAULT is * returned (use system setting). */ int wxInterface::GetLangType(const wxString lang) { if (lang == wxT("German")) { return wxLANGUAGE_GERMAN; } else if (lang == wxT("Estonian")) { return wxLANGUAGE_ESTONIAN; } else { return wxLANGUAGE_DEFAULT; } } --- NEW FILE: wxInterface.dev --- [Project] FileName=xmule2-ui-wx.dev Name=xmule2-ui-wx UnitCount=55 Type=0 Ver=1 ObjFiles= Includes= Libs= PrivateResource=xmule2-ui-wx_private.rc ResourceIncludes=G:\Dev-Cpp\include MakeIncludes= Compiler= CppCompiler=-D__HAVE_REMOVE_GROWABLE_COL__ -D_X86_=1 -DWIN32 -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -mthreads -DSTRICT -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions_@@_ Linker=-lwxmsw241 -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid _@@_ IsCpp=1 Icon=xmule2-ui-wx.ico ExeOutput= ObjectOutput= OverrideOutput=0 OverrideOutputName=xmule2-ui-wx.exe HostApplication= Folders=doc,src CommandLine= IncludeVersionInfo=0 SupportXPThemes=1 CompilerSet=0 CompilerSettings=000000000100100000 [Unit1] FileName=defines.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit2] FileName=SearchListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit3] FileName=SearchListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit4] FileName=SearchWnd.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit5] FileName=SearchWnd.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit6] FileName=ServerListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit7] FileName=ServerListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit8] FileName=ServerWnd.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit9] FileName=ServerWnd.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit10] FileName=StatusBar.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit11] FileName=StatusBar.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit12] FileName=xMuleDlg.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit13] FileName=xMuleDlg.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit14] FileName=xMuleGUI.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit15] FileName=xMuleGUI.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit16] FileName=xMuleGUI_wdr.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit17] FileName=xMuleGUI_wdr.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit18] FileName=xmule2-ui-wx_private.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit19] FileName=xmule2-ui-wx_private.rc CompileCpp=1 Folder=src Compile=1 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [VersionInfo] Major=0 Minor=1 Release=1 Build=1 LanguageID=1033 CharsetID=1252 CompanyName= FileVersion= FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= ProductVersion= AutoIncBuildNr=0 [Unit20] FileName=..\TODO CompileCpp=1 Folder= Compile=0 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit21] FileName=..\INSTALL Folder= Compile=0 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit22] FileName=..\LICENCE Folder= Compile=0 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit23] FileName=..\Changelog Folder= Compile=0 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit24] FileName=..\doc\Source Folder=doc Compile=0 Link=0 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit25] FileName=TransferWnd.cpp Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= CompileCpp=1 [Unit26] FileName=TransferWnd.h Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= CompileCpp=1 [Unit27] FileName=SharedFilesWnd.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit28] FileName=SharedFilesWnd.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit29] FileName=MessagesWnd.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit30] FileName=MessagesWnd.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit31] FileName=StatisticsWnd.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit32] FileName=StatisticsWnd.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit33] FileName=ColorFrameCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit34] FileName=ColorFrameCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit35] FileName=StatisticsTreeCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit36] FileName=StatisticsTreeCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit37] FileName=SharedFilesListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit38] FileName=SharedFilesListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit39] FileName=DownloadListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit40] FileName=DownloadListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit42] FileName=UploadListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit41] FileName=UploadListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit44] FileName=QueueListCtrl.h CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit43] FileName=QueueListCtrl.cpp CompileCpp=1 Folder=src Compile=1 Link=1 Priority=1000 OverrideBuildCmd=... [truncated message content] |