Sign in to follow this  
Followers 0
Lordy

Modify MAGNET funktion

4 posts in this topic

Hello,

is it possible to modify one magnet-funktion and how ?

The third Radiobutton in the magnet-dialog is "do_nothing". I want to chance this with "download_to" popup window.

Better

Radiobutton 1 = "Download" (to current downloadDir)

Radiobutton 2 = "Download to ..." (popup windows to select)

Radiobutton 3 = "Search"

Can anybody help please ? :P

Share this post


Link to post
Share on other sites

Not sure what you mean, but I am waiting ages for "Create New Folder" in "Browse".

Share this post


Link to post
Share on other sites

difficult to understand ? ok, some more infos.

- strongdc.rc , line 278-298 :

IDD_MAGNET DIALOGEX 0, 0, 350, 160

STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU

CAPTION "Dialog"

FONT 8, "MS Shell Dlg", 400, 0, 0x1

BEGIN

	GROUPBOX		"",IDC_STATIC,6,0,337,152

	LTEXT		   "Static",IDC_MAGNET_TEXT,68,14,262,24

	LTEXT		   "Static",IDC_MAGNET_HASH,18,44,40,8

	EDITTEXT		IDC_MAGNET_DISP_HASH,68,42,262,12,ES_AUTOHSCROLL | ES_READONLY

	LTEXT		   "Static",IDC_MAGNET_NAME,18,62,40,8

	EDITTEXT		IDC_MAGNET_DISP_NAME,68,60,262,12,ES_AUTOHSCROLL | ES_READONLY

	CONTROL		 "Radio1",IDC_MAGNET_QUEUE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,99,252,10

	CONTROL		 "Radio2",IDC_MAGNET_SEARCH,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,111,252,10

	CONTROL		 "Radio3",IDC_MAGNET_NOTHING,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,122,252,11

	CONTROL		 "Check1",IDC_MAGNET_REMEMBER,"Button",BS_AUTO3STATE | WS_TABSTOP,18,135,252,10

	DEFPUSHBUTTON   "OK",IDOK,280,115,50,14

	PUSHBUTTON	  "Cancel",IDCANCEL,280,131,50,14

	ICON			IDI_MAGNET,IDC_STATIC,18,15,20,20

	LTEXT		   "Static",IDC_MAGNET_SIZE,18,80,40,8

	EDITTEXT		IDC_MAGNET_DISP_SIZE,68,78,262,12,ES_AUTOHSCROLL | ES_READONLY

END
I wish "Radio3" to chance with funktion. IDC_MAGNET_NOTHING will not needed, so will chance it with new funktion like Download to ... or named "Browse ...". So must chance in MagnetDlg.cpp funktion IDC_MAGNET_NOTHING within IDC_BROWSE or other, but don't find IDC_Nothing-if-String. I believe find a funktion in "Winutil.cpp" at lines 1568-1590 :
		if(!fhash.empty() && Encoder::isBase32(Text::fromT(fhash).c_str())){

			// ok, we have a hash, and maybe a filename.

			if(!BOOLSETTING(MAGNET_ASK) && fsize > 0 && fname.length() > 0) {

				switch(SETTING(MAGNET_ACTION)) {

					case SettingsManager::MAGNET_AUTO_DOWNLOAD:

						try {

							QueueManager::getInstance()->add(FavoriteManager::getInstance()->getDownloadDirectory(Util::getFileExt(Text::fromT(fname))) + Text::fromT(fname), fsize, TTHValue(Text::fromT(fhash)), UserPtr());

						} catch(const Exception& e) {

							LogManager::getInstance()->message(e.getError());

						}

						break;

					case SettingsManager::MAGNET_AUTO_SEARCH:

						SearchFrame::openWindow(fhash, 0, SearchManager::SIZE_DONTCARE, SearchManager::TYPE_TTH);

						break;

				};

			} else {

			// use aOverride to force the display of the dialog.  used for auto-updating

				MagnetDlg dlg(fhash, fname, fsize);

				dlg.DoModal(mainWnd);

			}

		} else {

			MessageBox(mainWnd, CTSTRING(MAGNET_DLG_TEXT_BAD), CTSTRING(MAGNET_DLG_TITLE), MB_OK | MB_ICONEXCLAMATION);

		}

where is define MAGNET_AUTO_DOWNLOAD. But called "Radio1" and MAGNET_AUTO_SEARCH called "Radio2". But nothing to do for "Radio3".

BigMuscle MUST understand what i want and CAN help, so he will. :)

Share this post


Link to post
Share on other sites

please correct spelling, the word 'chance' you're using has another meaning ;) you mean 'change', obviously, not 'chance'.

Btw, interesting mod...

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0