Author Topic: (Another) enhancement for compiler interface GUI (+patch)  (Read 17961 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
(Another) enhancement for compiler interface GUI (+patch)
« on: February 13, 2006, 01:54:52 pm »
Dear all,
after you helped me here: http://forums.codeblocks.org/index.php?topic=2327.0 this time I hope I can provide you with a helpful patch. It adds another button "Clear" to the compiler -> libs dialog. Why could this be helpful? C::B asks for every library you would like to remove whether you "are really sure". While this is perfectly OK it is annoying if you want to remove ALL libs. This happens e.g. if you seperated a project into two targets that require different libs.
Maybe you agree...?!
Morten.
Ps.: The patch is based on revision 1994.

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #1 on: February 13, 2006, 01:59:05 pm »
Hello,

I think your patch is useful :D.

May be you could submit it at BerliOS and here too.

Best wishes,
Michael

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #2 on: February 13, 2006, 02:08:18 pm »
and here too.
Done. I'm struggeling with BerlinOS at the moment, don't know why.
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #3 on: February 13, 2006, 02:17:05 pm »
Done. I'm struggeling with BerlinOS at the moment, don't know why.

I have just tried and BerliOS seems to work (I have used the link submit patch in www.codeblocks.org). It is very slow, but seems to work. May be there are some network problems.

Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #4 on: February 13, 2006, 02:31:37 pm »
The patch file is not good... :(
It looks like a patch, but it has different syntax (it says left file and right file, instead of Index:), so Tortoise does not accept it.

Could you please either use TortoiseSVN->Make Patch or run svn diff > some_name.patch?

Just post it on here if you like, that'll be fine. Thanks :)


...and here too.
I don't know about Yiannis, but I stopped looking at that thread a while ago, since it contains so much outdated rubbish :lol:
The patch manager at BerliOS is a lot more manageable (the tracker is a lot better than the one at SF, too).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #5 on: February 13, 2006, 02:48:22 pm »
...and here too.
I don't know about Yiannis, but I stopped looking at that thread a while ago, since it contains so much outdated rubbish :lol:
The patch manager at BerliOS is a lot more manageable (the tracker is a lot better than the one at SF, too).

Yes, I was thinking about the outdate patches too :). May be when a patch is applied it could be removed from the topic. Anyway, I think that it is good to have patch posted there too so the users could know about them (at least for me is much easier to have a look at the topic instead of go to BerliOS). I am not sure if this is just a misunderstanding from me or not, but when a patch is submitted to BerliOS, would it possible to add a short description as in SF (not the summary)? If not, the topic could be used in that way.

Michael

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #6 on: February 13, 2006, 02:48:33 pm »
Just post it on here if you like, that'll be fine. Thanks :)
I am using Beyond Compare 2 (my #1 favorite tool for comparision and sync). There are 3 options how to create a diff file. I've attached you all 3 ("normal diff", "context based diff", "unified diff"). It would be really great if you could try which one works or has the format that is desired. The unified one (which is the one from my first post) obviously not. That would help me for the future. Cheers.
Morten.

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #7 on: February 13, 2006, 02:51:49 pm »
May be when a patch is applied it could be removed from the topic.
I think that's all what is required. A patch that is applied to the core is no longer of interest - for nobody. And if someone really needs a reference then there is SVN. So imho remove all where "Applied to core" equals "Yes" and Yiannis, Thomas and others may have a look again... ;-)
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #8 on: February 13, 2006, 02:57:14 pm »
Just post it on here if you like, that'll be fine. Thanks :)
I am using Beyond Compare 2 (my #1 favorite tool for comparision and sync). There are 3 options how to create a diff file. I've attached you all 3 ("normal diff", "context based diff", "unified diff"). It would be really great if you could try which one works or has the format that is desired. The unified one (which is the one from my first post) obviously not. That would help me for the future. Cheers.
Morten.

I haven't looked at your patch but normally we want a unified diff (diff -u). But from what I read here this is probably not unified so I think we may have clashing terms...

EDIT: I looked at your zip and, yes, the unified is the correct one :), except for these "Left/right base" first lines...
« Last Edit: February 13, 2006, 02:58:56 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #9 on: February 13, 2006, 03:01:13 pm »
Hmm, neither of these works... :lol:

Actually, "unified" should work, but the one labelled as such is not "unified", at least not the header.
mind trying that please?
Code
cd D:\EigeneDateien\Code\codeblocks\svn\src
svn diff > correct.patch

Subversion and Tortoise expect a diff file to look like this:
Code
Index: sdk/cbproject.h
===================================================================
--- sdk/cbproject.h     (revision 1996)
+++ sdk/cbproject.h     (working copy)
@@ -1,7 +1,7 @@
 #ifndef CBPROJECT_H
 #define CBPROJECT_H

-#include <wx/dynarray.h>
+#include <wx/dynarray.h>   // modified line
 #include <wx/hashmap.h>
 #include <wx/treectrl.h>
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #10 on: February 13, 2006, 03:16:40 pm »
Hmm, neither of these works... :lol:
No I'm confused. If I get mandrav right, then only the first lines need to be removed and then it's working, right?
...however, I'm trying the snd diff now... please wait a couple of minutes...
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #11 on: February 13, 2006, 03:24:05 pm »
The problem is that this Index: line is expected for every patched file, so if your patch contains a dozen files, I have to modify all of them by hand. Plus, Tortoise is particularly picky about them, it even complains if the amount of spaces or equal signs is not the same, and it only lets you open a patch if all files in it are good... so it is a pain :lol:

On the other hand, when it does work, there is nothing better than TortoiseMerge to review patches . It's really great :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #12 on: February 13, 2006, 03:24:52 pm »
Code
cd D:\EigeneDateien\Code\codeblocks\svn\src
svn diff > correct.patch
I did and it seems to have worked. Please find the patch attached...
Morten.
Ps.: Knowing that this patch only changes a couple of lines we've spend quite some resources on that. But I'll do it better next time.
Pps.: mandrav: Do you mind adding ".patch" to the allowed extensions for this forum?

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

takeshimiya

  • Guest
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #13 on: February 13, 2006, 03:54:09 pm »
Code
cd D:\EigeneDateien\Code\codeblocks\svn\src
svn diff > correct.patch
I did and it seems to have worked. Please find the patch attached...
Morten.
Ps.: Knowing that this patch only changes a couple of lines we've spend quite some resources on that. But I'll do it better next time.
Pps.: mandrav: Do you mind adding ".patch" to the allowed extensions for this forum?

I'll second to "any extension but .exe/.bat/.com/.cmd/.pif/.scr/.vbs".

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: (Another) enhancement for compiler interface GUI (+patch)
« Reply #14 on: February 13, 2006, 04:08:40 pm »
Applied the patch, although there are a few minor issues:
1. you can only clear the list if an item is selected (contra-intuitive)
2. the four buttons are a little too wide now, we may have to play with margins
3. you used a wxMessageBox which you shouldn't

ad 1.)
The button is explicitely disabled when no item is selected. I thought that it would be very smart to just remove that line, but this breaks the functionality for the whole dialog :?

ad 2.)
Reducing the border from 8 to 5 will probably do just fine, but I did not want to try that in a hurry now.

ad 3.)
This is not your fault, you could not possibly know that :lol:
A wxMessageBox will always appear on the primary display, as the application cannot place it correctly, so wxMessageBox should be avoided when possible. This is an undocumented rule  so far.
Don't worry, there are still a few wxMessageBoxes around anyway, I'll fix them alltogether some day.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."