aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2] 3 4

Author Topic: "mark as known" function in the popup when right-clicking a search result  (Read 37167 times)

leofisch

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 16
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #15 on: February 13, 2008, 03:56:19 PM »

Hi phoenix,

I can confirm the following:
6 files marked as known in initial session.
this 6 files stay as known in search list as long as the session is not terminated.

After first restart of a session 2 from 6 files are forgotten.
After second restart no changes: remaining 4 files still known.
After 8th restart the remaining 4 files still known.

Tested with global search "java gui",
Target files where those 6 files with more than 1000 sources.


ciao

2008-004-12:
mone of those files are 'kown'
it looks like this feature does not work. :'(
« Last Edit: April 12, 2008, 10:09:23 PM by leofisch »
Logged

IhmSelbst

  • Full Member
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 220
    • http://www.ed2k-serverboard.de/
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #16 on: February 15, 2008, 09:10:05 PM »

Hi,
yes, of course, otherwise, I probably couldn't mark the files at all. The popup also provides the corresponding menuitem, and files can be marked. But, after a newstart, they are "forgotten" again.
This is odd because it has worked here, but it has been a while since I last used it. Could you do a quick check to see if the file has been added to known.met?

Cheers!
Hi again,
(and sri for the late reply... - the rl...)

Hm, strange. For some reason, now everything works as expected. However, I'm using todays cvs. So pse excuse the trouble.  :-\
Be that as it may, the filenames are written to known.met _and_ kept there.  :D


cu

Arichy

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 224

To make it clear for people (like me) that were confused because they thought the # means a comment char: The code has to be as follows (at least I guess so):

Code: [Select]
//#warning Uncomment this here to test the MP_MARK_AS_KNOWN feature. Beware! You are on your own here, this might break "known.met"
//#if 0
        menu.Append(MP_MARK_AS_KNOWN, _("Mark as known file"));
        menu.AppendSeparator();
//#endif

BTW I am really waiting for this functionality, that every file downloaded partly and then canceled comes in a "known canceled file" list, too!
Logged
Gentoo i686

Arichy

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 224

I cannot see any use of the context menu in the search result list. It makes only sense for me in the download list because i only know a file after partially view/unpack it.
Logged
Gentoo i686

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #19 on: September 12, 2008, 02:20:42 PM »

Hi phoenix,

I took the liberty to extend your patch to support multi-selections, so that multiple files can be added to known.met with one call of the context menu...
I created the patch against aMule-CVS-20080910.tar.bz2, works fine here.
Cheers,

LA

Code: [Select]
diff -Naur amule-cvs/src/SearchListCtrl.cpp amule-littleabacus/src/SearchListCtrl.cpp
--- amule-cvs/src/SearchListCtrl.cpp    2008-08-09 22:38:01.000000000 +0200
+++ amule-littleabacus/src/SearchListCtrl.cpp   2008-09-12 14:19:32.000000000 +0200
@@ -685,16 +685,15 @@

 void CSearchListCtrl::OnMarkAsKnown( wxCommandEvent& WXUNUSED(event) )
 {
-       int index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
-       if (index == -1) {
-               return;
+#ifndef CLIENT_GUI
+       long index = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+       while (index > -1) {
+               CSearchFile *searchFile = (CSearchFile *)GetItemData(index);
+               CKnownFile *knownFile(new CKnownFile(*searchFile));
+               theApp->knownfiles->SafeAddKFile(knownFile);
+               UpdateAllRelativesColor(searchFile, index);
+               index = GetNextItem(index, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        }
-
-#ifndef CLIENT_GUI
-       CSearchFile *searchFile = (CSearchFile *)GetItemData(index);
-       CKnownFile *knownFile(new CKnownFile(*searchFile));
-       theApp->knownfiles->SafeAddKFile(knownFile);
-       UpdateAllRelativesColor(searchFile, index);
 #endif
 }
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #20 on: September 15, 2008, 02:18:18 PM »

Hi LittleAbacus,

Thank you for your patch, I have committed it and it will be on tomorrow tarball.

It is easier for us if you attach your patch as a file, otherwise, copy/paste does not work as well because of tabs. Anyway, this was just a small one, but bigger patches might be unpractical.

Cheers!
Logged

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #21 on: September 15, 2008, 05:35:19 PM »

It is easier for us if you attach your patch as a file
Sure thing - next time. Shit happens when I'm working when there's sunlight outside...
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #22 on: September 16, 2008, 02:45:09 AM »

Sure thing - next time. Shit happens when I'm working when there's sunlight outside...
lol :D
Logged

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #23 on: December 14, 2008, 08:24:33 AM »

Another extension: since I'm not the foremost mouse freak and using this feature pretty regularly on large lists, I added an event listener which allows to "delete" marked files by just hitting the del key. Compiles and works fine here.
Cheers
LA
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #24 on: December 14, 2008, 01:07:19 PM »

Because I have problems to fully understand the code by just reading the patch:

Will it ask before deleting the file(s)? It is a very useful function (because it is very intuitive), but I would NOT want to accidentally delete some files. An Undo-function is not feasible, I'm afraid.

Edit: There was a "NOT" missing...
« Last Edit: December 17, 2008, 04:29:10 PM by wuischke »
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #25 on: December 14, 2008, 06:00:53 PM »

Nope, this can't go in.
Code: [Select]
//#warning Uncomment this here to test the MP_MARK_AS_KNOWN feature. Beware! You are on your own here, this might break "known.met"
#if 0
menu.Append(MP_MARK_AS_KNOWN, _("Mark as known file"));
menu.AppendSeparator();
#endif
The feature is still highly experimental, and the risks are not analyzed yet. Your patch adds a (fully available) keyboard shortcut to the feature, while the mouse context menu still is unavailable without patching the code.

Before the feature itself is not qualified to go into the code we can talk about easing the access to it (and enabling it by the way).
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #26 on: December 14, 2008, 09:25:04 PM »

Well then, how about a config option under advanced which affects

- the directive #if 0,
- CSearchListCtrl::OnMarkAsKnown (...) {
   if mark_as_known_option_is_active {
    //code from my patch
   }
}
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #27 on: December 14, 2008, 09:59:23 PM »

How about a proper investigation of the feature instead ? Then it either goes in or it goes out. Like Master Yoda says:
Quote
Do. Or do not. There is no try.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #28 on: December 14, 2008, 10:09:36 PM »

Neither do I know the amule source nor wxwidgets NOR c++ well enough to know what needs to be tested or even where to start looking. From what I gathered from this thread it's all about a "cast" from CSearchFile to CPartFile. I've been running this feature for about half a year and had no problems so far.

Anyways, I got what I want here, I'm content.
Logged

LittleAbacus

  • Jr. Member
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 54
Re: "mark as known" function in the popup when right-clicking a search result
« Reply #29 on: December 16, 2008, 04:36:16 AM »

@wuischke
Sorry, overlooked your post earlier. Currently, there's no confirmation query.
cheers
LA
Logged
Pages: 1 [2] 3 4