OSDN Git Service

VP27マージ
[peercast-im/PeerCastIM.git] / c: / Git / PeerCast.root / PeerCast / ui / win32 / simple / Simple.cpp
index d2712fe..13f67e0 100644 (file)
@@ -197,6 +197,8 @@ int APIENTRY WinMain(HINSTANCE hInstance,
 
        hInst = hInstance;
 
+       version_ex = 0; // PP\94Å\8ag\92£\8b@\94\\82ð\96³\8cø\82É
+
        iniFileName.set(".\\peercast.ini");
 
        WIN32_FIND_DATA fd; //JP-EX
@@ -1290,11 +1292,14 @@ LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
                case WM_INITDIALOG:
                        //SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENT);
 //                     SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENTJP);
-#ifdef VERSION_EX
-                       SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENTEX);
-#else
-                       SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENTVP);
-#endif
+                       if (version_ex)
+                       {
+                               SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENTEX);
+                       } else
+                       {
+                               SendDlgItemMessage(hDlg,IDC_ABOUTVER,WM_SETTEXT,0,(LONG)PCX_AGENTVP);
+                       }
+
                        return TRUE;
 
                case WM_COMMAND:
@@ -1365,6 +1370,15 @@ LRESULT CALLBACK ChanInfoProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
                                {
                                        SendDlgItemMessage(hDlg,IDC_EDIT_STATUS,WM_SETTEXT,0,(LONG)ch->getStatusStr());
                                        SendDlgItemMessage(hDlg, IDC_KEEP,BM_SETCHECK, ch->stayConnected, 0);
+
+                                       // \8c»\8dÝ\82Ì\8cÅ\97L\83\8a\83\8c\81[\8fã\8cÀ\90Ý\92è\82ð\95\\8e¦(0\82Í\96³\8cø)
+                                       ::SetDlgItemInt(hDlg, IDC_EDIT_MAXRELAYS, ch->maxRelays, false);
+                                       if (isIndexTxt(ch))
+                                       {
+                                               // index.txt\82È\82Ì\82Å\96³\8cø\82É
+                                               ::EnableWindow(::GetDlgItem(hDlg, IDC_EDIT_MAXRELAYS), false);
+                                               ::EnableWindow(::GetDlgItem(hDlg, IDC_APPLY_MAXRELAYS), false);
+                                       }
                                }else
                                {
                                        SendDlgItemMessage(hDlg,IDC_EDIT_STATUS,WM_SETTEXT,0,(LONG)"OK");
@@ -1406,18 +1420,18 @@ LRESULT CALLBACK ChanInfoProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
 
                                switch (LOWORD(wParam))
                                {
-                                       case IDC_CONTACT:
+                               case IDC_CONTACT:
                                        {
                                                sys->getURL(chanInfo.url);
                                                return TRUE;
                                        }
-                                       case IDC_DETAILS:
+                               case IDC_DETAILS:
                                        {
                                                sprintf(str,"admin?page=chaninfo&id=%s&relay=%d",idstr,chanInfoIsRelayed);
                                                sys->callLocalURL(str,servMgr->serverHost.port);
                                                return TRUE;
                                        }
-                                       case IDC_KEEP:
+                               case IDC_KEEP:
                                        {
                                                Channel *ch = chanMgr->findChannelByID(chanInfo.id);
                                                if (ch)
@@ -1426,12 +1440,36 @@ LRESULT CALLBACK ChanInfoProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
                                        }
 
 
-                                       case IDC_PLAY:
+                               case IDC_PLAY:
                                        {
                                                chanMgr->findAndPlayChannel(chanInfo,false);
                                                return TRUE;
                                        }
 
+                               case IDC_APPLY_MAXRELAYS:
+                                       {
+                                               // \83`\83\83\83\93\83l\83\8b\8cÅ\97L\82Ì\8dÅ\91å\83\8a\83\8c\81[\90\94\82ð\90Ý\92è
+                                               BOOL bSucc;
+                                               unsigned int mr;
+
+                                               // \93ü\97Í\92l\8eæ\93¾
+                                               mr = ::GetDlgItemInt(hDlg, IDC_EDIT_MAXRELAYS, &bSucc, false);
+
+                                               if (bSucc)
+                                               {
+                                                       Channel *ch = chanMgr->findChannelByID(chanInfo.id);
+                                                       if (ch && !isIndexTxt(ch))
+                                                       {
+                                                               ch->maxRelays = mr;
+                                                       }
+                                               } else
+                                               {
+                                                       MessageBox(hDlg, "\93ü\97Í\92l\82ª\95s\90³\82Å\82·\81B", "Error", MB_OK|MB_ICONERROR|MB_APPLMODAL);
+                                                       Channel *ch = chanMgr->findChannelByID(chanInfo.id);
+                                                       if (ch)
+                                                               ::SetDlgItemInt(hDlg, IDC_EDIT_MAXRELAYS, ch->maxRelays, false);
+                                               }
+                                       }
                                }
                        }
                        break;