Author Topic: First time UI improvements  (Read 9734 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
First time UI improvements
« on: May 03, 2012, 09:28:35 am »
Hi,

I don't know how often any of you starts a new profile, but the look of C::B at the beginning (if all the plugins are installed) is pretty bad.
Thus I've tried to improve the situation with this patch: http://cmpt.benbmp.org/codeblocks/patches/first_time_ui.patch
And the image: http://cmpt.benbmp.org/codeblocks/patches/tip.png

The changes:
1. Add API for specifying the toolbar priority, adjusted the priorities of the core plugins
2. When loading the plugins, don't immediately create them, but just store them in a list. Which is sorted.
3. Iterate the list and create all toolbars in on go. Try to use as little space as possible by placing toolbars on single row until there is enough space in the row.
3.1. Increased the initial size to 1000x800, because the toolbars placement algorithm uses the initial size instead of the final size.
4. Hide the script console, I doubt any new user would be interested in using it
5. Don't show the tips of the day by default, added a link in the start-page

About 3.1: do you know if it is possible to obtain the final size (after the maximize) and to perform the toolbar placement algorithm using it?

Any comments are welcome. The patch is not tested on windows, so I'll be happy if anyone tries it.

How to test: use -p something_you_ve_never_used switch or delete your default.conf
(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: First time UI improvements
« Reply #1 on: May 03, 2012, 10:46:07 am »
VERY NICE! This annoyed me, too for so many times... Will try surely...

About 3.1: do you know if it is possible to obtain the final size (after the maximize) and to perform the toolbar placement algorithm using it?
What about if you use wxDisplay to obtain the OS'es resolution? (I believe there as even a method to obtain it w/o the task bar or alike...)

EDIT: Cannot apply the patch! :-( Did you use svn patch blah to create this?
« Last Edit: May 03, 2012, 10:48:13 am by MortenMacFly »
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #2 on: May 03, 2012, 11:03:44 am »
EDIT: Cannot apply the patch! :-( Did you use svn patch blah to create this?
Yes of course (svn diff > balbal.patch), but I'm on linux.
What is the error? (Applying patches on windows is quite a pain)
(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: First time UI improvements
« Reply #3 on: May 03, 2012, 11:25:39 am »
What is the error? (Applying patches on windows is quite a pain)
"Chunk info expected". :-(

I have that sometimes (search the forums), but most patches work.
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #4 on: May 03, 2012, 11:43:50 am »
It applied fine on another linux machine.

Can you try to remove the png related changes? Have you tried unix2dos tool?
(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: First time UI improvements
« Reply #5 on: May 04, 2012, 03:05:08 pm »
Can you try to remove the png related changes?
THAT was it - applying patch works now...

All I need now is a free PC and time to compile (including the other change with Manager->Shutdown blah foo... ;-) ).
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: 9694
Re: First time UI improvements
« Reply #6 on: May 04, 2012, 03:09:01 pm »
BTW, from looking at the patch I already saw a mistake, probaby:
In start_here.html this:
          <td valign="middle" align="center"><a href="CB_CMD_OPEN_PROJECT"><img style="width: 33px; height: 47px;" alt="" src="tip.png"></a></td>
          <td valign="middle" align="center"><a href="CB_CMD_TIP_OF_THE_DAY">CB_TXT_TIP_OF_THE_DAY</a></td>

...should read like that:
          <td valign="middle" align="center"><a href="CB_CMD_TIP_OF_THE_DAY"><img style="width: 33px; height: 47px;" alt="" src="tip.png"></a></td>
          <td valign="middle" align="center"><a href="CB_CMD_TIP_OF_THE_DAY">CB_TXT_TIP_OF_THE_DAY</a></td>

...(the command is wrong for the icon / image).
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #7 on: May 04, 2012, 03:09:40 pm »
I guess you should report a bug to your apply-patch provider:)

Yes, you're right. I'll fix it.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #8 on: May 05, 2012, 11:15:37 am »
Here is a new patch: http://cmpt.benbmp.org/codeblocks/patches/first_time_ui.2.patch

This one uses wxDisplay to get the size of the screen.
At least on linux+enlightenment17 GetClientArea doesn't return the correct rect, but it returns the full size of the screen.
Can someone test this method on windows, gnome, kde?

(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: First time UI improvements
« Reply #9 on: May 07, 2012, 08:30:38 pm »
Can someone test this method on windows, gnome, kde?
Oh dear, seems not my day today: I had just finished compiling the first version including the requested other patch... You keep us busy, don't you?! ;D
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #10 on: May 07, 2012, 08:35:14 pm »
There are no too many changes between the two, so it won't require full recompile if you apply the change manually:)
(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: First time UI improvements
« Reply #11 on: May 07, 2012, 08:55:08 pm »
Well - for the Manager->Shutdown issue: This would work like this:
Instead of:
Code
void ToDoListView::DestroyControls(bool control)
{
    Manager::Get()->GetAppWindow()->RemoveEventHandler(this);
    if (control)
    {
        m_pPanel->Destroy();
        m_pPanel = nullptr;
    }
}
...use:
Code
void ToDoListView::DestroyControls(bool control)
{
    if ( !Manager::Get()->IsAppShuttingDown() )
    {
        Manager::Get()->GetAppWindow()->RemoveEventHandler(this);
        if (control)
        {
            m_pPanel->Destroy();
            m_pPanel = nullptr;
        }
    }
}
This seems to fix the original error and avoid he assertions.
(Sorry - I didn't find the original post.)

As for the startup-thing:
The original patch works fine here on Windows and really is something to commit from my point of view...
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #12 on: May 07, 2012, 09:27:50 pm »
Here are the topics:
http://forums.codeblocks.org/index.php/topic,16269.0.html
http://forums.codeblocks.org/index.php/topic,16270.0.html

I'll commit the first-ui patch and will do some testing on the unloading patches...
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First time UI improvements
« Reply #13 on: May 07, 2012, 09:44:12 pm »
In svn...
(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!]