Author Topic: Some UI refactoring/tidy up  (Read 47023 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #30 on: August 30, 2012, 03:10:24 pm »
Well, when compiling the C::B sources with the patch applied, compilation of the plugins (namely codesnippets) will fail:
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1524:101: error: cannot allocate an object of abstract type 'FindDlg'
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1527:104: error: cannot allocate an object of abstract type 'ReplaceDlg'

Can you provide a complete patch, so one can compile the whole workspace?

ugh... had no idea codesnippets did this (I will remember to build the whole workspace next time). So I have to copy a lot of my fixes across to CodeSnippets because it reimplements a lot of C::Bs editor functionality (SEditorManager)? I notice the code has been changed a little bit (e.g. no find in files, though I note that the find in files still appears in the find dialog)

IMHO codesnippets would be more consistent if the plugin version allowed you to edit snippets in the regular editor notebook. Also, this may just a problem with my default.conf, but snippets does not work properly for me. I add a few snippets using the default name of new snippet but different content. Then when I click them they all have the name "codesnippets.txt" in the editor and the same content.

Here's a separate patch for CodeSnippets that as a first pass that does the minimal fix to use the new combined dialog, I haven't done more because I am not sure how it is supposed to work. Should it have find/replace in files functionality? Then the scope options in the regular C::B shouldn't really apply (e.g. why would I search in project/workspace for snippet??). Perhaps this plugin should really have its own dialogs?
« Last Edit: August 30, 2012, 11:09:20 pm by dmoore »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some UI refactoring/tidy up
« Reply #31 on: August 30, 2012, 06:23:00 pm »
Perhaps this plugin should really have its own dialogs?
IMHO it is because besides the plugin, the codesnippets project also includes a standalone app to edito your snippets. For this to work, the dialogs were "copied" and renamed. Not nice, I know...
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 dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #32 on: August 30, 2012, 11:16:35 pm »
Perhaps this plugin should really have its own dialogs?
IMHO it is because besides the plugin, the codesnippets project also includes a standalone app to edito your snippets. For this to work, the dialogs were "copied" and renamed. Not nice, I know...

Actually I think the dialogs aren't copied, just imported by linking the app with libcodeblocks. Would be better if they were copied.

Anyway, I can do more fixes to CodeSnippets later. For now, just let me know what you think of the new functionality, and whether you think additional tweaks to the layout of the dialogs are needed. (e.g. does the spacing around the find and replace dialogs bother you? An option would be to put the extra space, which is needed for multiline mode to avoid resizing the entire dialog when switching modes, at the bottom when not in that mode)
« Last Edit: August 30, 2012, 11:19:13 pm by dmoore »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Some UI refactoring/tidy up
« Reply #33 on: August 31, 2012, 12:03:45 am »
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #34 on: August 31, 2012, 12:26:17 am »
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)

Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some UI refactoring/tidy up
« Reply #35 on: August 31, 2012, 12:34:01 am »
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)
I've keybinded the ctrl-shift-f to thread search and I've not use the standard find in files for ages.

Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?
why bother, thread search for the win...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #36 on: August 31, 2012, 01:47:09 am »
why bother, thread search for the win...

You've got a point. Ideally though I would like the UI to be more consistent.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Some UI refactoring/tidy up
« Reply #37 on: August 31, 2012, 02:14:13 pm »
Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?
I prefer the UI of find, however Thread search has "Delete item" in a right-click menu.  It also shows filenames in a separate column, which is important, because (on a small screen) it is fine for the path column to have a default size it which it is truncated, but I always want to see the full filename.
Thread search supplies the "Find occurrences" context menu item; if there is a merge, I would like for this item to be supplied by Find in files.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some UI refactoring/tidy up
« Reply #38 on: August 31, 2012, 09:22:12 pm »
Thread search supplies the "Find occurrences" context menu item; if there is a merge, I would like for this item to be supplied by Find in files.
Thread search provides on better option View -> Focus Thread search. I've a key bound to it and I'm using it all the time.
In combination with a disabled option of "Delete previous entries before search" this is the best searcher in town.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some UI refactoring/tidy up
« Reply #39 on: September 01, 2012, 12:10:11 am »
Here's a separate patch for CodeSnippets [...]
For the record: Having applied both patches I see no negative side effect. It seems to work and looks OK.

If you consider to apply, please also remove the obsolete files in SVN and from all build system (projects files, automake).
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 Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Some UI refactoring/tidy up
« Reply #40 on: September 01, 2012, 02:02:21 pm »
Thread search provides on better option View -> Focus Thread search. I've a key bound to it and I'm using it all the time.
In combination with a disabled option of "Delete previous entries before search" this is the best searcher in town.
I agree; Thread search is currently the best large search option in Code::Blocks.  However my personal preference is that the UI for Find in files is nicer.  (Also it feels redundant to have two items that do nearly the same thing; it took me several months when I first started Code::Blocks to figure out the difference between the two :-[.)  If anyone (in this case, it seems it might be you, dmoore) is willing to spend time merging them, I would appreciate it.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #41 on: September 01, 2012, 07:46:04 pm »
Here's a separate patch for CodeSnippets [...]
For the record: Having applied both patches I see no negative side effect. It seems to work and looks OK.

If you consider to apply, please also remove the obsolete files in SVN and from all build system (projects files, automake).

Done. On Linux, I built the full workspace from C::B as well as the configure/make jig. I haven't tested on windows.

I have some plans to rearrange the dialog some more. It is much too tall, but not particularly wide.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #42 on: September 02, 2012, 06:54:25 am »
Find/Replace Dialog updated in SVN. I think this is a cleaner look and it should work better on smaller screens. Please test and report any issues. Happy to revert this if people don't like it.
« Last Edit: September 02, 2012, 06:57:42 am by dmoore »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Some UI refactoring/tidy up
« Reply #43 on: September 03, 2012, 01:45:55 am »
Find/Replace Dialog updated in SVN. I think this is a cleaner look and it should work better on smaller screens. Please test and report any issues.
It seems to work well so far.  If no projects are open, some of the radio boxes should be disabled:
Code
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp  (revision 8330)
+++ src/sdk/findreplacedlg.cpp  (working copy)
@@ -168,6 +168,18 @@
                 chTarget->AppendString(active_project->GetBuildTarget(j)->GetTitle());
         }
     }
+    if (pa->IsEmpty())
+    {
+        if (rbScope->GetSelection() == 1 || rbScope->GetSelection() == 2)
+        {
+            rbScope->SetSelection(0);
+            XRCCTRL(*this, "pnSearchPath", wxPanel)->Show();
+            XRCCTRL(*this, "pnSearchPath", wxPanel)->Disable();
+            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
+        }
+        rbScope->Enable(1, false);
+        rbScope->Enable(2, false);
+    }
 
     if (findReplaceInFilesOnly)
     {

The "Find" tab and the "Replace" tab fail to be hidden (tested on Windows) by:
Code
    if (findReplaceInFilesOnly)
    {
        // NOTE (jens#1#): Do not delete, just hide the page, to avoid asserts in debug-mode
        XRCCTRL(*this, "nbReplace", wxNotebook)->SetSelection(1);
        (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0))->Hide(); // no active editor, so only replace-in-files
        XRCCTRL(*this, "cmbFind2", wxComboBox)->SetFocus();
    }
(I am not sure how to fix this.)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some UI refactoring/tidy up
« Reply #44 on: September 03, 2012, 03:55:34 am »
@Alpha: applied the patch and tried resequencing the constructor logic (renaming notebook tabs before hiding them). See if that makes a difference.
« Last Edit: September 03, 2012, 04:16:48 am by dmoore »