Category: Tips & Tricks

  • Editing a CodeLite template

    During the course Beginning C++, we learn how to make a template in CodeLite. And templates are brilliant, as we then can re-use a setup easily without choosing the same selections every time.

    Sadly, I made an error in my template, and it took a while before I found out how to change it. Not because it is especially hard, but because I did not find any reference on how to do it on the internet and I forgot to look in the right place on my PC.

    So, I present you with how to change a CodeLite template on Windows PCs.

    abstract business code coding
    Photo by Pixabay on Pexels.com

    Where are the files located?

    All the settings for CodeLite are saved under the AppData folder, usually on the C-drive.

    The path you are looking for is usually called
    C:\Users\<username>\AppData\Roaming\codelite\templates\projects

    If you don’t see the folder called AppData, you have to enable Hidden items under the View menu.

    Hidden Items

    Change the files

    Before you do any changes to the files, remember to close CodeLite. That way you won’t have any collisions, and you will be sure that your changes are saved. Also, do make sure to take a copy of the template file. If CodeLite can’t parse it correctly, it won’t show up in the New project wizard.

    There are two or more files in the folder, depending on how many templates you have and the number of files each project contains. The main file is called something like TemplateName.project. This file contains all the settings for the template. It is just a text-file in XML-format so you can use any text editor to change whatever configuration you want and then just save the file again.

    Settings

    In the course, we are using the C++14 standard, so we set the options for the compiler to use this standard when compiling. You can find this setting again in the file:

    Template settings

    You will also see the description of the template and many other project settings in this file, including which files should be automatically included in and added to the new project.

    Included files

    Towards the bottom of the XML-file, you will see the files the project will contain when you create it in CodeLite. In my case, it’s just one file, main.cpp, and it will be placed in the src folder.

    VirtualDir

    You can add more files to a project template by just creating them and saving them to the template folder and then add a new line for each file you want to add.

    AddFiles

  • Skype messing with the sound volume

    If you are using Skype for Business, possibly also standard Skype, you might appreciate the fact that it reduces the volume of other apps like Spotify etc. when there’s an incoming or outgoing call.

    A problem I have with Windows 10 is that the sound is reduced, but when the call is over the volume is not reset correctly. I’ve found that I can go to the volume mixer and adjust the volume of the muted application, but often when I then change the overall sound volume, the apps volume is reduced again.

    Luckily there’s a solution. While not perfect, it stops the annoyance of Skype not unmuting sound properly.

    marketing man person communication
    OK, this is probably worse than Skype, but it doesn’t mess up your PC sound settings.

    What you need to do is the following.

    1. Right-click the Speaker symbol in the system tray and select Sounds from the menu that pops up.
      Systray volume menu
    2. Select the Communications tab in the Sound window that pops up, select Do nothing from the alternatives and click OK.
      Sound settings

    Skype and other programs that Windows 10 recognizes as a communications activity will no longer mess with the sounds of running applications.

    I do use computers a lot, and I actually work with IT support, so you might see tips like this from time to time. Especially on problems, I find annoying and where I don’t find many articles already on the net about the issue. Please give feedback if you want more or less of them.