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: <bo...@us...> - 2003-11-22 02:51:10
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv7828 Added Files: README Log Message: Added this file to provide information for non Linux users on how to compile the code --- NEW FILE: README --- The code for the core should compile fine for Linux, Mac OS X and Win32 (using the MingW32 version of the compiler gcc). Linux ----- No changes are needed. Simply type "make -f Makefile.cvs" and everything should be ok. Windows 95, 98, ME, NT, 2K, XP (and whatever will follow) --------------------------------------------------------- Edit Makefile.cvs so that the Line starting with CPPFLAGS also contains the option -DWIN32. Afterwards, type "make -f Makefile.cvs" and everything should be ok. Mac OS X -------- Edit Makefile.cvs so that the Line starting with CPPFLAGS also contains the option -DMACOSX. Type "make -f Makefile.cvs" after that, and everything should be ok. |
From: <bo...@us...> - 2003-11-22 02:50:21
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv7741 Modified Files: ParseClass.h Log Message: Added support for reading values to variables of different types as in the ed2k packet format string. I.e. you ca now use e.g. u32 a; Get(a,"msglen") where the format string is '<WORD>msglen' Index: ParseClass.h =================================================================== RCS file: /cvsroot/sharedaemon/core/src/ParseClass.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ParseClass.h 20 Nov 2003 16:27:25 -0000 1.8 +++ ParseClass.h 22 Nov 2003 02:50:17 -0000 1.9 @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef PARSECLASS_H +#define PARSECLASS_H + /* * *** ATTENTION *** ATTENTION *** ATTENTION *** * @@ -34,6 +37,7 @@ #include "osdep.h" // For PRINTF_FORMAT #include "util.h" #include "mprintf.h" +#include "parse-ed2k.h" #include <cassert> #include <cstdarg> @@ -41,6 +45,36 @@ #include <cstdlib> #include <new> +/* +#define STRUCT 0 +#define BITMAP 1 +#define TAG 9 +#define EMPTY 11 +#define NUM_TYPES 12 +*/ + +/* + * Run Time Type Information. + * + * Special care must be taken on BYTE and CHAR as one cannot distinquished + * between them. Thus GetTypeID(BYTE) == GetTypeID(CHAR)! + */ +template <class T> int GetTypeID( T &t ) { generate=error+on+invalid+type; } +inline int GetTypeID( char &t ) { return CHAR; } +inline int GetTypeID( unsigned char &t ) { return BYTE; } +inline int GetTypeID( signed char &t ) { return BYTE; } +inline int GetTypeID( short &t ) { return WORD; } +inline int GetTypeID( unsigned short &t ) { return WORD; } +inline int GetTypeID( long &t ) { return DWORD; } +inline int GetTypeID( unsigned long &t ) { return DWORD; } +inline int GetTypeID( int &t ) { return DWORD; } +inline int GetTypeID( unsigned int &t ) { return DWORD; } +inline int GetTypeID( range &t ) { return RANGE; } +inline int GetTypeID( ipport &t ) { return IPPORT; } +inline int GetTypeID( hash &t ) { return HASH; } +inline int GetTypeID( tag &t ) { return TAG; } +inline int GetTypeID( bitmap &t ) { return BITMAP; } + #define ISSTRUCT(x) true #define ISARRAY(x) true @@ -190,6 +224,38 @@ size_t IncrementalReadNonArray(const u8 * buffer,size_t buffsize); size_t IncrementalReadArray(const u8 * buffer,size_t buffsize); + template <class D,class S> void Cast(D & dst,const S & src) const { + fprintf(stderr,"%s:%s:%i: FATAL: Cannot cast types.\n" + ,__FILE__,__FUNCTION__,__LINE__ + ); + abort(); + } + + void Cast(unsigned long & dst,const u16 & src) const { dst=src; } + void Cast(unsigned int & dst,const u16 & src) const { dst=src; } + void Cast(unsigned short & dst,const u16 & src) const { dst=src; } + + void Cast(unsigned long & dst,const u8 & src) const { dst=src; } + void Cast(unsigned int & dst,const u8 & src) const { dst=src; } + void Cast(unsigned short & dst,const u8 & src) const { dst=src; } + +/* +inline int GetTypeID( char &t ) { return CHAR; } +inline int GetTypeID( unsigned char &t ) { return BYTE; } +inline int GetTypeID( signed char &t ) { return BYTE; } +inline int GetTypeID( short &t ) { return WORD; } +inline int GetTypeID( unsigned short &t ) { return WORD; } +inline int GetTypeID( long &t ) { return DWORD; } +inline int GetTypeID( unsigned long &t ) { return DWORD; } +inline int GetTypeID( int &t ) { return DWORD; } +inline int GetTypeID( unsigned int &t ) { return DWORD; } +inline int GetTypeID( range &t ) { return RANGE; } +inline int GetTypeID( ipport &t ) { return IPPORT; } +inline int GetTypeID( hash &t ) { return HASH; } +inline int GetTypeID( tag &t ) { return TAG; } +inline int GetTypeID( bitmap &t ) { return BITMAP; } +*/ + /* * Get * @@ -211,63 +277,59 @@ fprintf( stderr, "%s:%s:%i: expr=\"%s\" is invalid or index=%i " - "is out of range\n", - __FILE__,__FUNCTION__,__LINE__,expr,index + "is out of range\n" + ,__FILE__,__FUNCTION__,__LINE__,expr,index ); abort(); } -/* - printf("*** MARK *** "); fflush(stdout); -*/ - if (!struc && !array) { -/* - printf(" !struc && !array "); fflush(stdout); -*/ - var=*(T*)(data+size*index+ps->offset); + void * ptr=data+size*index+ps->offset; + + if (GetTypeID(var) == ps->type_id) { + var=*(T*)ptr; + } else { + int tid=GetTypeID(var); + + switch (ps->type_id) { + case WORD: + if (tid==DWORD) { + Cast(var,*(u16*)ptr); + return; + } + break; + case BYTE: + if (tid==DWORD || tid==WORD) { + Cast(var,*(u8 *)ptr); + return; + } + break; + default: + /* nothing to do here */ + break; + } + + fprintf(stderr, + "%s:%s:%i: FATAL: Type doesn " + "not match. %s was expected " + "but %s was given\n" + ,__FILE__,__FUNCTION__,__LINE__ + ,::type[ps->type_id].type_name + ,tid>=0 + ?::type[tid].type_name + :"<special>" + ); + abort(); + } } else { -/* - printf("!(!struc && !array) "); fflush(stdout); -*/ ParseClass * PC=*(ParseClass**) (data+size*(index+1)-sizeof(ParseClass*)); -/* - printf("PC=%p, ",reinterpret_cast<void*>(PC)); - fflush(stdout); -*/ if (struc) { -/* - printf("struct\n"); - printf( - ">>PC[ps->referer_id]." - "Get(var,next_index,subexpr)\n" - ); -*/ PC[ps->referer_id].Get(var,next_index,subexpr); -/* - printf( - "<<PC[ps->referer_id]." - "Get(var,next_index,subexpr)\n" - ); -*/ } else { -/* - printf("!struct\n"); - printf( - "PC->data=%p, PC->size=%i, " - "next_index=%i, PC->nume=%i\n" - ,PC->data,PC->size, - next_index,PC->nume - ); -*/ var=*(T*)(PC->data+PC->size*next_index); } } - -/* - printf("*** MARK 2 *** "); fflush(stdout); -*/ } /* @@ -433,3 +495,5 @@ Set(var,0,expr); } }; + +#endif // #ifndef PARSECLASS_H |
From: <bo...@us...> - 2003-11-22 02:46:58
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv7306 Modified Files: xmuletypes.h Log Message: Removed unused type declaration Index: xmuletypes.h =================================================================== RCS file: /cvsroot/sharedaemon/core/src/xmuletypes.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- xmuletypes.h 20 Nov 2003 16:27:25 -0000 1.5 +++ xmuletypes.h 22 Nov 2003 02:46:55 -0000 1.6 @@ -49,8 +49,6 @@ #endif -typedef u8 ed2khash[16]; - #ifdef __cplusplus extern "C" { #endif // #ifdef __cplusplus |
From: <bo...@us...> - 2003-11-22 02:46:35
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv7269 Modified Files: test.cpp Log Message: Fixed a new warning Index: test.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/test.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- test.cpp 22 Nov 2003 02:44:35 -0000 1.26 +++ test.cpp 22 Nov 2003 02:46:32 -0000 1.27 @@ -768,7 +768,7 @@ switch ((u16)p.GetProtocol()*0x100+p.GetOpcode()) { case 0xe338: // Servermessage - u16 msglen; + u16 msglen,i; char * msg; if (!PClist["e338"]) { @@ -781,7 +781,7 @@ PC->Get(msglen,"message_len"); printf("msglen=%u\n",msglen); msg=new char[msglen+1]; - for (u16 i=0;i<msglen;++i) { + for (i=0;i<msglen;++i) { PC->GetF(msg[i],"message[%u]",i); } msg[i]=0; |
From: <bo...@us...> - 2003-11-22 02:44:39
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv7072 Modified Files: test.cpp Log Message: * Server message string was not \0-ended, fixed. * Cosmetic change on output of server message Index: test.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/test.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- test.cpp 20 Nov 2003 16:27:25 -0000 1.25 +++ test.cpp 22 Nov 2003 02:44:35 -0000 1.26 @@ -648,7 +648,7 @@ tmp=time(NULL); t=localtime(&tmp); - printf("%04u-%02u-%02u %02u:%02u'%02u: %s",1900+t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec,msg); + 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 Client_Tcp_Sending_Hello_Packet(u32 id) { @@ -780,10 +780,11 @@ PC->Read(p.GetPtr(),p.GetSize()); PC->Get(msglen,"message_len"); printf("msglen=%u\n",msglen); - msg=new char[msglen]; + msg=new char[msglen+1]; for (u16 i=0;i<msglen;++i) { PC->GetF(msg[i],"message[%u]",i); } + msg[i]=0; Log(msg); break; |
From: <bo...@us...> - 2003-11-22 02:41:28
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv6761 Modified Files: ParseClass.cpp Log Message: Fixed a warning (wrong type of argument to printf, size_t where int was expected) Index: ParseClass.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/ParseClass.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ParseClass.cpp 20 Nov 2003 16:27:25 -0000 1.8 +++ ParseClass.cpp 22 Nov 2003 02:41:25 -0000 1.9 @@ -135,7 +135,7 @@ } *index=strtoul(expr,&var,0); - if (debug_now) printf("*index=%i\n",*index); + if (debug_now) printf("*index=%u\n",(unsigned int)*index); expr=var; if (*(expr-1)=='[') { fprintf(stderr, |
From: <bo...@us...> - 2003-11-22 02:39:26
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv6467 Modified Files: Ed2kSocket.cpp Log Message: Fixed bug, which caused an attempt to allocate 4G of RAM if an ed2k packet with size 0 is being received Index: Ed2kSocket.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Ed2kSocket.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Ed2kSocket.cpp 20 Nov 2003 16:27:25 -0000 1.5 +++ Ed2kSocket.cpp 22 Nov 2003 02:39:23 -0000 1.6 @@ -189,6 +189,14 @@ } in_SumPacketSizes-=in_Ed2kPacketSize+5; + if (!in_Ed2kPacketSize) { + return; + /* + * FIXME: throw an exception, close the socket, let + * the computer explode etc. ... + */ + } + ed2kpacket.SetData(in_protocol,*(data+5),in_Ed2kPacketSize-1,data+6); in_Ed2kPacketSize=0xffffffff; |
From: <bo...@us...> - 2003-11-21 19:31:05
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv29138 Modified Files: Makefile.cvs Log Message: Accidentally declared /usr/i686-mingw32msvc/bin/g++ and /usr/i686-mingw32msvc/bin/gcc as compilers. Fixed now. Index: Makefile.cvs =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Makefile.cvs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.cvs 21 Nov 2003 04:04:17 -0000 1.9 +++ Makefile.cvs 21 Nov 2003 19:31:02 -0000 1.10 @@ -20,8 +20,8 @@ all: test -CXX = /usr/i686-mingw32msvc/bin/g++ -CC = /usr/i686-mingw32msvc/bin/gcc +#CXX = /usr/i686-mingw32msvc/bin/g++ +#CC = /usr/i686-mingw32msvc/bin/gcc CFLAGS = -g -Wall -O3 -std=c99 CXXFLAGS = -g -Wall -O3 |
From: <ma...@us...> - 2003-11-21 14:18:16
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv411 Modified Files: GUISettingsDlg.cpp Log Message: Removed leftovers of old code Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- GUISettingsDlg.cpp 21 Nov 2003 14:13:36 -0000 1.17 +++ GUISettingsDlg.cpp 21 Nov 2003 14:18:10 -0000 1.18 @@ -190,18 +190,6 @@ default: break; } - /** - * If show_menu or show_tool or tool_align value doesn't match what was - * previously written in config, display the notification box. - */ -// ::wxMessageBox( -// _("Menubar and Toolbar settings changes\n" -// "require interface restart to take effect."), -// _("Restart needed"), -// wxOK|wxCENTRE|wxICON_INFORMATION -// ); -// } - /* And finally save to config object. */ m_config->Write(wxT("Font"), GetFont()->GetSelection()); m_config->Write(wxT("Icon set"), GetIconSet()->GetSelection()); |
From: <ma...@us...> - 2003-11-21 14:15:37
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv32403 Modified Files: Changelog Log Message: Toolbar/Menubar displayment/orientation can now be changed w/o restarting the interface. Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- Changelog 21 Nov 2003 11:12:17 -0000 1.91 +++ Changelog 21 Nov 2003 14:15:34 -0000 1.92 @@ -21,6 +21,8 @@ ############################################################################### 2003/11/21 Alo Sarv + * Toolbar/Menubar displayment/orientation can now be changed w/o + restarting the interface. * Fixed resource directory access if current working directory differs from application binary directory. Fixes wxMac resource dir access issues also. |
From: <ma...@us...> - 2003-11-21 14:13:39
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv31967 Modified Files: GUISettingsDlg.cpp MainDlg.cpp MainDlg.h Log Message: Toolbar/Menubar displayment/orientation can now be changed w/o restart. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- GUISettingsDlg.cpp 20 Nov 2003 01:27:26 -0000 1.16 +++ GUISettingsDlg.cpp 21 Nov 2003 14:13:36 -0000 1.17 @@ -194,19 +194,13 @@ * If show_menu or show_tool or tool_align value doesn't match what was * previously written in config, display the notification box. */ - if ( - ((old_show_menu != show_menu) || - (old_show_tool != show_tool) || - (old_tool_align != tool_align)) && - (notfirstload) - ) { - ::wxMessageBox( - _("Menubar and Toolbar settings changes\n" - "require interface restart to take effect."), - _("Restart needed"), - wxOK|wxCENTRE|wxICON_INFORMATION - ); - } +// ::wxMessageBox( +// _("Menubar and Toolbar settings changes\n" +// "require interface restart to take effect."), +// _("Restart needed"), +// wxOK|wxCENTRE|wxICON_INFORMATION +// ); +// } /* And finally save to config object. */ m_config->Write(wxT("Font"), GetFont()->GetSelection()); @@ -246,6 +240,15 @@ wxT("CurLang"), GetLang()->GetString(GetLang()->GetSelection()) ); + + if ((old_show_tool != show_tool) || (old_tool_align != tool_align)) { + mainframe->CreateMyToolBar(); + } + + if (old_show_menu != show_menu) { + mainframe->CreateMenuBar(); + } + } /* Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MainDlg.cpp 20 Nov 2003 12:02:20 -0000 1.2 +++ MainDlg.cpp 21 Nov 2003 14:13:36 -0000 1.3 @@ -85,23 +85,14 @@ 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(); - } + 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(); - } + CreateMenuBar(); /* Set application icon */ wxIcon icon; @@ -214,6 +205,18 @@ */ void CMainDlg::CreateMyToolBar() { int tool_align; + + wxToolBar *tb = GetToolBar(); + delete tb; + SetToolBar(NULL); + + /* Create toolbar */ + bool show_tool = true; + m_config->Read(wxT("/General/Show toolbar"), &show_tool, true); + if (!show_tool) { + return; + } + m_config->Read( wxT("/General/Toolbar alignment"), &tool_align, wxTB_HORIZONTAL ); @@ -261,6 +264,7 @@ /* And go live */ tb->Realize(); + SetToolBar(tb); } /* @@ -289,8 +293,8 @@ */ void CMainDlg::ShowServerWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_SERVERS, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->ToggleTool(ID_BTN_SERVERS, true); } m_lastbtn = ID_BTN_SERVERS; SetActiveDialog(serverwnd); @@ -301,11 +305,6 @@ */ wxSizeEvent null_event; serverwnd->OnSize(null_event); - - /** - * Force toolbar refresh to fix OS X drawing problems - */ - tb->Refresh(); } /** @@ -313,16 +312,11 @@ */ void CMainDlg::ShowTransferWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_TRANSFER, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->ToggleTool(ID_BTN_TRANSFER, true); } m_lastbtn = ID_BTN_TRANSFER; SetActiveDialog(transferwnd); - - /** - * Force toolbar refresh to fix OS X drawing problems - */ - tb->Refresh(); } /** @@ -330,15 +324,11 @@ */ void CMainDlg::ShowSearchWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_SEARCH, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->ToggleTool(ID_BTN_SEARCH, true); } m_lastbtn = ID_BTN_SEARCH; SetActiveDialog(searchwnd); - /** - * Force toolbar refresh to fix OS X drawing problems - */ - tb->Refresh(); } /** @@ -346,15 +336,11 @@ */ void CMainDlg::ShowSharedFilesWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_SHARED_FILES, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->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(); } /** @@ -362,15 +348,11 @@ */ void CMainDlg::ShowMessagesWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_MESSAGES, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->ToggleTool(ID_BTN_MESSAGES, true); } m_lastbtn = ID_BTN_MESSAGES; SetActiveDialog(messageswnd); - /** - * Force toolbar refresh to fix OS X drawing problems - */ - tb->Refresh(); } /** @@ -378,25 +360,17 @@ */ void CMainDlg::ShowStatisticsWnd(wxCommandEvent &event) { if (show_tool) { - tb->ToggleTool(m_lastbtn, false); - tb->ToggleTool(ID_BTN_STATISTICS, true); + GetToolBar()->ToggleTool(m_lastbtn, false); + GetToolBar()->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(); } /** @@ -409,10 +383,6 @@ ); guisettings->ShowModal(); delete guisettings; - /** - * Force toolbar refresh to fix OS X drawing problems - */ - tb->Refresh(); } /** @@ -446,11 +416,18 @@ * Generates our menubar. */ void CMainDlg::CreateMenuBar() { + bool show_menu = false; + SetMenuBar(NULL); + + m_config->Read(wxT("/General/Show menubar"), &show_menu, false); + if (!show_menu) { + return; + } 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")); Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- MainDlg.h 20 Nov 2003 01:27:26 -0000 1.1 +++ MainDlg.h 21 Nov 2003 14:13:36 -0000 1.2 @@ -64,20 +64,20 @@ ~CMainDlg(); wxLocale &m_locale; + void CreateMyToolBar(); + void CreateMenuBar(); private: DECLARE_EVENT_TABLE() - + /* Member event handler functions */ - void OnCloseWindow( wxCloseEvent &event ); + void OnCloseWindow( wxCloseEvent &event ); void OnBtnGUIOk(wxCommandEvent &event); void OnBtnGUICancel(wxCommandEvent &event); - - /* Member functions */ + + /* Member functions */ void SetActiveDialog(wxWindow* dlg); - void CreateMyToolBar(); void CreateSysTray(); - void CreateMenuBar(); void LoadAndShowDialogPages(); void ConnectToAnyServer(wxCommandEvent &event); @@ -96,7 +96,6 @@ // 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 }; |
From: <ma...@us...> - 2003-11-21 12:46:14
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv16982 Modified Files: ServerWnd.cpp ServerWnd.h wxInterface_wdr.cpp wxInterface_wdr.h wxInterface.wdr Log Message: Minor sizing changes and removed ServerList image from server page. Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- ServerWnd.cpp 20 Nov 2003 01:27:26 -0000 1.37 +++ ServerWnd.cpp 21 Nov 2003 12:46:10 -0000 1.38 @@ -70,7 +70,6 @@ Hide(); /* Set the images of static bitmaps on this page. */ - GetServerListImage()->SetBitmap(img->servers); GetSSBitmapProvider()->SetBitmap(img->provider); GetBtnToggleSidebar()->SetBitmapLabel(img->leftarrow); Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ServerWnd.h 20 Nov 2003 01:27:26 -0000 1.26 +++ ServerWnd.h 21 Nov 2003 12:46:10 -0000 1.27 @@ -93,9 +93,6 @@ wxTextCtrl* GetDebugLog() { return (wxTextCtrl*) FindWindow( ID_DEBUGLOG ); } - wxTextCtrl* GetServerLog() { - return (wxTextCtrl*) FindWindow( ID_SERVERINFO ); - } wxButton* GetUpdate() { return (wxButton*) FindWindow( ID_UPDATE ); } @@ -108,15 +105,9 @@ wxTextCtrl* GetServerip() { return (wxTextCtrl*) FindWindow( ID_SERVERIP ); } - wxStaticText* GetTxtServer() { - return (wxStaticText*) FindWindow( ID_TXT_SERVER ); - } wxSplitterWindow* GetHorizontalSplitter() { return (wxSplitterWindow*) FindWindow(ID_SERVER_SPLITTER_HORIZONTAL); - } - wxStaticBitmap* GetServerListImage() { - return (wxStaticBitmap*) FindWindow(ID_SERVERS_IMAGE); } wxBitmapButton* GetBtnToggleSidebar() { return (wxBitmapButton*) FindWindow(ID_BTN_TOGGLE_SIDEBAR); Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wxInterface_wdr.cpp 20 Nov 2003 01:27:26 -0000 1.1 +++ wxInterface_wdr.cpp 21 Nov 2003 12:46:10 -0000 1.2 @@ -56,44 +56,11 @@ wxFlexGridSizer *item1 = new wxFlexGridSizer( 1, 0, 0 ); item1->AddGrowableCol( 0 ); - item1->AddGrowableRow( 1 ); - - wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBitmap *item3 = new wxStaticBitmap( parent, ID_SERVERS_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item2->Add( item3, 0, wxALIGN_CENTER|wxTOP|wxBOTTOM, 5 ); - - wxStaticText *item4 = new wxStaticText( parent, ID_TXT_SERVER, _("Servers"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 ); - - item1->Add( item2, 0, 0, 5 ); - - CServerListCtrl *item5 = new CServerListCtrl( parent, ID_SERVERLISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER ); - item1->Add( item5, 0, wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - - item0->Add( item1, 0, wxGROW, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} + item1->AddGrowableRow( 0 ); -wxSizer *ServerInfo( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxFlexGridSizer *item0 = new wxFlexGridSizer( 2, 0, 0 ); - item0->AddGrowableCol( 0 ); - item0->AddGrowableRow( 0 ); + CServerListCtrl *item2 = new CServerListCtrl( parent, ID_SERVERLISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER ); + item1->Add( item2, 0, wxGROW|wxRIGHT|wxTOP, 5 ); - wxTextCtrl *item1 = new wxTextCtrl( parent, ID_SERVERINFO, wxT(""), wxDefaultPosition, wxSize(80,40), wxTE_MULTILINE|wxTE_READONLY ); item0->Add( item1, 0, wxGROW, 5 ); if (set_sizer) @@ -949,7 +916,7 @@ DebugLog( item4, FALSE ); item2->AddPage( item4, _("Debug Log") ); - item0->Add( item1, 0, wxGROW|wxALL, 5 ); + item0->Add( item1, 0, wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5 ); if (set_sizer) { Index: wxInterface_wdr.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wxInterface_wdr.h 20 Nov 2003 01:27:26 -0000 1.1 +++ wxInterface_wdr.h 21 Nov 2003 12:46:10 -0000 1.2 @@ -28,139 +28,134 @@ // Declare window functions -#define ID_SERVERS_IMAGE 10000 -#define ID_TXT_SERVER 10001 -#define ID_SERVERLISTCTRL 10002 +#define ID_SERVERLISTCTRL 10000 wxSizer *Server_List( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_SERVERINFO 10003 -wxSizer *ServerInfo( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_LOG 10004 +#define ID_LOG 10001 wxSizer *Log( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_DEBUGLOG 10005 +#define ID_DEBUGLOG 10002 wxSizer *DebugLog( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_TEXT 10006 -#define ID_SEARCHSTRING 10007 -#define ID_SEARCHMETHOD 10008 -#define ID_SEARCHTYPE 10009 -#define ID_BTN_RESET 10010 -#define ID_MINSIZE 10011 -#define ID_MAXSIZE 10012 -#define ID_AVAIL 10013 -#define ID_EXTENSION 10014 -#define ID_TEXTCTRL 10015 -#define ID_SEARCH_RESULTS_IMAGE 10016 -#define ID_BUTTON 10017 -#define ID_SEARCHRESULTS 10018 -#define ID_GAUGE 10019 +#define ID_TEXT 10003 +#define ID_SEARCHSTRING 10004 +#define ID_SEARCHMETHOD 10005 +#define ID_SEARCHTYPE 10006 +#define ID_BTN_RESET 10007 +#define ID_MINSIZE 10008 +#define ID_MAXSIZE 10009 +#define ID_AVAIL 10010 +#define ID_EXTENSION 10011 +#define ID_TEXTCTRL 10012 +#define ID_SEARCH_RESULTS_IMAGE 10013 +#define ID_BUTTON 10014 +#define ID_SEARCHRESULTS 10015 +#define ID_GAUGE 10016 wxSizer *SearchWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); wxSizer *ContentSizer( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_SHARED_FILES_IMAGE 10020 -#define ID_TXT_SHARED 10021 -#define ID_SHAREDLISTCTRL 10022 -#define ID_CURSES_REQUESTS 10023 -#define ID_CURSES_ACCEPTED_UPLOADS 10024 -#define ID_CURSES_TRANSFERRED 10025 -#define ID_G_REQUESTS 10026 -#define ID_G_UPLOADS 10027 -#define ID_G_TRANSFERRED 10028 -#define ID_TOTAL_REQUESTS 10029 -#define ID_TOTAL_ACCEPTED_UPLOADS 10030 -#define ID_TOTAL_TRANSFERRED 10031 +#define ID_SHARED_FILES_IMAGE 10017 +#define ID_TXT_SHARED 10018 +#define ID_SHAREDLISTCTRL 10019 +#define ID_CURSES_REQUESTS 10020 +#define ID_CURSES_ACCEPTED_UPLOADS 10021 +#define ID_CURSES_TRANSFERRED 10022 +#define ID_G_REQUESTS 10023 +#define ID_G_UPLOADS 10024 +#define ID_G_TRANSFERRED 10025 +#define ID_TOTAL_REQUESTS 10026 +#define ID_TOTAL_ACCEPTED_UPLOADS 10027 +#define ID_TOTAL_TRANSFERRED 10028 wxSizer *SharedFilesWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_FRIEND_IMAGE 10032 -#define ID_LISTCTRL 10033 -#define ID_MESSAGES_IMAGE 10034 -#define ID_NOTEBOOK 10035 +#define ID_FRIEND_IMAGE 10029 +#define ID_LISTCTRL 10030 +#define ID_MESSAGES_IMAGE 10031 +#define ID_NOTEBOOK 10032 wxSizer *MessagesWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define BTN_STAT 10036 -#define ID_STATSTREECTRL 10037 -#define ID_FOREIGN 10038 -#define ID_CON_GRAPH 10039 -#define ID_DL_SES 10040 -#define ID_DL_CUR 10041 -#define ID_DL_AVG 10042 -#define ID_DL_GRAPH 10043 -#define ID_UL_SES 10044 -#define ID_UL_CUR 10045 -#define ID_UL_AVG 10046 -#define ID_UL_GRAPH 10047 +#define BTN_STAT 10033 +#define ID_STATSTREECTRL 10034 +#define ID_FOREIGN 10035 +#define ID_CON_GRAPH 10036 +#define ID_DL_SES 10037 +#define ID_DL_CUR 10038 +#define ID_DL_AVG 10039 +#define ID_DL_GRAPH 10040 +#define ID_UL_SES 10041 +#define ID_UL_CUR 10042 +#define ID_UL_AVG 10043 +#define ID_UL_GRAPH 10044 wxSizer *StatisticsWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_LANG 10048 -#define ID_BTN_ADDLANG 10049 -#define ID_BTN_REMOVELANG 10050 -#define ID_ICONSET 10051 -#define ID_BTN_ADDICONSET 10052 -#define ID_BTN_REMOVEICONSET 10053 -#define ID_FONT 10054 -#define ID_STARTPAGE 10055 -#define ID_REMEMBER_LAST 10056 -#define ID_SHOWSPLASH 10057 -#define ID_PROMPTEXIT 10058 -#define ID_SHOWTOOL 10059 -#define ID_TOOLALIGN 10060 -#define ID_SHOWMENU 10061 -#define GUI_OK 10062 -#define GUI_CANCEL 10063 +#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 10064 +#define ID_LOGBOOK 10061 wxSizer *Server_Logs( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); extern wxSizer *sizer_updateserver; -#define ID_BTN_SHOW_UPDATELIST 10065 +#define ID_BTN_SHOW_UPDATELIST 10062 extern wxSizer *sizer_serversettings; -#define ID_BTN_SHOW_SERVERSETTINGS 10066 +#define ID_BTN_SHOW_SERVERSETTINGS 10063 extern wxSizer *sizer_portsettings; -#define ID_BTN_SHOW_PORT_OPTIONS 10067 +#define ID_BTN_SHOW_PORT_OPTIONS 10064 extern wxSizer *sizer_addserver; -#define ID_BTN_SHOW_ADDSERVER 10068 +#define ID_BTN_SHOW_ADDSERVER 10065 extern wxSizer *sizer_logoptions; -#define ID_BTN_SHOW_LOGGINGOPTIONS 10069 +#define ID_BTN_SHOW_LOGGINGOPTIONS 10066 wxSizer *Server_Sidebar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_SERVER_IP 10070 -#define ID_SERVERIP 10071 -#define ID_ADDTOLIST 10072 +#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 10073 -#define ID_UPDATE 10074 +#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 10075 -#define ID_SS_AC_STATIC_ONLY 10076 -#define ID_LINE 10077 -#define ID_SS_SERVER_IMG 10078 -#define ID_SS_SERVER_NAME 10079 -#define ID_CHECK_SS_STATIC 10080 -#define ID_SS_PRIO 10081 +#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 10082 -#define ID_TXT_LINE_LIMIT 10083 -#define ID_CHECK_SAVE_TO_DISK 10084 -#define ID_BTN_CLEAR_LOGS 10085 +#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 10086 -#define ID_BTN_ADD_LANG_OK 10087 -#define ID_BTN_ADD_LANG_CANCEL 10088 +#define ID_LANG_NAME 10083 +#define ID_BTN_ADD_LANG_OK 10084 +#define ID_BTN_ADD_LANG_CANCEL 10085 wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_CHECKBOX 10089 +#define ID_CHECKBOX 10086 wxSizer *Server_PortSettingsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_BTN_ADDICONSET_OK 10090 -#define ID_BTN_ADDICONSET_CANCEL 10091 +#define ID_BTN_ADDICONSET_OK 10087 +#define ID_BTN_ADDICONSET_CANCEL 10088 wxSizer *Dlg_AddIconSet( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); // Declare menubar functions @@ -169,7 +164,7 @@ // Declare bitmap functions -#define ID_NULL_BMP 10092 +#define ID_NULL_BMP 10089 wxBitmap Icons( size_t index ); #endif Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsdUV8Dj and /tmp/cvsC5ztfv differ |
From: <ma...@us...> - 2003-11-21 11:12:20
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv897 Modified Files: Changelog Log Message: Resource dir access fix for Mac and others. Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- Changelog 21 Nov 2003 09:08:10 -0000 1.90 +++ Changelog 21 Nov 2003 11:12:17 -0000 1.91 @@ -21,6 +21,9 @@ ############################################################################### 2003/11/21 Alo Sarv + * Fixed resource directory access if current working directory + differs from application binary directory. Fixes wxMac + resource dir access issues also. * Imported new and cool coloured compilation system by Bodo Thiesen. 2003/11/20 Alo Sarv |
From: <ma...@us...> - 2003-11-21 11:05:58
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv32422 Modified Files: wxInterface.cpp Log Message: Fixes Mac resource dir access. Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wxInterface.cpp 21 Nov 2003 10:52:47 -0000 1.4 +++ wxInterface.cpp 21 Nov 2003 11:05:55 -0000 1.5 @@ -122,7 +122,7 @@ } #if defined(__WXMAC__) && defined(__MACH__) - path.Append(wxT("Contents/Resources/")); + path.Append(wxT("../Resources/")); #endif CheckAndAddSupportedLangs(); |
From: <ma...@us...> - 2003-11-21 11:01:35
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv31787 Modified Files: Images.cpp Log Message: Fixes Mac resources dir access. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Images.cpp 21 Nov 2003 10:50:07 -0000 1.14 +++ Images.cpp 21 Nov 2003 11:01:31 -0000 1.15 @@ -52,7 +52,7 @@ } #if defined(__WXMAC__) && defined(__MACH__) - path.Append(wxT("Contents/Resources/")); + apppath.Append(wxT("../Resources/")); #endif m_config->Read( |
From: <ma...@us...> - 2003-11-21 10:52:50
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv30496 Modified Files: wxInterface.cpp Log Message: Removed extranous / from language path. Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wxInterface.cpp 21 Nov 2003 10:50:06 -0000 1.3 +++ wxInterface.cpp 21 Nov 2003 10:52:47 -0000 1.4 @@ -128,7 +128,7 @@ CheckAndAddSupportedLangs(); /* Set localization files directories */ - m_locale.AddCatalogLookupPathPrefix(path+wxT("/lang/")); + m_locale.AddCatalogLookupPathPrefix(path+wxT("lang/")); #if defined(__WXMAC__) && !defined(__MACH__) m_locale.AddCatalogLookupPathPrefix(wxT("::Resources:lang")); #endif |
From: <ma...@us...> - 2003-11-21 10:50:10
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv30106 Modified Files: wxInterface.cpp Images.cpp Log Message: Adds `Contents/Resources/` to resources path for wxMac. Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wxInterface.cpp 21 Nov 2003 10:26:08 -0000 1.2 +++ wxInterface.cpp 21 Nov 2003 10:50:06 -0000 1.3 @@ -121,6 +121,10 @@ path.RemoveLast(); } + #if defined(__WXMAC__) && defined(__MACH__) + path.Append(wxT("Contents/Resources/")); + #endif + CheckAndAddSupportedLangs(); /* Set localization files directories */ Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Images.cpp 21 Nov 2003 10:26:08 -0000 1.13 +++ Images.cpp 21 Nov 2003 10:50:07 -0000 1.14 @@ -51,12 +51,16 @@ apppath.RemoveLast(); } + #if defined(__WXMAC__) && defined(__MACH__) + path.Append(wxT("Contents/Resources/")); + #endif + m_config->Read( wxT("/General/IconSets/CurIconSet"), &path, wxT("Default") ); path.MakeLower(); path = wxString::Format( - wxT("%s/images/%s/"), apppath.c_str(), path.c_str() + wxT("%simages/%s/"), apppath.c_str(), path.c_str() ); /* |
From: <ma...@us...> - 2003-11-21 10:26:53
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv27443 Modified Files: Images.h Log Message: Removed unused MakePath() function. Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Images.h 20 Nov 2003 01:27:26 -0000 1.10 +++ Images.h 21 Nov 2003 10:26:50 -0000 1.11 @@ -50,7 +50,6 @@ leftarrow, rightarrow; private: - wxString MakePath(wxString path); void LoadImages(); }; |
From: <ma...@us...> - 2003-11-21 10:26:11
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv27352 Modified Files: Images.cpp wxInterface.cpp Log Message: Fixes resources dir access if CurrentPath != ApplicationPath Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Images.cpp 20 Nov 2003 01:27:26 -0000 1.12 +++ Images.cpp 21 Nov 2003 10:26:08 -0000 1.13 @@ -35,38 +35,34 @@ } /** - * This method converts the paths we need to platform-dependant version. - * Under wxMac, the separator is :, and relative paths must be prepended - * by :. Also, for release builds, we add ::Resources, as it is standard - * under wxMac to have resources there - packager must compile with - * -D__RELEASE__ and ensure the images are there. - */ -wxString CImages::MakePath(wxString path) { - #if defined(__WXMAC__) && !defined(__MACH__) - path.Replace(wxT("/"), wxT(":")); - path.Prepend(wxT(":")); - path.Prepend(wxT("::Resources")); - #endif - return path; -} - -/** * This method loads all images into the global variables. */ void CImages::LoadImages() { - wxString path; + wxString path, apppath; + + /** + * 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 + * application startup path != application binary path, which would + * prevent us from accessing resources. + */ + apppath = wxTheApp->argv[0]; + while (apppath.Last() != *wxT("/")) { + apppath.RemoveLast(); + } m_config->Read( wxT("/General/IconSets/CurIconSet"), &path, wxT("Default") ); path.MakeLower(); - path = wxString::Format(wxT("images/%s/"), path.c_str()); + path = wxString::Format( + wxT("%s/images/%s/"), apppath.c_str(), path.c_str() + ); /* * Under wxMac, the separator is :, and relative paths must be prepended - * by :. Also, for release builds, we add ::Resources, as it is standard - * under wxMac to have resources there - packager must compile with - * -D__RELEASE__ and ensure the images are there. + * by :. We also prepend the path by ::Resources, as it is standard + * under wxMac to have resources there. */ #if defined(__WXMAC__) && !defined(__MACH__) path.Replace(wxT("/"), wxT(":")); Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wxInterface.cpp 20 Nov 2003 01:27:26 -0000 1.1 +++ wxInterface.cpp 21 Nov 2003 10:26:08 -0000 1.2 @@ -50,7 +50,7 @@ SetVendorName(wxT("ShareDaemon")); SetAppName(wxT("wxInterface")); - + ::wxInitAllImageHandlers(); m_config = wxConfigBase::Get(); @@ -87,16 +87,16 @@ } /* - * Main program shutdown function. If anything needs to be cleaned up, do it + * 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; } @@ -108,12 +108,23 @@ * language from config object, and add the catalog. */ void wxInterface::Localize() { - wxString curlang; + wxString curlang, path; + + /** + * Get application binary path from argv[0] and remove the binary file- + * name from it, leaving only the actual path to us. Needed if current + * path differs from application path, thus preventing us from accessing + * resources. + */ + path = wxTheApp->argv[0]; + while (path.Last() != *wxT("/")) { + path.RemoveLast(); + } CheckAndAddSupportedLangs(); /* Set localization files directories */ - m_locale.AddCatalogLookupPathPrefix(wxT("lang/")); + m_locale.AddCatalogLookupPathPrefix(path+wxT("/lang/")); #if defined(__WXMAC__) && !defined(__MACH__) m_locale.AddCatalogLookupPathPrefix(wxT("::Resources:lang")); #endif |
From: <ma...@us...> - 2003-11-21 09:08:13
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15676/src Modified Files: Makefile Log Message: Imported new and cool coloured compilation system by Bodo Thiesen. Index: Makefile =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile 21 Nov 2003 03:01:32 -0000 1.28 +++ Makefile 21 Nov 2003 09:08:11 -0000 1.29 @@ -1,34 +1,99 @@ -# +++ Configuration settings section +++ +############################################################################### +# This file is part of wxInterface. # +# Copyright (C) 2001 Bodo Thiesen <bo...@gm...> # +# 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 # +############################################################################### + +################################## +# Configuration settings section # +################################## # WXCONFIG should point to your wx-config file (usually at /usr/local/bin) -WXCONFIG = /wx/dynamic/2.4.2/bin/wxgtk-2.4-config +WXCONFIG = wx-config + +## +# Either one of the following must be uncommented, but usually, not both. +# +# If CPP_FLAGS is uncommented, maximum optimization is used and no debugging +# information is generated. Recommended for release builds. +# +# If DEBUG_FLAGS is uncommented, no optimization is done and binary is created +# with debugging information (useful for developers). Debug compilation takes +# significently less time, but produces slower output binary. Recommended for +# developers. +#CPP_FLAGS = -O3 -pipe -I. -c +DEBUG_FLAGS = -pipe -I. -c -Wall -g -ggdb + +## +# Uncomment this line to enable compilation flags showing during compilation. +# This should be turned on when reporting compilation errors, so developers +# can see the exact compiler flags. +#PRINTFLAGS = true + +## +# If you have ccache installed, uncomment the following line to +# speed up repeatitive recompilations. Recommended for developers. +#CCACHE = ccache + +# Only relevant on win32 - Location of windres.exe file +WINDRES = windres.exe + +# Uncomment this on win32 systems, adds resources file to compilation objects. +#RES = wxInterface_private.res + +## +# Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, +# which should only be enabled if you have patched wxWindows with +# flexgridsizer.patch +DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ + +# Output colours. Comment out to disable output colouring. +DEFAULTCOLOR =\33[0;40;37;22m +ACTIONCOLOR =\33[0;40;37;2m +ATTENTIONCOLOR=\33[0;40;31;22m +FAILEDCOLOR = +WARNINGCOLOR =\33[0;40;33;22m +NOTICEGCOLOR =\33[0;40;33;2m +WELLCOLOR =\33[0;40;32;22m +OUTPUTCOLOR =\33[0;40;33;1m +INPUTCOLOR =\33[0;40;34;1m +FLAGCOLOR =\33[0;40;37;1m # Don't modify these - automatically generated from WXCONFIG -CXX = $(shell $(WXCONFIG) --cxx) +CXX = $(CCACHE) $(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 +# Filenames for pattern rules. These are used for +# temporary data storage, usually not needed to modify. +PIPENAME = Makefile.pipe +STDERROR = Makefile.stderr # 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 list. # +################# +# If new files are added to source tree, add them here also. +# OBJECTS = ColorFrameCtrl.o \ DownloadListCtrl.o \ GUISettingsDlg.o \ @@ -53,28 +118,96 @@ 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. +# $(RES) \ # File suffixes .SUFFIXES: .o .cpp .rc .res -# +++ Compilation/linking commands section +++ -# Compile commands. To make DEBUG build, add $(DEBUG_FLAGS) flag to this command. +############### +# Compilation # +############### + .cpp.o : - $(CXX) $(CPP_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< +ifndef PRINTFLAGS + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +else + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR) with flags $(FLAGCOLOR)$(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS)$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +endif + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(CXX) $(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< 2>$(PIPENAME); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + rm $(PIPENAME) $(STDERROR); \ + false; \ + else \ + if test -s $(STDERROR); then \ + echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + else \ + echo -e "$(WELLCOLOR)ok.$(DEFAULTCOLOR)"; \ + fi; \ + fi + @rm $(PIPENAME) $(STDERROR) + .rc.res: - windres -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) +ifndef PRINTFLAGS + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +else + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR) with flags $(FLAGCOLOR)$(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS)$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +endif + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(WINDRES -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) 2>$(PIPENAME); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + rm $(PIPENAME) $(STDERROR); \ + false; \ + else \ + if test -s $(STDERROR); then \ + echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + else \ + echo -e "$(WELLCOLOR)ok.$(DEFAULTCOLOR)"; \ + fi; \ + fi + @rm $(PIPENAME) $(STDERROR) -# Linking command -$(PROGRAM): $(OBJECTS) - $(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) +$(PROGRAM): $(OBJECTS) + @echo -e -n "$(ACTIONCOLOR)Linking $(INPUTCOLOR)$(OBJECTS)$(ACTIONCOLOR)to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) 2>$(PIPENAME) || \ + test -s $(STDERROR); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + rm $(PIPENAME) $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + false; \ + else \ + echo -e "$(WELLCOLOR)ok."; \ + rm $(PIPENAME) $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + echo -e -n "$(WELLCOLOR)Successfully compiled "; \ + echo -e -n "$(WARNINGCOLOR)$(BUILD)"; \ + echo -e -n "$(OUTPUTCOLOR)$@$(WELLCOLOR) binary!\n"; \ + echo -e "$(DEFAULTCOLOR)Now type $(OUTPUTCOLOR)./$@$(DEFAULTCOLOR) to start the application."; \ + fi -# +++ Building section +++ # All builds program with default settings. all: $(PROGRAM) +debug: $(PROGRAM_DEBUG) + # Cleanup command clean: - rm -f $(OBJECTS) $(PROGRAM) + @echo -e -n "Cleaning up..." + @rm -f $(OBJECTS) $(PROGRAM) + @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)" |
From: <ma...@us...> - 2003-11-21 09:08:13
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv15676 Modified Files: Changelog Log Message: Imported new and cool coloured compilation system by Bodo Thiesen. Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- Changelog 21 Nov 2003 08:52:40 -0000 1.89 +++ Changelog 21 Nov 2003 09:08:10 -0000 1.90 @@ -20,6 +20,9 @@ # ALWAYS keep line lenghts UNDER/AT 80 characters. # ############################################################################### +2003/11/21 Alo Sarv + * Imported new and cool coloured compilation system by Bodo Thiesen. + 2003/11/20 Alo Sarv * Renamed xMule* files to wxInterface* files. * Reimplemented SideBar in a dynamic manner. |
From: <ma...@us...> - 2003-11-21 08:52:43
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv12878 Modified Files: Changelog Log Message: Added note about Changelog usage/formatting. Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- Changelog 20 Nov 2003 01:27:26 -0000 1.88 +++ Changelog 21 Nov 2003 08:52:40 -0000 1.89 @@ -1,6 +1,24 @@ ---------------------------------------- |Changelog for ShareDaemon wxInterface | ---------------------------------------- +############################################################################### +# Notice about ShareDaemon wxInterface Changelog usage and formatting. # +# # +# Please use ONLY the following formatting in this Changelog: # +# @DATE @PERSON # +# * @CHANGE # +# # +# @DATE is date of commiting to CVS (changes that are not commited to # +# CVS should NEVER be added to Changelog # +# @PERSON is the full REAL name of the one commiting to CVS (not neccesery # +# the code author). If you wish to add your nick/handle, add it after your # +# name in parenthesis. # +# @CHANGE is a short description of the modification done. If you are not # +# the author of parts/all of the code, add note about the original author # +# in parenthesis. # +# # +# ALWAYS keep line lenghts UNDER/AT 80 characters. # +############################################################################### 2003/11/20 Alo Sarv * Renamed xMule* files to wxInterface* files. |
From: <ma...@us...> - 2003-11-21 04:44:55
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv10872 Modified Files: defines.h Log Message: Fixed taskbaricon for wxMSW Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- defines.h 20 Nov 2003 01:27:26 -0000 1.33 +++ defines.h 21 Nov 2003 04:44:52 -0000 1.34 @@ -40,8 +40,15 @@ #define m_logbook ((wxNotebook*)FindWindowById(ID_LOGBOOK)) #define prefs_ctrl ((wxListCtrl*)FindWindowById(ID_PREFSCTRL)) #define prefs_panel ((wxPanel*)FindWindowById(ID_PREFSPANEL)) -#define xmuleDlg ((wxFrame*)FindWindowByName(APPVER_LONG)) #define splitterwnd ((wxSplitterWindow*)FindWindowById(ID_SPLITTER)) + +/** + * wxWindows 2.4.2 does not define wxHAS_TASK_BAR_ICON even if it is + * supported, so we define it here. + */ +#ifdef __WXMSW__ + #define wxHAS_TASK_BAR_ICON +#endif extern wxConfigBase *m_config; |
From: <bo...@us...> - 2003-11-21 04:04:20
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv4828 Modified Files: Makefile.cvs osdep.h Log Message: Fixed compilation problem with MingW32. Index: Makefile.cvs =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Makefile.cvs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.cvs 20 Nov 2003 16:27:25 -0000 1.8 +++ Makefile.cvs 21 Nov 2003 04:04:17 -0000 1.9 @@ -20,11 +20,14 @@ all: test +CXX = /usr/i686-mingw32msvc/bin/g++ +CC = /usr/i686-mingw32msvc/bin/gcc + CFLAGS = -g -Wall -O3 -std=c99 CXXFLAGS = -g -Wall -O3 CPPFLAGS = -DXMULE2 # You may set -DHAVE_ANSI_COLORS to get colored output -LDFLAGS += -g -lm +LDFLAGS += -g -lm -lwsock32 # -lstdc++ OBJS = ClientList.oo Client.oo test.oo ClientShadow.oo Socket.oo osdep.oo \ Index: osdep.h =================================================================== RCS file: /cvsroot/sharedaemon/core/src/osdep.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- osdep.h 20 Nov 2003 16:27:25 -0000 1.10 +++ osdep.h 21 Nov 2003 04:04:17 -0000 1.11 @@ -58,7 +58,9 @@ #endif // Do POSIX stuff afterwards. #ifdef WIN32 +#define Array Hidden_Array #include <winsock2.h> +#undef Array #include <winuser.h> //#include <windows.h> #include <stdlib.h> |
From: <ma...@us...> - 2003-11-21 03:03:01
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv29924 Removed Files: Makefile.win Log Message: No longer needed. --- Makefile.win DELETED --- |