Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: oBFusCATed on May 14, 2010, 08:24:01 pm

Title: Some "Log & others" problems
Post by: oBFusCATed on May 14, 2010, 08:24:01 pm
1. Closing pages in the notebook removes them from the drop down list and they can't be reopened
2. The order and the state of the tabs/pages is not remembered and I've to close the ones I don't need every time I start C::B
3. Build/Build messages are at the end of the notebook, which is very annoying
Title: Re: Some "Log & others" problems
Post by: Jenna on May 14, 2010, 08:43:30 pm
1. Closing pages in the notebook removes them from the drop down list and they can't be reopened
2. The order and the state of the tabs/pages is not remembered and I've to close the ones I don't need every time I start C::B
3. Build/Build messages are at the end of the notebook, which is very annoying

1. Yes, they are not in dropdownlist, but can be reopened via context-menu ("Toggle -> ...")
2. Yes, it's not so easy to do this, because many of them are opened by plugins and the load-order can vary, and a closed/toggled logger is mostly automatically reopened if the owner tries to write into it.
3. Here they are the fifth and sixth logger of thirteen, but as written before it depends on load-order of the plugins.

Saving the state and order can be done on shutdown before unloading the plugins and loading the layout in CreateIDE() after CreateMenubar(), because it loads all plugins.
This would fix 2 and 3.
I will see if I find the time to look into it.
Title: Re: Some "Log & others" problems
Post by: Jenna on June 03, 2010, 05:18:18 pm
I created a patch for 2 (can fix 3 automatically).

See http://forums.codeblocks.org/index.php/topic,12650.msg85768.html#msg85768 (http://forums.codeblocks.org/index.php/topic,12650.msg85768.html#msg85768) for details.
Title: Re: Some "Log & others" problems
Post by: oBFusCATed on July 10, 2010, 12:42:47 am
Jens: The patch (version 1, never tried v2, because I'm too lazy :( ) works very well, probably you could commit it? :)

Also, there is another problem, here are the steps to reproduce it:
1. Switch to "Build messages"
2. Right click and open the context menu
3. Left click and the context menu is opened at the position of the click

or

1. Switch to the "Thread search" tab, Thread search should be in list ctrl mode, have not tested the tree mode
2. Perform a search which should have some results
3. Right click on a result string to open the context menu
4. Click "Delete all items", the general context menu shows up

Tested on gentoo linux 64bit debuggers branch (but it is not related to the changes in it, I think)
Title: Re: Some "Log & others" problems
Post by: Jenna on July 20, 2010, 07:27:35 pm
It's in trunk now (svn r6406) and will sooner or later be available in the debugger- and the cc-branch also, I think.

I don't have any of them at the moment, so I can not commit the changes soon.
Title: Re: Some "Log & others" problems
Post by: MortenMacFly on July 20, 2010, 08:47:53 pm
It's in trunk now (svn r6406) and will sooner or later be available in the debugger- and the cc-branch also, I think.
Done that.
Title: Re: Some "Log & others" problems
Post by: oBFusCATed on July 21, 2010, 12:56:28 am
Debugger branch is broken :(

Code
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp: In member function ‘int InfoPane::GetCurrentPage(bool&)’:
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:204: error: ‘num_pages’ was not declared in this scope
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:206: error: request for member ‘indexInNB’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)ii))’, which is of non-class type ‘InfoPane::Page*’
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:208: error: request for member ‘islogger’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)ii))’, which is of non-class type ‘InfoPane::Page*’
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp: In member function ‘Logger* InfoPane::GetLogger(int)’:
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:217: error: ‘num_pages’ was not declared in this scope
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:219: error: request for member ‘islogger’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)index))’, which is of non-class type ‘InfoPane::Page*’
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:219: error: request for member ‘logger’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)index))’, which is of non-class type ‘InfoPane::Page*’
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp: In member function ‘wxWindow* InfoPane::GetWindow(int)’:
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:223: error: ‘num_pages’ was not declared in this scope
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:225: error: request for member ‘islogger’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)index))’, which is of non-class type ‘InfoPane::Page*’
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/src/infopane.cpp:225: error: request for member ‘window’ in ‘((InfoPane*)this)->InfoPane::page.InfoPane::wxArrayOfPage::operator[](((size_t)index))’, which is of non-class type ‘InfoPane::Page*’
Title: Re: Some "Log & others" problems
Post by: MortenMacFly on July 21, 2010, 09:01:16 am
Debugger branch is broken :(
I've a patch for that but cannot commit for a while (no access to SVN).
Title: Re: Some "Log & others" problems
Post by: oBFusCATed on July 21, 2010, 09:29:46 am
Can you post it?
Title: Re: Some "Log & others" problems
Post by: Jenna on July 21, 2010, 11:36:52 am
Can you post it?
Please test this patch:
Code
--- tmp/tmp93xXnj-meld/infopane.cpp 
+++ home/jens/codeblocks-build/codeblocks.dbg/src/src/infopane.cpp
@@ -200,29 +200,22 @@
 
 int InfoPane::GetCurrentPage(bool &is_logger)
 {
-    int page_index = GetSelection();
-    for (int ii = 0; ii < num_pages; ++ii)
-    {
-        if (page[ii].indexInNB == page_index)
-        {
-            is_logger = page[ii].islogger;
-            return ii;
-        }
-    }
-    return -1;
+    int i = GetPageIndexByWindow(GetPage(GetSelection()));
+    is_logger = page.Item(i)->islogger;
+    return (is_logger?i:-1);
 }
 
 Logger* InfoPane::GetLogger(int index)
 {
-    if (index < 0 || index > num_pages)
+    if (index < 0 || (size_t)index > page.GetCount())
         return NULL;
-    return page[index].islogger ? page[index].logger : NULL;
+    return page.Item(index)->islogger ? page.Item(index)->logger : NULL;
 }
 wxWindow* InfoPane::GetWindow(int index)
 {
-    if (index < 0 || index > num_pages)
+    if (index < 0 || (size_t)index > page.GetCount())
         return NULL;
-    return !page[index].islogger ? page[index].window : NULL;
+    return !page.Item(index)->islogger ? page.Item(index)->window : NULL;
 }
 
 void InfoPane::Show(size_t i)
Title: Re: Some "Log & others" problems
Post by: oBFusCATed on July 21, 2010, 09:19:13 pm
Applied at my installed version... seems to work
Title: Re: Some "Log & others" problems
Post by: Jenna on July 21, 2010, 09:44:20 pm
Applied at my installed version... seems to work
Committed (dbg-branch r6412) , thanks for testing.