Began adding translations and using Qt Designer .ui files.

Also added QSetting value names to common.h

Work is halfway on both translations and .ui files.

I added a very quick and rough finnish translation.

The program now requires the translation files to be created before running
that can be done with lrelease gui.pro.

To compile the whole GUI one must do the following
cd gui
qmake
lrelease gui.pro
make
This commit is contained in:
Vesa Pikki 2009-07-02 11:32:29 +03:00
parent b245b7a832
commit ebfa55b1c3
24 changed files with 3720 additions and 444 deletions

View File

@ -18,8 +18,10 @@
#include "applicationlist.h"
#include <QStringList>
#include "common.h"
ApplicationList::ApplicationList()
ApplicationList::ApplicationList(QObject *parent) :
QObject(parent)
{
//ctor
}
@ -29,11 +31,12 @@ ApplicationList::~ApplicationList()
Clear();
}
void ApplicationList::LoadSettings(QSettings &programSettings)
void ApplicationList::LoadSettings(QSettings *programSettings)
{
QStringList names = programSettings.value("Application names", QStringList()).toStringList();
QStringList paths = programSettings.value("Application paths", QStringList()).toStringList();
QStringList names = programSettings->value(SETTINGS_APPLICATION_NAMES, QStringList()).toStringList();
QStringList paths = programSettings->value(SETTINGS_APPLICATION_PATHS, QStringList()).toStringList();
if (names.size() == paths.size())
{
for (int i = 0; i < names.size(); i++)
@ -43,7 +46,7 @@ void ApplicationList::LoadSettings(QSettings &programSettings)
}
}
void ApplicationList::SaveSettings(QSettings &programSettings)
void ApplicationList::SaveSettings(QSettings *programSettings)
{
QStringList names;
QStringList paths;
@ -54,8 +57,8 @@ void ApplicationList::SaveSettings(QSettings &programSettings)
paths << GetApplicationPath(i);
}
programSettings.setValue("Application names", names);
programSettings.setValue("Application paths", paths);
programSettings->setValue(SETTINGS_APPLICATION_NAMES, names);
programSettings->setValue(SETTINGS_APPLICATION_PATHS, paths);
}
@ -125,12 +128,17 @@ void ApplicationList::MoveFirst(const int index)
}
void ApplicationList::Copy(ApplicationList &list)
void ApplicationList::Copy(ApplicationList *list)
{
Clear();
for (int i = 0; i < list.GetApplicationCount(); i++)
if (!list)
{
AddApplicationType(list.GetApplicationName(i), list.GetApplicationPath(i));
return;
}
Clear();
for (int i = 0;i < list->GetApplicationCount();i++)
{
AddApplicationType(list->GetApplicationName(i), list->GetApplicationPath(i));
}
}

View File

@ -43,6 +43,7 @@
*/
class ApplicationList : public QObject
{
Q_OBJECT
public:
/**
@ -64,7 +65,7 @@ public:
QString Path;
} ApplicationType;
ApplicationList();
ApplicationList(QObject *parent = 0);
virtual ~ApplicationList();
/**
@ -72,13 +73,13 @@ public:
*
* @param programSettings QSettings to load application list from
*/
void LoadSettings(QSettings &programSettings);
void LoadSettings(QSettings *programSettings);
/**
* @brief Save all applications
* @param programSettings QSettings to save applications to
*/
void SaveSettings(QSettings &programSettings);
void SaveSettings(QSettings *programSettings);
/**
* @brief Get the amount of applications in the list
@ -143,7 +144,7 @@ public:
* list given as a parameter.
* @param list Copying source
*/
void Copy(ApplicationList &list);
void Copy(ApplicationList *list);
protected:
/**

View File

@ -33,4 +33,30 @@ typedef enum
}
ShowTypes;
/**
* QSetting value names
*/
#define SETTINGS_WINDOW_MAXIMIZED "Window maximized"
#define SETTINGS_WINDOW_WIDTH "Window width"
#define SETTINGS_WINDOW_HEIGHT "Window height"
#define SETTINGS_SHOW_ALL "Show all"
#define SETTINGS_SHOW_SECURITY "Show security"
#define SETTINGS_SHOW_STYLE "Show style"
#define SETTINGS_SHOW_ERRORS "Show errors"
#define SETTINGS_CHECK_PATH "Check path"
#define SETTINGS_CHECK_FORCE "Check force"
#define SETTINGS_CHECK_THREADS "Check threads"
#define SETTINGS_SHOW_FULL_PATH "Show full path"
#define SETTINGS_SHOW_NO_ERRORS "Show no errors message"
#define SETTINGS_SAVE_ALL_ERRORS "Save all errors"
#define SETTINGS_SAVE_FULL_PATH "Save full path"
#define SETTINGS_CHECK_DIALOG_WIDTH "Check dialog width"
#define SETTINGS_CHECK_DIALOG_HEIGHT "Check dialog height"
#define SETTINGS_APPLICATION_NAMES "Application names"
#define SETTINGS_APPLICATION_PATHS "Application paths"
#define SETTINGS_RESULT_COLUMN_WIDTH "Result column %1 width"
#define SETTINGS_LANGUAGE "Application language"
#define SETTINGS_TOOLBARS_SHOW "Toolbars/ShowStandard"
#endif

550
gui/cppcheck_de.ts Normal file
View File

@ -0,0 +1,550 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="49"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>
<message>
<location filename="applicationdialog.cpp" line="40"/>
<source>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="53"/>
<source>Application&apos;s name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="55"/>
<source>Application to execute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="57"/>
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="61"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="62"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="91"/>
<source>Executable files (*.exe);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="94"/>
<source>Select viewer application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="131"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="132"/>
<source>You must specify a name and a path for the application!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileViewDialog</name>
<message>
<location filename="fileviewdialog.cpp" line="37"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="57"/>
<source>Could not find the file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="61"/>
<location filename="fileviewdialog.cpp" line="76"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="72"/>
<source>Could not read the file: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="242"/>
<location filename="mainwindow.cpp" line="449"/>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="565"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="253"/>
<source>Show possible false positives</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="74"/>
<source>&amp;File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="81"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<source>&amp;Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="119"/>
<source>&amp;Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="134"/>
<source>toolBar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="152"/>
<source>&amp;License...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="157"/>
<source>A&amp;uthors...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="166"/>
<source>&amp;About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="171"/>
<source>&amp;Files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<source>Ctrl+F</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="183"/>
<source>&amp;Directory...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="186"/>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="195"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="198"/>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="207"/>
<source>&amp;Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="210"/>
<source>Esc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="219"/>
<source>&amp;Save results to file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="222"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="227"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="236"/>
<source>&amp;Clear results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="245"/>
<source>&amp;Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="261"/>
<source>Show security errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="269"/>
<source>Show style errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="277"/>
<source>Show common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="282"/>
<source>&amp;Check all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="287"/>
<source>&amp;Uncheck all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="292"/>
<source>Collapse &amp;all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="297"/>
<source>&amp;Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="305"/>
<source>&amp;Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="97"/>
<source>&amp;Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="102"/>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="205"/>
<source>Select files to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="214"/>
<source>Select directory to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="506"/>
<source>XML files (*.xml);;Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="508"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="516"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="549"/>
<source>Cppcheck - %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="566"/>
<source>Failed to change language:
%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="translationhandler.cpp" line="12"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="13"/>
<source>Finnish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="14"/>
<source>Swedish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="15"/>
<source>German</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="16"/>
<source>Russian</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="69"/>
<source>Incorrect language specified!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="77"/>
<source>Failed to load language from file %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Severity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="386"/>
<source>Copy filename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="387"/>
<source>Copy full path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="423"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="424"/>
<source>You can open this error by specifying applications in program&apos;s settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="469"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="77"/>
<location filename="resultsview.cpp" line="89"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="78"/>
<source>No errors found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="86"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.ui" line="26"/>
<source>Results</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="settingsdialog.cpp" line="46"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="47"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="68"/>
<source>General</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="78"/>
<source>Number of threads: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="85"/>
<source>Check all #ifdef configurations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="90"/>
<source>Show full path of files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="95"/>
<source>Show &quot;No errors found&quot; message when no errors found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="104"/>
<source>Applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="111"/>
<source>Add application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="116"/>
<source>Delete application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="121"/>
<source>Modify application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="126"/>
<source>Set as default application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="139"/>
<source>Reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="143"/>
<source>Save all errors when creating report</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="148"/>
<source>Save full path to files in reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="154"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="227"/>
<source>Add a new application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="260"/>
<source>Modify an application</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

569
gui/cppcheck_en.ts Normal file
View File

@ -0,0 +1,569 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<context>
<name>AboutDialog</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<translation>About Cppcheck</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>Cppcheck - A tool for static C/C++ code analysis.</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source>
<translation>Version %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<translation>This program is licensed under the terms of the GNU General Public License version 3</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="49"/>
<source>Close</source>
<translation>Close</translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>
<message>
<location filename="applicationdialog.cpp" line="40"/>
<source>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</source>
<translation>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="53"/>
<source>Application&apos;s name</source>
<translation>Application&apos;s name</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="55"/>
<source>Application to execute</source>
<translation>Application to execute</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="57"/>
<source>Browse</source>
<translation>Browse</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="61"/>
<source>Cancel</source>
<translation>Cancel</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="62"/>
<source>Ok</source>
<translation>Ok</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="91"/>
<source>Executable files (*.exe);;All files(*.*)</source>
<translation>Executable files (*.exe);;All files(*.*)</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="94"/>
<source>Select viewer application</source>
<translation>Select viewer application</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="131"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="132"/>
<source>You must specify a name and a path for the application!</source>
<translation>You must specify a name and a path for the application!</translation>
</message>
</context>
<context>
<name>FileViewDialog</name>
<message>
<location filename="fileviewdialog.cpp" line="37"/>
<source>Close</source>
<translation>Close</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="57"/>
<source>Could not find the file: %1</source>
<oldsource>Could not find the file:
</oldsource>
<translation>Could not find the file: %1</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="61"/>
<location filename="fileviewdialog.cpp" line="76"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="72"/>
<source>Could not read the file: %1</source>
<translation>Could not read the file: %1</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="242"/>
<location filename="mainwindow.cpp" line="449"/>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="565"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="253"/>
<source>Show possible false positives</source>
<translation>Show possible false positives</translation>
</message>
<message>
<location filename="main.ui" line="74"/>
<source>&amp;File</source>
<translation>&amp;File</translation>
</message>
<message>
<location filename="main.ui" line="81"/>
<source>&amp;View</source>
<translation>&amp;View</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<source>&amp;Check</source>
<translation>&amp;Check</translation>
</message>
<message>
<location filename="main.ui" line="119"/>
<source>&amp;Edit</source>
<translation>&amp;Edit</translation>
</message>
<message>
<location filename="main.ui" line="134"/>
<source>toolBar</source>
<translation>toolBar</translation>
</message>
<message>
<location filename="main.ui" line="152"/>
<source>&amp;License...</source>
<translation>&amp;License...</translation>
</message>
<message>
<location filename="main.ui" line="157"/>
<source>A&amp;uthors...</source>
<translation>A&amp;uthors...</translation>
</message>
<message>
<location filename="main.ui" line="166"/>
<source>&amp;About...</source>
<translation>&amp;About...</translation>
</message>
<message>
<location filename="main.ui" line="171"/>
<source>&amp;Files...</source>
<translation>&amp;Files...</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="183"/>
<source>&amp;Directory...</source>
<translation>&amp;Directory...</translation>
</message>
<message>
<location filename="main.ui" line="186"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="195"/>
<source>&amp;Recheck files</source>
<translation>&amp;Recheck files</translation>
</message>
<message>
<location filename="main.ui" line="198"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="207"/>
<source>&amp;Stop</source>
<translation>&amp;Stop</translation>
</message>
<message>
<location filename="main.ui" line="210"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="219"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Save results to file...</translation>
</message>
<message>
<location filename="main.ui" line="222"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="227"/>
<source>&amp;Quit</source>
<translation>&amp;Quit</translation>
</message>
<message>
<location filename="main.ui" line="236"/>
<source>&amp;Clear results</source>
<translation>&amp;Clear results</translation>
</message>
<message>
<location filename="main.ui" line="245"/>
<source>&amp;Preferences</source>
<translation>&amp;Preferences</translation>
</message>
<message>
<location filename="main.ui" line="261"/>
<source>Show security errors</source>
<translation>Show security errors</translation>
</message>
<message>
<location filename="main.ui" line="269"/>
<source>Show style errors</source>
<translation>Show style errors</translation>
</message>
<message>
<location filename="main.ui" line="277"/>
<source>Show common errors</source>
<translation>Show common errors</translation>
</message>
<message>
<location filename="main.ui" line="282"/>
<source>&amp;Check all</source>
<translation>&amp;Check all</translation>
</message>
<message>
<location filename="main.ui" line="287"/>
<source>&amp;Uncheck all</source>
<translation>&amp;Uncheck all</translation>
</message>
<message>
<location filename="main.ui" line="292"/>
<source>Collapse &amp;all</source>
<translation>Collapse &amp;all</translation>
</message>
<message>
<location filename="main.ui" line="297"/>
<source>&amp;Expand all</source>
<translation>&amp;Expand all</translation>
</message>
<message>
<location filename="main.ui" line="305"/>
<source>&amp;Toolbar</source>
<translation>&amp;Toolbar</translation>
</message>
<message>
<location filename="main.ui" line="97"/>
<source>&amp;Language</source>
<translation>&amp;Language</translation>
</message>
<message>
<location filename="main.ui" line="102"/>
<source>&amp;Help</source>
<translation>&amp;Help</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="205"/>
<source>Select files to check</source>
<translation>Select files to check</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="214"/>
<source>Select directory to check</source>
<translation>Select directory to check</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<source>No suitable files found to check!</source>
<translation>No suitable files found to check!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation>Cannot exit while checking.
Stop the checking before exiting.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="506"/>
<source>XML files (*.xml);;Text files (*.txt)</source>
<translation>XML files (*.xml);;Text files (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="508"/>
<source>Save the report file</source>
<translation>Save the report file</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="516"/>
<source>XML files (*.xml)</source>
<translation>XML files (*.xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="549"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="566"/>
<source>Failed to change language:
%1</source>
<translation>Failed to change language:
%1</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="translationhandler.cpp" line="12"/>
<source>English</source>
<translation>English</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="13"/>
<source>Finnish</source>
<translation>Finnish</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="14"/>
<source>Swedish</source>
<translation>Swedish</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="15"/>
<source>German</source>
<translation>German</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="16"/>
<source>Russian</source>
<translation>Russian</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="69"/>
<source>Incorrect language specified!</source>
<translation>Incorrect language specified!</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="77"/>
<source>Failed to load language from file %1</source>
<translation>Failed to load language from file %1</translation>
</message>
</context>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>File</source>
<translation>File</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Severity</source>
<translation>Severity</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Line</source>
<translation>Line</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Message</source>
<translation>Message</translation>
</message>
<message>
<location filename="resultstree.cpp" line="386"/>
<source>Copy filename</source>
<translation>Copy filename</translation>
</message>
<message>
<location filename="resultstree.cpp" line="387"/>
<source>Copy full path</source>
<translation>Copy full path</translation>
</message>
<message>
<location filename="resultstree.cpp" line="423"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="424"/>
<source>You can open this error by specifying applications in program&apos;s settings.</source>
<translation>You can open this error by specifying applications in program&apos;s settings.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="469"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation>Could not start %1
Please check the application path and parameters are correct.</translation>
</message>
</context>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="77"/>
<location filename="resultsview.cpp" line="89"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="78"/>
<source>No errors found.</source>
<translation>No errors found.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="86"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</translation>
</message>
<message>
<location filename="resultsview.ui" line="26"/>
<source>Results</source>
<translation>Results</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="settingsdialog.cpp" line="46"/>
<source>Cancel</source>
<translation>Cancel</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="47"/>
<source>Ok</source>
<translation>Ok</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="68"/>
<source>General</source>
<translation>General</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="78"/>
<source>Number of threads: </source>
<translation>Number of threads: </translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="85"/>
<source>Check all #ifdef configurations</source>
<translation>Check all #ifdef configurations</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="90"/>
<source>Show full path of files</source>
<translation>Show full path of files</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="95"/>
<source>Show &quot;No errors found&quot; message when no errors found</source>
<translation>Show &quot;No errors found&quot; message when no errors found</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="104"/>
<source>Applications</source>
<translation>Applications</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="111"/>
<source>Add application</source>
<translation>Add application</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="116"/>
<source>Delete application</source>
<translation>Delete application</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="121"/>
<source>Modify application</source>
<translation>Modify application</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="126"/>
<source>Set as default application</source>
<translation>Set as default application</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="139"/>
<source>Reports</source>
<translation>Reports</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="143"/>
<source>Save all errors when creating report</source>
<translation>Save all errors when creating report</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="148"/>
<source>Save full path to files in reports</source>
<translation>Save full path to files in reports</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="154"/>
<source>Settings</source>
<translation>Settings</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="227"/>
<source>Add a new application</source>
<translation>Add a new application</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="260"/>
<source>Modify an application</source>
<translation>Modify an application</translation>
</message>
</context>
</TS>

569
gui/cppcheck_fi.ts Normal file
View File

@ -0,0 +1,569 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fi_FI">
<context>
<name>AboutDialog</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<translation>Tietoa ohjelmasta Cppcheck</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>Cppcheck - Työkalu C/C++ koodin staattiseen analysointiin.</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source>
<translation>Versio %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<translation>Tämä ohjelma on lisensoitu GNU General Public Lisenssin version 3 alaiseksi</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="49"/>
<source>Close</source>
<translation>Sulje</translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>
<message>
<location filename="applicationdialog.cpp" line="40"/>
<source>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</source>
<translation>Voi lisätä ohjelmia joilla avata virheen sisältämiä tiedostoja
määrittämällä suoritettavan ohjelman ja nimen ohjelmalle.
Suoritettavalle ohjelmalle voi määrittää parametreja jotka Cppcheck korvaa sopivilla arvoilla.
Parametrit ovat seuraavat:
(file) - Tiedosto joka sisältää virheen
(line) - Rivinumero josta virhe löytyy
(message) - Virheilmoitus
(severity) - Virheen vakavuus
Esimerkki virheen avaamisesta Kate nimisellä tekstinkäsittelyohjelmalla:
kate -l(line) (file)
</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="53"/>
<source>Application&apos;s name</source>
<translation>Ohjelman nimi</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="55"/>
<source>Application to execute</source>
<translation>Suoritettava ohjelma</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="57"/>
<source>Browse</source>
<translation>Selaa</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="61"/>
<source>Cancel</source>
<translation>Peruuta</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="62"/>
<source>Ok</source>
<translation>Ok</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="91"/>
<source>Executable files (*.exe);;All files(*.*)</source>
<translation>Suoritettavat tiedostot (*.exe);;Kaikki tiedostot(*.*)</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="94"/>
<source>Select viewer application</source>
<translation>Valitse ohjelma jolla avata virhetiedosto</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="131"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="132"/>
<source>You must specify a name and a path for the application!</source>
<translation>Suoritettava ohjelma tulee määrittää!</translation>
</message>
</context>
<context>
<name>FileViewDialog</name>
<message>
<location filename="fileviewdialog.cpp" line="37"/>
<source>Close</source>
<translation>Sulje</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="57"/>
<source>Could not find the file: %1</source>
<oldsource>Could not find the file:
</oldsource>
<translation>Tiedostoa %1 ei löytynyt</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="61"/>
<location filename="fileviewdialog.cpp" line="76"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="72"/>
<source>Could not read the file: %1</source>
<translation>Tiedoston %1 lukeminen epäonnistui</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="242"/>
<location filename="mainwindow.cpp" line="449"/>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="565"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="253"/>
<source>Show possible false positives</source>
<translation>Näytä epävarmat virheet</translation>
</message>
<message>
<location filename="main.ui" line="74"/>
<source>&amp;File</source>
<translation>&amp;Tiedosto</translation>
</message>
<message>
<location filename="main.ui" line="81"/>
<source>&amp;View</source>
<translation>&amp;Näytä</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<source>&amp;Check</source>
<translation>&amp;Tarkista</translation>
</message>
<message>
<location filename="main.ui" line="119"/>
<source>&amp;Edit</source>
<translation>&amp;Muokkaa</translation>
</message>
<message>
<location filename="main.ui" line="134"/>
<source>toolBar</source>
<translation>työkalupalkki</translation>
</message>
<message>
<location filename="main.ui" line="152"/>
<source>&amp;License...</source>
<translation>&amp;Lisenssi...</translation>
</message>
<message>
<location filename="main.ui" line="157"/>
<source>A&amp;uthors...</source>
<translation>&amp;Tekijät...</translation>
</message>
<message>
<location filename="main.ui" line="166"/>
<source>&amp;About...</source>
<translation>&amp;Tietoa ohjelmasta Cppcheck...</translation>
</message>
<message>
<location filename="main.ui" line="171"/>
<source>&amp;Files...</source>
<translation>&amp;Tiedostot...</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="183"/>
<source>&amp;Directory...</source>
<translation>&amp;Hakemisto...</translation>
</message>
<message>
<location filename="main.ui" line="186"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="195"/>
<source>&amp;Recheck files</source>
<translation>Tarkista tiedostot &amp;uudelleen</translation>
</message>
<message>
<location filename="main.ui" line="198"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="207"/>
<source>&amp;Stop</source>
<translation>&amp;Pysäytä</translation>
</message>
<message>
<location filename="main.ui" line="210"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="219"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Tallenna tulokset tiedostoon...</translation>
</message>
<message>
<location filename="main.ui" line="222"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="227"/>
<source>&amp;Quit</source>
<translation>&amp;Lopeta</translation>
</message>
<message>
<location filename="main.ui" line="236"/>
<source>&amp;Clear results</source>
<translation>&amp;Tyhjennä tulokset</translation>
</message>
<message>
<location filename="main.ui" line="245"/>
<source>&amp;Preferences</source>
<translation>&amp;Asetukset</translation>
</message>
<message>
<location filename="main.ui" line="261"/>
<source>Show security errors</source>
<translation>Näytä tietoturvavirheet</translation>
</message>
<message>
<location filename="main.ui" line="269"/>
<source>Show style errors</source>
<translation>Näytä tyylivirheet</translation>
</message>
<message>
<location filename="main.ui" line="277"/>
<source>Show common errors</source>
<translation>Näytä yleiset virheet</translation>
</message>
<message>
<location filename="main.ui" line="282"/>
<source>&amp;Check all</source>
<translation>&amp;Valitse kaikki</translation>
</message>
<message>
<location filename="main.ui" line="287"/>
<source>&amp;Uncheck all</source>
<translation>&amp;Poista kaikista valinta</translation>
</message>
<message>
<location filename="main.ui" line="292"/>
<source>Collapse &amp;all</source>
<translation>&amp;Pienennä kaikki</translation>
</message>
<message>
<location filename="main.ui" line="297"/>
<source>&amp;Expand all</source>
<translation>&amp;Laajenna kaikki</translation>
</message>
<message>
<location filename="main.ui" line="305"/>
<source>&amp;Toolbar</source>
<translation>&amp;Työkalupalkki</translation>
</message>
<message>
<location filename="main.ui" line="97"/>
<source>&amp;Language</source>
<translation>&amp;Kieli</translation>
</message>
<message>
<location filename="main.ui" line="102"/>
<source>&amp;Help</source>
<translation>&amp;Ohje</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="205"/>
<source>Select files to check</source>
<translation>Valitse tarkistettavat tiedostot</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="214"/>
<source>Select directory to check</source>
<translation>Valitse tarkistettava hakemisto</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<source>No suitable files found to check!</source>
<translation>Tarkistettavaksi sopivia tiedostoja ei löytynyt!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation>Ohjelmaa ei voi sammuttaa tarkistuksen ollessa käynnissä.
Lopeta tarkistus ennen ohjelman sammuttamista.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="506"/>
<source>XML files (*.xml);;Text files (*.txt)</source>
<translation>XML-tiedostot (*.xml);;Tekstitiedostot (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="508"/>
<source>Save the report file</source>
<translation>Tallenna raportti</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="516"/>
<source>XML files (*.xml)</source>
<translation>XML-tiedostot (*xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="549"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="566"/>
<source>Failed to change language:
%1</source>
<translation>Kielen %1 vaihto epäonnistui</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="translationhandler.cpp" line="12"/>
<source>English</source>
<translation>Englanti</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="13"/>
<source>Finnish</source>
<translation>Suomi</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="14"/>
<source>Swedish</source>
<translation>Ruotsi</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="15"/>
<source>German</source>
<translation>Saksa</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="16"/>
<source>Russian</source>
<translation>Venäjä</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="69"/>
<source>Incorrect language specified!</source>
<translation>Virheellinen kieli valittu!</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="77"/>
<source>Failed to load language from file %1</source>
<translation>Kielen lataaminen tiedostosta %1 epäonnistui</translation>
</message>
</context>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>File</source>
<translation>Tiedosto</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Severity</source>
<translation>Tyyppi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Line</source>
<translation>Rivi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Message</source>
<translation>Virhe</translation>
</message>
<message>
<location filename="resultstree.cpp" line="386"/>
<source>Copy filename</source>
<translation>Kopioi tiedostonimi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="387"/>
<source>Copy full path</source>
<translation>Kopioi tiedoston koko polku</translation>
</message>
<message>
<location filename="resultstree.cpp" line="423"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="424"/>
<source>You can open this error by specifying applications in program&apos;s settings.</source>
<translation>Voit asetuksista määritellä muita ohjelmia joilla avata tämän virheen sisältävän tiedoston.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="469"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation>Ohjelman %1 käynnistäminen epäonnistui
Tarkista että ohjelman polku ja parametrit ovat oikeat.</translation>
</message>
</context>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="77"/>
<location filename="resultsview.cpp" line="89"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="78"/>
<source>No errors found.</source>
<translation>Virheitä ei löytynyt.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="86"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Virheitä löytyi, mutta asetuksissa kyseiset virheet on määritelty piilotettavaksi.
Määrittääksesi minkä tyyppisiä virheitä näytetään, avaa näkymä valikko.</translation>
</message>
<message>
<location filename="resultsview.ui" line="26"/>
<source>Results</source>
<translation>Tulokset</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="settingsdialog.cpp" line="46"/>
<source>Cancel</source>
<translation>Peruuta</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="47"/>
<source>Ok</source>
<translation>Ok</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="68"/>
<source>General</source>
<translation>Yleiset</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="78"/>
<source>Number of threads: </source>
<translation>Säikeiden lukumäärä: </translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="85"/>
<source>Check all #ifdef configurations</source>
<translation>Tarkista kaikki #ifdef kombinaatiot</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="90"/>
<source>Show full path of files</source>
<translation>Näytä tiedostojen täysi polku</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="95"/>
<source>Show &quot;No errors found&quot; message when no errors found</source>
<translation>Näytä &quot;virheitä ei löytynyt&quot;-viesti jos virheitä ei löydy</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="104"/>
<source>Applications</source>
<translation>Ohjelmat</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="111"/>
<source>Add application</source>
<translation>Lisää ohjelma</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="116"/>
<source>Delete application</source>
<translation>Poista ohjelma</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="121"/>
<source>Modify application</source>
<translation>Muokkaa ohjelmaa</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="126"/>
<source>Set as default application</source>
<translation>Aseta oletusohjelmaksi</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="139"/>
<source>Reports</source>
<translation>Raportit</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="143"/>
<source>Save all errors when creating report</source>
<translation>Tallenna kaikki virheet raporttia luodessa</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="148"/>
<source>Save full path to files in reports</source>
<translation>Tallenna tiedostojen koko polku raportteihin</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="154"/>
<source>Settings</source>
<translation>Asetukset</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="227"/>
<source>Add a new application</source>
<translation>Lisää uusi ohjelma</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="260"/>
<source>Modify an application</source>
<translation>Muokkaa ohjelmaa</translation>
</message>
</context>
</TS>

552
gui/cppcheck_ru.ts Normal file
View File

@ -0,0 +1,552 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="49"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>
<message>
<location filename="applicationdialog.cpp" line="40"/>
<source>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="53"/>
<source>Application&apos;s name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="55"/>
<source>Application to execute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="57"/>
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="61"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="62"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="91"/>
<source>Executable files (*.exe);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="94"/>
<source>Select viewer application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="131"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="132"/>
<source>You must specify a name and a path for the application!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileViewDialog</name>
<message>
<location filename="fileviewdialog.cpp" line="37"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="57"/>
<source>Could not find the file: %1</source>
<oldsource>Could not find the file:
</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="61"/>
<location filename="fileviewdialog.cpp" line="76"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="72"/>
<source>Could not read the file: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="242"/>
<location filename="mainwindow.cpp" line="449"/>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="565"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="253"/>
<source>Show possible false positives</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="74"/>
<source>&amp;File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="81"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<source>&amp;Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="119"/>
<source>&amp;Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="134"/>
<source>toolBar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="152"/>
<source>&amp;License...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="157"/>
<source>A&amp;uthors...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="166"/>
<source>&amp;About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="171"/>
<source>&amp;Files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<source>Ctrl+F</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="183"/>
<source>&amp;Directory...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="186"/>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="195"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="198"/>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="207"/>
<source>&amp;Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="210"/>
<source>Esc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="219"/>
<source>&amp;Save results to file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="222"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="227"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="236"/>
<source>&amp;Clear results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="245"/>
<source>&amp;Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="261"/>
<source>Show security errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="269"/>
<source>Show style errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="277"/>
<source>Show common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="282"/>
<source>&amp;Check all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="287"/>
<source>&amp;Uncheck all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="292"/>
<source>Collapse &amp;all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="297"/>
<source>&amp;Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="305"/>
<source>&amp;Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="97"/>
<source>&amp;Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="102"/>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="205"/>
<source>Select files to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="214"/>
<source>Select directory to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="506"/>
<source>XML files (*.xml);;Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="508"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="516"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="549"/>
<source>Cppcheck - %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="566"/>
<source>Failed to change language:
%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="translationhandler.cpp" line="12"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="13"/>
<source>Finnish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="14"/>
<source>Swedish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="15"/>
<source>German</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="16"/>
<source>Russian</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="69"/>
<source>Incorrect language specified!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="77"/>
<source>Failed to load language from file %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Severity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="386"/>
<source>Copy filename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="387"/>
<source>Copy full path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="423"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="424"/>
<source>You can open this error by specifying applications in program&apos;s settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="469"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="77"/>
<location filename="resultsview.cpp" line="89"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="78"/>
<source>No errors found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="86"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.ui" line="26"/>
<source>Results</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="settingsdialog.cpp" line="46"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="47"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="68"/>
<source>General</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="78"/>
<source>Number of threads: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="85"/>
<source>Check all #ifdef configurations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="90"/>
<source>Show full path of files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="95"/>
<source>Show &quot;No errors found&quot; message when no errors found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="104"/>
<source>Applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="111"/>
<source>Add application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="116"/>
<source>Delete application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="121"/>
<source>Modify application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="126"/>
<source>Set as default application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="139"/>
<source>Reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="143"/>
<source>Save all errors when creating report</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="148"/>
<source>Save full path to files in reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="154"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="227"/>
<source>Add a new application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="260"/>
<source>Modify an application</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

552
gui/cppcheck_se.ts Normal file
View File

@ -0,0 +1,552 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="49"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>
<message>
<location filename="applicationdialog.cpp" line="40"/>
<source>Here you can add applications that can open error files.
Specify a name for the application and the application to execute.
The following texts are replaced with appriproate values when application is executed:
(file) - Filename containing the error
(line) - Line number containing the error
(message) - Error message
(severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line:
kate -l(line) (file)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="53"/>
<source>Application&apos;s name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="55"/>
<source>Application to execute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="57"/>
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="61"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="62"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="91"/>
<source>Executable files (*.exe);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="94"/>
<source>Select viewer application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="131"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="applicationdialog.cpp" line="132"/>
<source>You must specify a name and a path for the application!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileViewDialog</name>
<message>
<location filename="fileviewdialog.cpp" line="37"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="57"/>
<source>Could not find the file: %1</source>
<oldsource>Could not find the file:
</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="61"/>
<location filename="fileviewdialog.cpp" line="76"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="fileviewdialog.cpp" line="72"/>
<source>Could not read the file: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="242"/>
<location filename="mainwindow.cpp" line="449"/>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="565"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="253"/>
<source>Show possible false positives</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="74"/>
<source>&amp;File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="81"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<source>&amp;Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="119"/>
<source>&amp;Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="134"/>
<source>toolBar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="152"/>
<source>&amp;License...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="157"/>
<source>A&amp;uthors...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="166"/>
<source>&amp;About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="171"/>
<source>&amp;Files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<source>Ctrl+F</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="183"/>
<source>&amp;Directory...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="186"/>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="195"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="198"/>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="207"/>
<source>&amp;Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="210"/>
<source>Esc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="219"/>
<source>&amp;Save results to file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="222"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="227"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="236"/>
<source>&amp;Clear results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="245"/>
<source>&amp;Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="261"/>
<source>Show security errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="269"/>
<source>Show style errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="277"/>
<source>Show common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="282"/>
<source>&amp;Check all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="287"/>
<source>&amp;Uncheck all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="292"/>
<source>Collapse &amp;all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="297"/>
<source>&amp;Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="305"/>
<source>&amp;Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="97"/>
<source>&amp;Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="102"/>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="205"/>
<source>Select files to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="214"/>
<source>Select directory to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="506"/>
<source>XML files (*.xml);;Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="508"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="516"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="549"/>
<source>Cppcheck - %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="566"/>
<source>Failed to change language:
%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="translationhandler.cpp" line="12"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="13"/>
<source>Finnish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="14"/>
<source>Swedish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="15"/>
<source>German</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="16"/>
<source>Russian</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="69"/>
<source>Incorrect language specified!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="translationhandler.cpp" line="77"/>
<source>Failed to load language from file %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Severity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="39"/>
<location filename="resultstree.cpp" line="752"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="386"/>
<source>Copy filename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="387"/>
<source>Copy full path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="423"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="424"/>
<source>You can open this error by specifying applications in program&apos;s settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="469"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="77"/>
<location filename="resultsview.cpp" line="89"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="78"/>
<source>No errors found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="86"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.ui" line="26"/>
<source>Results</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="settingsdialog.cpp" line="46"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="47"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="68"/>
<source>General</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="78"/>
<source>Number of threads: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="85"/>
<source>Check all #ifdef configurations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="90"/>
<source>Show full path of files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="95"/>
<source>Show &quot;No errors found&quot; message when no errors found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="104"/>
<source>Applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="111"/>
<source>Add application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="116"/>
<source>Delete application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="121"/>
<source>Modify application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="126"/>
<source>Set as default application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="139"/>
<source>Reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="143"/>
<source>Save all errors when creating report</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="148"/>
<source>Save full path to files in reports</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="154"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="227"/>
<source>Add a new application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="260"/>
<source>Modify an application</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -54,8 +54,9 @@ void FileViewDialog::LoadTextFile(const QString &filename, QTextEdit *edit)
QFile file(filename);
if (!file.exists())
{
QString msg(tr("Could not find the file:\n"));
msg += filename;
QString msg(tr("Could not find the file: %1"));
msg = msg.arg(filename);
QMessageBox msgbox(QMessageBox::Critical,
tr("Cppcheck"),
msg,
@ -68,8 +69,9 @@ void FileViewDialog::LoadTextFile(const QString &filename, QTextEdit *edit)
file.open(QIODevice::ReadOnly | QIODevice::Text);
if (!file.isReadable())
{
QString msg(tr("Could not read the file:\n"));
msg += filename;
QString msg(tr("Could not read the file: %1"));
msg = msg.arg(filename);
QMessageBox msgbox(QMessageBox::Critical,
tr("Cppcheck"),
msg,

View File

@ -11,6 +11,14 @@ MOC_DIR = temp
OBJECTS_DIR = temp
CONFIG += warn_on debug
RESOURCES = gui.qrc
FORMS = main.ui \
resultsview.ui
TRANSLATIONS = cppcheck_fi.ts \
cppcheck_en.ts \
cppcheck_se.ts \
cppcheck_de.ts \
cppcheck_ru.ts
# Windows-specific options
CONFIG += embed_manifest_exe
@ -32,6 +40,7 @@ HEADERS += mainwindow.h \
report.h \
txtreport.h \
xmlreport.h \
translationhandler.h \
../src/checkautovariables.h \
../src/checkdangerousfunctions.h \
../src/checkheaders.h \
@ -71,6 +80,7 @@ SOURCES += main.cpp \
report.cpp \
txtreport.cpp \
xmlreport.cpp \
translationhandler.cpp \
../src/checkautovariables.cpp \
../src/checkdangerousfunctions.cpp \
../src/checkmemoryleak.cpp \

View File

@ -19,6 +19,7 @@
#include <QApplication>
#include <QTextCodec>
#include <QTranslator>
#include "mainwindow.h"
int main(int argc, char *argv[])
@ -30,6 +31,8 @@ int main(int argc, char *argv[])
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
MainWindow window;
window.show();
return app.exec();

321
gui/main.ui Normal file
View File

@ -0,0 +1,321 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>640</width>
<height>480</height>
</size>
</property>
<property name="windowTitle">
<string>Cppcheck</string>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<widget class="QWidget" name="mCentral">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="ResultsView" name="mResults" native="true"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="mActionSave"/>
<addaction name="mActionQuit"/>
</widget>
<widget class="QMenu" name="menu_View">
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="mActionShowAll"/>
<addaction name="mActionShowSecurity"/>
<addaction name="mActionShowStyle"/>
<addaction name="mActionShowErrors"/>
<addaction name="mActionCheckAll"/>
<addaction name="mActionUncheckAll"/>
<addaction name="separator"/>
<addaction name="mActionCollapseAll"/>
<addaction name="mActionExpandAll"/>
<addaction name="separator"/>
<addaction name="mActionToolbar"/>
</widget>
<widget class="QMenu" name="menu_Language">
<property name="title">
<string>&amp;Language</string>
</property>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="mActionLicense"/>
<addaction name="mActionAuthors"/>
<addaction name="mActionAbout"/>
</widget>
<widget class="QMenu" name="menu_Check">
<property name="title">
<string>&amp;Check</string>
</property>
<addaction name="mActionCheckFiles"/>
<addaction name="mActionCheckDirectory"/>
<addaction name="mActionRecheck"/>
<addaction name="mActionStop"/>
</widget>
<widget class="QMenu" name="menu_Edit">
<property name="title">
<string>&amp;Edit</string>
</property>
<addaction name="mActionClearResults"/>
<addaction name="mActionSettings"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Edit"/>
<addaction name="menu_View"/>
<addaction name="menu_Check"/>
<addaction name="menu_Language"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="mActionCheckDirectory"/>
<addaction name="mActionSave"/>
<addaction name="mActionRecheck"/>
<addaction name="mActionStop"/>
<addaction name="mActionClearResults"/>
<addaction name="mActionSettings"/>
<addaction name="mActionAbout"/>
</widget>
<action name="mActionLicense">
<property name="text">
<string>&amp;License...</string>
</property>
</action>
<action name="mActionAuthors">
<property name="text">
<string>A&amp;uthors...</string>
</property>
</action>
<action name="mActionAbout">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/help-browser.png</normaloff>:/images/help-browser.png</iconset>
</property>
<property name="text">
<string>&amp;About...</string>
</property>
</action>
<action name="mActionCheckFiles">
<property name="text">
<string>&amp;Files...</string>
</property>
<property name="shortcut">
<string>Ctrl+F</string>
</property>
</action>
<action name="mActionCheckDirectory">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<property name="text">
<string>&amp;Directory...</string>
</property>
<property name="shortcut">
<string>Ctrl+D</string>
</property>
</action>
<action name="mActionRecheck">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/view-refresh.png</normaloff>:/images/view-refresh.png</iconset>
</property>
<property name="text">
<string>&amp;Recheck files</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
</action>
<action name="mActionStop">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/process-stop.png</normaloff>:/images/process-stop.png</iconset>
</property>
<property name="text">
<string>&amp;Stop</string>
</property>
<property name="shortcut">
<string>Esc</string>
</property>
</action>
<action name="mActionSave">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/media-floppy.png</normaloff>:/images/media-floppy.png</iconset>
</property>
<property name="text">
<string>&amp;Save results to file...</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="mActionQuit">
<property name="text">
<string>&amp;Quit</string>
</property>
</action>
<action name="mActionClearResults">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/edit-clear.png</normaloff>:/images/edit-clear.png</iconset>
</property>
<property name="text">
<string>&amp;Clear results</string>
</property>
</action>
<action name="mActionSettings">
<property name="icon">
<iconset resource="gui.qrc">
<normaloff>:/images/preferences-system.png</normaloff>:/images/preferences-system.png</iconset>
</property>
<property name="text">
<string>&amp;Preferences</string>
</property>
</action>
<action name="mActionShowAll">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show possible false positives</string>
</property>
</action>
<action name="mActionShowSecurity">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show security errors</string>
</property>
</action>
<action name="mActionShowStyle">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show style errors</string>
</property>
</action>
<action name="mActionShowErrors">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show common errors</string>
</property>
</action>
<action name="mActionCheckAll">
<property name="text">
<string>&amp;Check all</string>
</property>
</action>
<action name="mActionUncheckAll">
<property name="text">
<string>&amp;Uncheck all</string>
</property>
</action>
<action name="mActionCollapseAll">
<property name="text">
<string>Collapse &amp;all</string>
</property>
</action>
<action name="mActionExpandAll">
<property name="text">
<string>&amp;Expand all</string>
</property>
</action>
<action name="mActionToolbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Toolbar</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>ResultsView</class>
<extends>QWidget</extends>
<header>resultsview.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="gui.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -35,84 +35,62 @@
#include "../src/cppcheckexecutor.h"
MainWindow::MainWindow() :
mSettings("Cppcheck", "Cppcheck-GUI"),
mActionExit(tr("E&xit"), this),
mActionCheckFiles(tr("&Check files(s)"), this),
mActionClearResults(tr("Clear &results"), this),
mActionReCheck(tr("Recheck files"), this),
mActionCheckDirectory(tr("Check &directory"), this),
mActionSettings(tr("&Settings"), this),
mActionViewStandardToolbar(tr("Toolbar"), this),
mActionShowAll(tr("Show possible false positives"), this),
mActionShowSecurity(tr("Show &security errors"), this),
mActionShowStyle(tr("Show s&tyle errors"), this),
mActionShowErrors(tr("Show &common errors"), this),
mActionShowCheckAll(tr("Show all"), this),
mActionShowUncheckAll(tr("Hide all"), this),
mActionShowCollapseAll(tr("Collapse all"), this),
mActionShowExpandAll(tr("Expand all"), this),
mActionAbout(tr("About"), this),
mActionShowLicense(tr("License..."), this),
mActionShowAuthors(tr("Authors..."), this),
mActionStop(tr("Stop checking"), this),
mActionSave(tr("Save results to a file"), this),
mResults(mSettings, mApplications)
mSettings(new QSettings("Cppcheck", "Cppcheck-GUI", this)),
mApplications(new ApplicationList(this)),
mTranslation(new TranslationHandler(this)),
mLanguages(new QActionGroup(this))
{
CreateMenus();
CreateToolbar();
mUI.setupUi(this);
mUI.mResults->Initialize(mSettings, mApplications);
mThread = new ThreadHandler(this);
setCentralWidget(&mResults);
connect(&mActionExit, SIGNAL(triggered()), this, SLOT(close()));
connect(&mActionCheckFiles, SIGNAL(triggered()), this, SLOT(CheckFiles()));
connect(&mActionCheckDirectory, SIGNAL(triggered()), this, SLOT(CheckDirectory()));
connect(&mActionSettings, SIGNAL(triggered()), this, SLOT(ProgramSettings()));
connect(&mActionClearResults, SIGNAL(triggered()), this, SLOT(ClearResults()));
connect(&mActionViewStandardToolbar, SIGNAL(toggled(bool)), this, SLOT(ViewStandardToolbar(bool)));
connect(&mActionShowAll, SIGNAL(toggled(bool)), this, SLOT(ShowAll(bool)));
connect(&mActionShowSecurity, SIGNAL(toggled(bool)), this, SLOT(ShowSecurity(bool)));
connect(&mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool)));
connect(&mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool)));
connect(&mActionShowCheckAll, SIGNAL(triggered()), this, SLOT(CheckAll()));
connect(&mActionShowUncheckAll, SIGNAL(triggered()), this, SLOT(UncheckAll()));
connect(&mActionShowCollapseAll, SIGNAL(triggered()), &mResults, SLOT(CollapseAllResults()));
connect(&mActionShowExpandAll, SIGNAL(triggered()), &mResults, SLOT(ExpandAllResults()));
connect(mUI.mActionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(mUI.mActionCheckFiles, SIGNAL(triggered()), this, SLOT(CheckFiles()));
connect(mUI.mActionCheckDirectory, SIGNAL(triggered()), this, SLOT(CheckDirectory()));
connect(mUI.mActionSettings, SIGNAL(triggered()), this, SLOT(ProgramSettings()));
connect(mUI.mActionClearResults, SIGNAL(triggered()), this, SLOT(ClearResults()));
connect(&mActionReCheck, SIGNAL(triggered()), this, SLOT(ReCheck()));
connect(mUI.mActionShowAll, SIGNAL(toggled(bool)), this, SLOT(ShowAll(bool)));
connect(mUI.mActionShowSecurity, SIGNAL(toggled(bool)), this, SLOT(ShowSecurity(bool)));
connect(mUI.mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool)));
connect(mUI.mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool)));
connect(mUI.mActionCheckAll, SIGNAL(triggered()), this, SLOT(CheckAll()));
connect(mUI.mActionUncheckAll, SIGNAL(triggered()), this, SLOT(UncheckAll()));
connect(mUI.mActionCollapseAll, SIGNAL(triggered()), mUI.mResults, SLOT(CollapseAllResults()));
connect(mUI.mActionExpandAll, SIGNAL(triggered()), mUI.mResults, SLOT(ExpandAllResults()));
connect(&mActionStop, SIGNAL(triggered()), mThread, SLOT(Stop()));
connect(&mActionSave, SIGNAL(triggered()), this, SLOT(Save()));
connect(mUI.mActionRecheck, SIGNAL(triggered()), this, SLOT(ReCheck()));
connect(&mActionAbout, SIGNAL(triggered()), this, SLOT(About()));
connect(&mActionShowLicense, SIGNAL(triggered()), this, SLOT(ShowLicense()));
connect(&mActionShowAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors()));
connect(mUI.mActionStop, SIGNAL(triggered()), mThread, SLOT(Stop()));
connect(mUI.mActionSave, SIGNAL(triggered()), this, SLOT(Save()));
connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About()));
connect(mUI.mActionLicense, SIGNAL(triggered()), this, SLOT(ShowLicense()));
connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors()));
connect(mThread, SIGNAL(Done()), this, SLOT(CheckDone()));
connect(&mResults, SIGNAL(GotResults()), this, SLOT(ResultsAdded()));
connect(mUI.mResults, SIGNAL(GotResults()), this, SLOT(ResultsAdded()));
mActionCheckDirectory.setIcon(QIcon(":icon.png"));
mActionReCheck.setIcon(QIcon(":images/view-refresh.png"));
mActionSettings.setIcon(QIcon(":images/preferences-system.png"));
mActionAbout.setIcon(QIcon(":images/help-browser.png"));
mActionStop.setIcon(QIcon(":images/process-stop.png"));
mActionSave.setIcon(QIcon(":images/media-floppy.png"));
mActionClearResults.setIcon(QIcon(":images/edit-clear.png"));
mActionReCheck.setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
mActionCheckDirectory.setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
mActionSave.setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
mActionAbout.setShortcut(QKeySequence(Qt::Key_F1));
LoadSettings();
mThread->Initialize(&mResults);
mThread->Initialize(mUI.mResults);
FormatAndSetTitle();
EnableCheckButtons(true);
mActionClearResults.setEnabled(false);
mActionSave.setEnabled(false);
mUI.mActionClearResults->setEnabled(false);
mUI.mActionSave->setEnabled(false);
CreateLanguageMenuItems();
}
MainWindow::~MainWindow()
@ -120,109 +98,98 @@ MainWindow::~MainWindow()
SaveSettings();
}
void MainWindow::CreateMenus()
void MainWindow::CreateLanguageMenuItems()
{
// File-menu
QMenu *menu = menuBar()->addMenu(tr("&File"));
menu->addAction(&mActionCheckFiles);
menu->addAction(&mActionCheckDirectory);
menu->addAction(&mActionReCheck);
menu->addAction(&mActionStop);
menu->addAction(&mActionClearResults);
menu->addAction(&mActionSave);
menu->addSeparator();
menu->addAction(&mActionExit);
// View-menu
QMenu *menuview = menuBar()->addMenu(tr("&View"));
menuview->addAction(&mActionViewStandardToolbar);
menuview->addSeparator();
menuview->addAction(&mActionShowAll);
menuview->addAction(&mActionShowSecurity);
menuview->addAction(&mActionShowStyle);
menuview->addAction(&mActionShowErrors);
menuview->addSeparator();
menuview->addAction(&mActionShowCheckAll);
menuview->addAction(&mActionShowUncheckAll);
menuview->addSeparator();
menuview->addAction(&mActionShowCollapseAll);
menuview->addAction(&mActionShowExpandAll);
mActionViewStandardToolbar.setCheckable(true);
mActionShowAll.setCheckable(true);
mActionShowSecurity.setCheckable(true);
mActionShowStyle.setCheckable(true);
mActionShowErrors.setCheckable(true);
connect(menuview, SIGNAL(aboutToShow()), this, SLOT(AboutToShowViewMenu()));
// Program-menu
QMenu *menuprogram = menuBar()->addMenu(tr("&Program"));
menuprogram->addAction(&mActionSettings);
QStringList languages = mTranslation->GetNames();
// Help-menu
QMenu *menuHelp = menuBar()->addMenu(tr("&Help"));
menuHelp->addAction(&mActionShowLicense);
menuHelp->addAction(&mActionShowAuthors);
menuHelp->addSeparator();
menuHelp->addAction(&mActionAbout);
for (int i = 0;i < languages.size();i++)
{
//Create an action for each language
//Language name is pre translated
QAction *temp = new QAction(languages[i], this);
temp->setCheckable(true);
//Add the action to menu
mUI.menu_Language->addAction(temp);
//Add action to the group
mLanguages->addAction(temp);
//Check it if it's the value stored to settings
if (i == mSettings->value(SETTINGS_LANGUAGE, 0).toInt())
{
temp->setChecked(true);
}
else
{
temp->setChecked(false);
}
}
connect(mLanguages, SIGNAL(triggered(QAction *)),
this, SLOT(MapLanguage(QAction *)));
}
void MainWindow::CreateToolbar()
{
mStandardToolbar = addToolBar("Standard");
mStandardToolbar->setIconSize(QSize(22, 22));
mStandardToolbar->addAction(&mActionCheckDirectory);
mStandardToolbar->addAction(&mActionSave);
mStandardToolbar->addAction(&mActionReCheck);
mStandardToolbar->addAction(&mActionStop);
mStandardToolbar->addAction(&mActionClearResults);
mStandardToolbar->addAction(&mActionSettings);
mStandardToolbar->addAction(&mActionAbout);
}
void MainWindow::LoadSettings()
{
if (mSettings.value("Window maximized", false).toBool())
if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool())
{
showMaximized();
}
else
{
resize(mSettings.value("Window width", 800).toInt(),
mSettings.value("Window height", 600).toInt());
resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
}
mActionShowAll.setChecked(mSettings.value("Show all", true).toBool());
mActionShowSecurity.setChecked(mSettings.value("Show security", true).toBool());
mActionShowStyle.setChecked(mSettings.value("Show style", true).toBool());
mActionShowErrors.setChecked(mSettings.value("Show errors", true).toBool());
mResults.ShowResults(SHOW_ALL, mActionShowAll.isChecked());
mResults.ShowResults(SHOW_ERRORS, mActionShowErrors.isChecked());
mResults.ShowResults(SHOW_SECURITY, mActionShowSecurity.isChecked());
mResults.ShowResults(SHOW_STYLE, mActionShowStyle.isChecked());
mUI.mActionShowAll->setChecked(mSettings->value(SETTINGS_SHOW_ALL, true).toBool());
mUI.mActionShowSecurity->setChecked(mSettings->value(SETTINGS_SHOW_SECURITY, true).toBool());
mUI.mActionShowStyle->setChecked(mSettings->value(SETTINGS_SHOW_STYLE, true).toBool());
mUI.mActionShowErrors->setChecked(mSettings->value(SETTINGS_SHOW_ERRORS, true).toBool());
mStandardToolbar->setVisible(mSettings.value("Toolbars/ShowStandard", true).toBool());
mApplications.LoadSettings(mSettings);
mUI.mResults->ShowResults(SHOW_ALL, mUI.mActionShowAll->isChecked());
mUI.mResults->ShowResults(SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
mUI.mResults->ShowResults(SHOW_SECURITY, mUI.mActionShowSecurity->isChecked());
mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked());
mUI.mActionToolbar->setChecked(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());
mUI.toolBar->setVisible(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());
mApplications->LoadSettings(mSettings);
QString error = "";
SetLanguage(mSettings->value(SETTINGS_LANGUAGE, 0).toInt());
}
void MainWindow::SaveSettings()
{
mSettings.setValue("Window width", size().width());
mSettings.setValue("Window height", size().height());
mSettings.setValue("Window maximized", isMaximized());
mSettings->setValue(SETTINGS_WINDOW_WIDTH, size().width());
mSettings->setValue(SETTINGS_WINDOW_HEIGHT, size().height());
mSettings->setValue(SETTINGS_WINDOW_MAXIMIZED, isMaximized());
mSettings.setValue("Show all", mActionShowAll.isChecked());
mSettings.setValue("Show security", mActionShowSecurity.isChecked());
mSettings.setValue("Show style", mActionShowStyle.isChecked());
mSettings.setValue("Show errors", mActionShowErrors.isChecked());
mSettings.setValue("Toolbars/ShowStandard", mActionViewStandardToolbar.isChecked());
mSettings->setValue(SETTINGS_SHOW_ALL, mUI.mActionShowAll->isChecked());
mSettings->setValue(SETTINGS_SHOW_SECURITY, mUI.mActionShowSecurity->isChecked());
mSettings->setValue(SETTINGS_SHOW_STYLE, mUI.mActionShowStyle->isChecked());
mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mActionToolbar->isChecked());
mApplications.SaveSettings(mSettings);
mApplications->SaveSettings(mSettings);
mSettings->setValue(SETTINGS_LANGUAGE, mTranslation->GetCurrentLanguage());
mUI.mResults->SaveSettings();
}
void MainWindow::DoCheckFiles(QFileDialog::FileMode mode)
@ -236,7 +203,7 @@ void MainWindow::DoCheckFiles(QFileDialog::FileMode mode)
{
selected = QFileDialog::getOpenFileNames(this,
tr("Select files to check"),
mSettings.value("Check path", "").toString());
mSettings->value(SETTINGS_CHECK_PATH, "").toString());
if (selected.isEmpty())
mCurrentDirectory.clear();
FormatAndSetTitle();
@ -245,7 +212,7 @@ void MainWindow::DoCheckFiles(QFileDialog::FileMode mode)
{
QString dir = QFileDialog::getExistingDirectory(this,
tr("Select directory to check"),
mSettings.value("Check path", "").toString());
mSettings->value(SETTINGS_CHECK_PATH, "").toString());
if (!dir.isEmpty())
{
mCurrentDirectory = dir;
@ -266,7 +233,7 @@ void MainWindow::DoCheckFiles(QFileDialog::FileMode mode)
fileNames << RemoveUnacceptedFiles(GetFilesRecursively(selection));
}
mResults.Clear();
mUI.mResults->Clear();
mThread->ClearFiles();
if (fileNames.isEmpty())
@ -280,15 +247,16 @@ void MainWindow::DoCheckFiles(QFileDialog::FileMode mode)
return;
}
mResults.CheckingStarted();
mUI.mResults->CheckingStarted();
mThread->SetFiles(RemoveUnacceptedFiles(fileNames));
QFileInfo inf(fileNames[0]);
QString absDirectory = inf.absoluteDir().path();
mSettings.setValue("Check path", absDirectory);
mSettings->setValue(SETTINGS_CHECK_PATH, absDirectory);
EnableCheckButtons(false);
mActionSettings.setEnabled(false);
mResults.SetCheckDirectory(absDirectory);
mUI.mActionSettings->setEnabled(false);
mUI.mResults->SetCheckDirectory(absDirectory);
Settings checkSettings = GetCppcheckSettings();
mThread->Check(checkSettings, false);
@ -336,11 +304,11 @@ Settings MainWindow::GetCppcheckSettings()
result._checkCodingStyle = true;
result._errorsOnly = false;
result._verbose = true;
result._force = mSettings.value("Check force", 1).toBool();
result._force = mSettings->value(SETTINGS_CHECK_FORCE, 1).toBool();
result._xml = false;
result._unusedFunctions = false;
result._security = true;
result._jobs = mSettings.value("Check threads", 1).toInt();
result._jobs = mSettings->value(SETTINGS_CHECK_THREADS, 1).toInt();
if (result._jobs <= 0)
{
@ -390,11 +358,11 @@ QStringList MainWindow::RemoveUnacceptedFiles(const QStringList &list)
void MainWindow::CheckDone()
{
EnableCheckButtons(true);
mActionSettings.setEnabled(true);
if (mResults.HasResults())
mUI.mActionSettings->setEnabled(true);
if (mUI.mResults->HasResults())
{
mActionClearResults.setEnabled(true);
mActionSave.setEnabled(true);
mUI.mActionClearResults->setEnabled(true);
mUI.mActionSave->setEnabled(true);
}
// Notify user - if the window is not active - that check is ready
@ -407,10 +375,10 @@ void MainWindow::ProgramSettings()
if (dialog.exec() == QDialog::Accepted)
{
dialog.SaveCheckboxValues();
mResults.UpdateSettings(dialog.ShowFullPath(),
dialog.SaveFullPath(),
dialog.SaveAllErrors(),
dialog.ShowNoErrorsMessage());
mUI.mResults->UpdateSettings(dialog.ShowFullPath(),
dialog.SaveFullPath(),
dialog.SaveAllErrors(),
dialog.ShowNoErrorsMessage());
}
}
@ -423,38 +391,38 @@ void MainWindow::ReCheck()
void MainWindow::ClearResults()
{
mResults.Clear();
mActionClearResults.setEnabled(false);
mActionSave.setEnabled(false);
mUI.mResults->Clear();
mUI.mActionClearResults->setEnabled(false);
mUI.mActionSave->setEnabled(false);
}
void MainWindow::EnableCheckButtons(bool enable)
{
mActionStop.setEnabled(!enable);
mActionCheckFiles.setEnabled(enable);
mActionReCheck.setEnabled(enable);
mActionCheckDirectory.setEnabled(enable);
mUI.mActionStop->setEnabled(!enable);
mUI.mActionCheckFiles->setEnabled(enable);
mUI.mActionRecheck->setEnabled(enable);
mUI.mActionCheckDirectory->setEnabled(enable);
}
void MainWindow::ShowAll(bool checked)
{
mResults.ShowResults(SHOW_ALL, checked);
mUI.mResults->ShowResults(SHOW_ALL, checked);
}
void MainWindow::ShowSecurity(bool checked)
{
mResults.ShowResults(SHOW_SECURITY, checked);
mUI.mResults->ShowResults(SHOW_SECURITY, checked);
}
void MainWindow::ShowStyle(bool checked)
{
mResults.ShowResults(SHOW_STYLE, checked);
mUI.mResults->ShowResults(SHOW_STYLE, checked);
}
void MainWindow::ShowErrors(bool checked)
{
mResults.ShowResults(SHOW_ERRORS, checked);
mUI.mResults->ShowResults(SHOW_ERRORS, checked);
}
void MainWindow::CheckAll()
@ -492,16 +460,16 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::ToggleAllChecked(bool checked)
{
mActionShowAll.setChecked(checked);
mUI.mActionShowAll->setChecked(checked);
ShowAll(checked);
mActionShowSecurity.setChecked(checked);
mUI.mActionShowSecurity->setChecked(checked);
ShowSecurity(checked);
mActionShowStyle.setChecked(checked);
mUI.mActionShowStyle->setChecked(checked);
ShowStyle(checked);
mActionShowErrors.setChecked(checked);
mUI.mActionShowErrors->setChecked(checked);
ShowErrors(checked);
}
@ -559,7 +527,7 @@ void MainWindow::Save()
selectedFile += ".txt";
}
mResults.Save(selectedFile, xml);
mUI.mResults->Save(selectedFile, xml);
}
}
@ -567,12 +535,9 @@ void MainWindow::ResultsAdded()
{
}
void MainWindow::ViewStandardToolbar(bool view)
void MainWindow::ToggleToolbar()
{
if (view)
mStandardToolbar->show();
else
mStandardToolbar->hide();
mUI.toolBar->setVisible(mUI.mActionToolbar->isChecked());
}
void MainWindow::FormatAndSetTitle(const QString &text)
@ -585,10 +550,42 @@ void MainWindow::FormatAndSetTitle(const QString &text)
setWindowTitle(title);
}
void MainWindow::AboutToShowViewMenu()
void MainWindow::SetLanguage(int index)
{
if (mStandardToolbar->isVisible())
mActionViewStandardToolbar.setChecked(true);
if (mTranslation->GetCurrentLanguage() == index)
{
return;
}
QString error;
if (!mTranslation->SetLanguage(index, error))
{
QMessageBox msg(QMessageBox::Warning,
tr("Cppcheck"),
QString(tr("Failed to change language:\n\n%1")).arg(error),
QMessageBox::Ok,
this);
msg.exec();
}
else
mActionViewStandardToolbar.setChecked(false);
{
mUI.retranslateUi(this);
}
}
void MainWindow::MapLanguage(QAction *action)
{
//Find the action that has the language that user clicked
QList<QAction *> actions = mLanguages->actions();
for (int i = 0;i < actions.size();i++)
{
if (actions[i] == action)
{
SetLanguage(i);
}
}
}

View File

@ -22,13 +22,16 @@
#include <QMainWindow>
#include <QSettings>
#include <QAction>
#include <QFileDialog>
#include <QSignalMapper>
#include <QActionGroup>
#include <QToolBar>
#include "resultsview.h"
#include "settingsdialog.h"
#include "translationhandler.h"
#include "ui_main.h"
class ThreadHandler;
/**
@ -44,6 +47,8 @@ public:
public slots:
/**
* @brief Slot for check files menu item
*
@ -146,27 +151,32 @@ protected slots:
*/
void ResultsAdded();
/**
* @brief Slot for changing the program's language
*
*/
void MapLanguage(QAction *);
/**
* @brief Slot for showing/hiding standard toolbar
*/
void ViewStandardToolbar(bool view);
void ToggleToolbar();
/**
* @brief Slot for updating View-menu before it is shown.
*/
void AboutToShowViewMenu();
protected:
/**
* @brief Create main window menus.
* @brief Create menu items to change language
*
*/
void CreateMenus();
void CreateLanguageMenuItems();
/**
* @brief Create main window toolbar.
* @brief Set current language
* @param index Index of the language to set
*/
void CreateToolbar();
void SetLanguage(const int index);
/**
* @brief Event coming when application is about to close.
@ -239,132 +249,16 @@ protected:
* @brief Program settings
*
*/
QSettings mSettings;
QSettings *mSettings;
/**
* @brief Menu action to exit program
*
*/
QAction mActionExit;
/**
* @brief Menu action to check files
*
*/
QAction mActionCheckFiles;
/**
* @brief Menu action to clear results
*
*/
QAction mActionClearResults;
/**
* @brief Menu action to re check
*
*/
QAction mActionReCheck;
/**
* @brief Menu action to check a directory
*
*/
QAction mActionCheckDirectory;
/**
* @brief Menu action to open settings dialog
*
*/
QAction mActionSettings;
/**
* @brief Menu action to show/hide standard toolbar
*/
QAction mActionViewStandardToolbar;
/**
* @brief Action to show errors with type "all"
*
*/
QAction mActionShowAll;
/**
* @brief Action to show errors with type "security"
*
*/
QAction mActionShowSecurity;
/**
* @brief Action to show errors with type "style"
*
*/
QAction mActionShowStyle;
/**
* @brief Action to show errors with type "error"
*
*/
QAction mActionShowErrors;
/**
* @brief Action to check all "show error" menu items
*
*/
QAction mActionShowCheckAll;
/**
* @brief Action to uncheck all "show error" menu items
*
*/
QAction mActionShowUncheckAll;
/**
* @brief Action to collapse all items in the result tree.
*
*/
QAction mActionShowCollapseAll;
/**
* @brief Action to expand all items in the result tree.
*
*/
QAction mActionShowExpandAll;
/**
* @brief Action to show about dialog
*
*/
QAction mActionAbout;
/**
* @brief Action to show license text
*
*/
QAction mActionShowLicense;
/**
* @brief Action to show authors list
*
*/
QAction mActionShowAuthors;
/**
* @brief Action stop checking files
*
*/
QAction mActionStop;
/**
* @brief Action save found errors to a file
*
*/
QAction mActionSave;
/**
* @brief Results for checking
*
*/
ResultsView mResults;
// ResultsView mResults;
/**
* @brief Thread to check files
@ -376,19 +270,31 @@ protected:
* @brief List of user defined applications to open errors with
*
*/
ApplicationList mApplications;
ApplicationList *mApplications;
private:
/**
* @brief Class to handle translation changes
*
*/
TranslationHandler *mTranslation;
/**
* @brief Class holding all UI components
*
*/
Ui::MainWindow mUI;
/**
* @brief Group holding all supported languages
*
*/
QActionGroup *mLanguages;
/**
* @brief Current checked directory.
*/
QString mCurrentDirectory;
/**
* @brief Standard toolbar (currently only one).
*/
QToolBar *mStandardToolbar;
};
#endif // MAINWINDOW_H

View File

@ -28,9 +28,8 @@
#include "resultstree.h"
#include "xmlreport.h"
ResultsTree::ResultsTree(QSettings &settings, ApplicationList &list) :
mSettings(settings),
mApplications(list),
ResultsTree::ResultsTree(QWidget * parent) :
QTreeView(parent),
mContextItem(0),
mCheckPath(""),
mVisibleErrors(false)
@ -41,16 +40,23 @@ ResultsTree::ResultsTree(QSettings &settings, ApplicationList &list) :
mModel.setHorizontalHeaderLabels(labels);
setExpandsOnDoubleClick(false);
setSortingEnabled(true);
LoadSettings();
connect(this, SIGNAL(doubleClicked(const QModelIndex &)),
this, SLOT(QuickStartApplication(const QModelIndex &)));
}
ResultsTree::~ResultsTree()
{
SaveSettings();
}
void ResultsTree::Initialize(QSettings *settings, ApplicationList *list)
{
mSettings = settings;
mApplications = list;
LoadSettings();
}
QStandardItem *ResultsTree::CreateItem(const QString &name)
{
QStandardItem *item = new QStandardItem(name);
@ -207,21 +213,21 @@ void ResultsTree::LoadSettings()
for (int i = 0; i < mModel.columnCount(); i++)
{
//mFileTree.columnWidth(i);
QString temp = QString(tr("Result column %1 width")).arg(i);
setColumnWidth(i, mSettings.value(temp, 800 / mModel.columnCount()).toInt());
QString temp = QString(SETTINGS_RESULT_COLUMN_WIDTH).arg(i);
setColumnWidth(i, mSettings->value(temp, 800 / mModel.columnCount()).toInt());
}
mSaveFullPath = mSettings.value("Save full path", false).toBool();
mSaveAllErrors = mSettings.value("Save all errors", false).toBool();
mShowFullPath = mSettings.value("Show full path", false).toBool();
mSaveFullPath = mSettings->value(SETTINGS_SAVE_FULL_PATH, false).toBool();
mSaveAllErrors = mSettings->value(SETTINGS_SAVE_ALL_ERRORS, false).toBool();
mShowFullPath = mSettings->value(SETTINGS_SHOW_FULL_PATH, false).toBool();
}
void ResultsTree::SaveSettings()
{
for (int i = 0; i < mModel.columnCount(); i++)
{
QString temp = QString(tr("Result column %1 width")).arg(i);
mSettings.setValue(temp, columnWidth(i));
QString temp = QString(SETTINGS_RESULT_COLUMN_WIDTH).arg(i);
mSettings->setValue(temp, columnWidth(i));
}
}
@ -343,13 +349,13 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
//member variables
QSignalMapper *signalMapper = new QSignalMapper(this);
if (mContextItem && mApplications.GetApplicationCount() > 0 && mContextItem->parent())
if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent())
{
//Go through all applications and add them to the context menu
for (int i = 0; i < mApplications.GetApplicationCount(); i++)
for (int i = 0;i < mApplications->GetApplicationCount();i++)
{
//Create an action for the application
QAction *start = new QAction(mApplications.GetApplicationName(i), &menu);
QAction *start = new QAction(mApplications->GetApplicationName(i), &menu);
//Add it to our list so we can disconnect later on
actions << start;
@ -371,7 +377,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
// Add menuitems to copy full path/filename to clipboard
if (mContextItem)
{
if (mApplications.GetApplicationCount() > 0)
if (mApplications->GetApplicationCount() > 0)
{
menu.addSeparator();
}
@ -390,7 +396,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
//Start the menu
menu.exec(e->globalPos());
if (mContextItem && mApplications.GetApplicationCount() > 0 && mContextItem->parent())
if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent())
{
//Disconnect all signals
for (int i = 0; i < actions.size(); i++)
@ -411,7 +417,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
void ResultsTree::StartApplication(QStandardItem *target, int application)
{
//If there are now application's specified, tell the user about it
if (mApplications.GetApplicationCount() == 0)
if (mApplications->GetApplicationCount() == 0)
{
QMessageBox msg(QMessageBox::Warning,
tr("Cppcheck"),
@ -422,11 +428,11 @@ void ResultsTree::StartApplication(QStandardItem *target, int application)
return;
}
if (target && application >= 0 && application < mApplications.GetApplicationCount() && target->parent())
if (target && application >= 0 && application < mApplications->GetApplicationCount() && target->parent())
{
QVariantMap data = target->data().toMap();
QString program = mApplications.GetApplicationPath(application);
QString program = mApplications->GetApplicationPath(application);
//TODO Check which line was actually right clicked, now defaults to 0
unsigned int index = 0;
@ -459,9 +465,8 @@ void ResultsTree::StartApplication(QStandardItem *target, int application)
bool success = QProcess::startDetached(program);
if (!success)
{
QString app = mApplications.GetApplicationName(application);
QString text = tr("Could not start ") + app + "\n\n";
text += tr("Please check the application path and parameters are correct.");
QString app = mApplications->GetApplicationName(application);
QString text = tr("Could not start %1\n\nPlease check the application path and parameters are correct.").arg(app);
QMessageBox msgbox(this);
msgbox.setWindowTitle("Cppcheck");
@ -740,3 +745,12 @@ bool ResultsTree::HasResults() const
{
return mModel.rowCount() > 0;
}
void ResultsTree::LanguageChanged()
{
QStringList labels;
labels << tr("File") << tr("Severity") << tr("Line") << tr("Message");
mModel.setHorizontalHeaderLabels(labels);
}

View File

@ -39,8 +39,9 @@ class ResultsTree : public QTreeView
{
Q_OBJECT
public:
ResultsTree(QSettings &settings, ApplicationList &list);
ResultsTree(QWidget * parent = 0);
virtual ~ResultsTree();
void Initialize(QSettings *settings, ApplicationList *list);
/**
* @brief Add a new item to the tree
@ -108,6 +109,17 @@ public:
*/
bool HasResults() const;
/**
* @brief Save all settings
* Colum widths
*/
void SaveSettings();
/**
* @brief Change all visible texts language
*
*/
void LanguageChanged();
protected slots:
/**
* @brief Slot to quickstart an error with default application
@ -253,11 +265,6 @@ protected:
*/
void LoadSettings();
/**
* @brief Save all settings
* Colum widths
*/
void SaveSettings();
/**
* @brief Create a new QStandardItem
@ -302,7 +309,7 @@ protected:
* @brief Program settings
*
*/
QSettings &mSettings;
QSettings *mSettings;
/**
* @brief List of bools to determine which of ShowTypes to display on the tree
@ -315,7 +322,7 @@ protected:
* @brief List of applications to open errors with
*
*/
ApplicationList &mApplications;
ApplicationList *mApplications;
/**
* @brief Right clicked item (used by context menu slots)

View File

@ -24,25 +24,25 @@
#include "txtreport.h"
#include "xmlreport.h"
ResultsView::ResultsView(QSettings &settings, ApplicationList &list) :
ResultsView::ResultsView(QWidget * parent) :
QWidget(parent),
mErrorsFound(false),
mShowNoErrorsMessage(true)
{
QVBoxLayout *layout = new QVBoxLayout();
setLayout(layout);
mProgress = new QProgressBar();
layout->addWidget(mProgress);
mProgress->setMinimum(0);
mProgress->setVisible(false);
mTree = new ResultsTree(settings, list);
layout->addWidget(mTree);
mShowNoErrorsMessage = settings.value(tr("Show no errors message"), true).toBool();
mUI.setupUi(this);
}
void ResultsView::Initialize(QSettings *settings, ApplicationList *list)
{
mUI.mProgress->setMinimum(0);
mUI.mProgress->setVisible(false);
mShowNoErrorsMessage = settings->value(SETTINGS_SHOW_NO_ERRORS, true).toBool();
mUI.mTree->Initialize(settings, list);
}
ResultsView::~ResultsView()
{
//dtor
@ -51,23 +51,23 @@ ResultsView::~ResultsView()
void ResultsView::Clear()
{
mTree->Clear();
mUI.mTree->Clear();
mErrorsFound = false;
//Clear the progressbar
mProgress->setMaximum(100);
mProgress->setValue(0);
mUI.mProgress->setMaximum(100);
mUI.mProgress->setValue(0);
}
void ResultsView::Progress(int value, int max)
{
mProgress->setMaximum(max);
mProgress->setValue(value);
mUI.mProgress->setMaximum(max);
mUI.mProgress->setValue(value);
if (value >= max)
{
mProgress->setVisible(false);
mUI.mProgress->setVisible(false);
//Should we inform user of non visible/not found errors?
if (mShowNoErrorsMessage)
{ //Tell user that we found no errors
@ -81,7 +81,7 @@ void ResultsView::Progress(int value, int max)
msg.exec();
} //If we have errors but they aren't visible, tell user about it
else if (!mTree->HasVisibleResults())
else if (!mUI.mTree->HasVisibleResults())
{
QString text = tr("Errors were found, but they are configured to be hidden.\n"\
"To toggle what kind of errors are shown, open view menu.");
@ -97,7 +97,7 @@ void ResultsView::Progress(int value, int max)
}
else
{
mProgress->setVisible(true);
mUI.mProgress->setVisible(true);
}
}
@ -109,23 +109,23 @@ void ResultsView::Error(const QString &file,
const QString &id)
{
mErrorsFound = true;
mTree->AddErrorItem(file, severity, message, files, lines, id);
mUI.mTree->AddErrorItem(file, severity, message, files, lines, id);
emit GotResults();
}
void ResultsView::ShowResults(ShowTypes type, bool show)
{
mTree->ShowResults(type, show);
mUI.mTree->ShowResults(type, show);
}
void ResultsView::CollapseAllResults()
{
mTree->collapseAll();
mUI.mTree->collapseAll();
}
void ResultsView::ExpandAllResults()
{
mTree->expandAll();
mUI.mTree->expandAll();
}
void ResultsView::Save(const QString &filename, bool xml)
@ -141,7 +141,7 @@ void ResultsView::Save(const QString &filename, bool xml)
{
XmlReport report(filename);
if (report.Create())
mTree->SaveResults(&report);
mUI.mTree->SaveResults(&report);
else
{
QMessageBox msgBox;
@ -153,7 +153,7 @@ void ResultsView::Save(const QString &filename, bool xml)
{
TxtReport report(filename);
if (report.Create())
mTree->SaveResults(&report);
mUI.mTree->SaveResults(&report);
else
{
QMessageBox msgBox;
@ -168,26 +168,32 @@ void ResultsView::UpdateSettings(bool showFullPath,
bool saveAllErrors,
bool showNoErrorsMessage)
{
mTree->UpdateSettings(showFullPath, saveFullPath, saveAllErrors);
mUI.mTree->UpdateSettings(showFullPath, saveFullPath, saveAllErrors);
mShowNoErrorsMessage = showNoErrorsMessage;
}
void ResultsView::SetCheckDirectory(const QString &dir)
{
mTree->SetCheckDirectory(dir);
mUI.mTree->SetCheckDirectory(dir);
}
void ResultsView::CheckingStarted()
{
mProgress->setVisible(true);
mUI.mProgress->setVisible(true);
}
bool ResultsView::HasVisibleResults() const
{
return mTree->HasVisibleResults();
return mUI.mTree->HasVisibleResults();
}
bool ResultsView::HasResults() const
{
return mTree->HasResults();
return mUI.mTree->HasResults();
}
void ResultsView::SaveSettings()
{
mUI.mTree->SaveSettings();
}

View File

@ -26,7 +26,7 @@
#include "../src/errorlogger.h"
#include "resultstree.h"
#include "common.h"
#include "ui_resultsview.h"
/**
* @brief Widget to show cppcheck progressbar and result
@ -37,7 +37,8 @@ class ResultsView : public QWidget
Q_OBJECT
public:
ResultsView(QSettings &settings, ApplicationList &list);
ResultsView(QWidget * parent = 0);
void Initialize(QSettings *settings, ApplicationList *list);
virtual ~ResultsView();
/**
@ -104,6 +105,11 @@ public:
*/
bool HasResults() const;
/**
* @brief Save View's settings
*
*/
void SaveSettings();
signals:
/**
@ -150,18 +156,6 @@ public slots:
void ExpandAllResults();
protected:
/**
* @brief Tree to show cppcheck's results
*
*/
ResultsTree *mTree;
/**
* @brief Progressbar to show cppcheck's progress
*
*/
QProgressBar *mProgress;
/**
* @brief Have any errors been found
*/
@ -172,6 +166,8 @@ protected:
*/
bool mShowNoErrorsMessage;
Ui::ResultsView mUI;
private:
};

63
gui/resultsview.ui Normal file
View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ResultsView</class>
<widget class="QWidget" name="ResultsView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>459</width>
<height>357</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Results</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QProgressBar" name="mProgress">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item>
<widget class="ResultsTree" name="mTree">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ResultsTree</class>
<extends>QTreeView</extends>
<header>resultstree.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -24,14 +24,17 @@
#include <QDebug>
#include <QTabWidget>
#include "applicationdialog.h"
#include "common.h"
SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list,
SettingsDialog::SettingsDialog(QSettings *programSettings,
ApplicationList *list,
QWidget *parent) :
QDialog(parent),
mSettings(programSettings),
mApplications(list)
mApplications(list),
mTempApplications(new ApplicationList(this))
{
mTempApplications.Copy(list);
mTempApplications->Copy(list);
//Create a layout for the settings dialog
QVBoxLayout *dialoglayout = new QVBoxLayout();
@ -69,7 +72,7 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
//Number of jobs
QHBoxLayout *jobsLayout = new QHBoxLayout();
mJobs = new QLineEdit(programSettings.value(tr("Check threads"), 1).toString());
mJobs = new QLineEdit(programSettings->value(SETTINGS_CHECK_THREADS, 1).toString());
mJobs->setValidator(new QIntValidator(1, 9999, this));
jobsLayout->addWidget(new QLabel(tr("Number of threads: ")));
@ -80,17 +83,17 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
//Force
mForce = AddCheckbox(layout,
tr("Check all #ifdef configurations"),
tr("Check force"),
SETTINGS_CHECK_FORCE,
false);
mShowFullPath = AddCheckbox(layout,
tr("Show full path of files"),
tr("Show full path"),
SETTINGS_SHOW_FULL_PATH,
false);
mShowNoErrorsMessage = AddCheckbox(layout,
tr("Show \"No errors found\" message when no errors found"),
tr("Show no errors message"),
SETTINGS_SHOW_NO_ERRORS,
true);
layout->addStretch();
@ -138,12 +141,12 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
QVBoxLayout *reportlayout = new QVBoxLayout();
mSaveAllErrors = AddCheckbox(reportlayout,
tr("Save all errors when creating report"),
tr("Save all errors"),
SETTINGS_SAVE_ALL_ERRORS,
false);
mSaveFullPath = AddCheckbox(reportlayout,
tr("Save full path to files in reports"),
tr("Save full path"),
SETTINGS_SAVE_FULL_PATH,
false);
reportlayout->addStretch();
report->setLayout(reportlayout);
@ -181,21 +184,21 @@ QCheckBox* SettingsDialog::AddCheckbox(QVBoxLayout *layout,
bool value)
{
QCheckBox *result = new QCheckBox(label);
result->setCheckState(BoolToCheckState(mSettings.value(settings, value).toBool()));
result->setCheckState(BoolToCheckState(mSettings->value(settings, value).toBool()));
layout->addWidget(result);
return result;
}
void SettingsDialog::LoadSettings()
{
resize(mSettings.value("Check dialog width", 800).toInt(),
mSettings.value("Check dialog height", 600).toInt());
resize(mSettings->value(SETTINGS_CHECK_DIALOG_WIDTH, 800).toInt(),
mSettings->value(SETTINGS_CHECK_DIALOG_HEIGHT, 600).toInt());
}
void SettingsDialog::SaveSettings()
{
mSettings.setValue("Check dialog width", size().width());
mSettings.setValue("Check dialog height", size().height());
mSettings->setValue(SETTINGS_CHECK_DIALOG_WIDTH, size().width());
mSettings->setValue(SETTINGS_CHECK_DIALOG_HEIGHT, size().height());
}
void SettingsDialog::SaveCheckboxValues()
@ -206,17 +209,17 @@ void SettingsDialog::SaveCheckboxValues()
jobs = 1;
}
mSettings.setValue("Check threads", jobs);
SaveCheckboxValue(mForce, "Check force");
SaveCheckboxValue(mSaveAllErrors, "Save all errors");
SaveCheckboxValue(mSaveFullPath, "Save full path");
SaveCheckboxValue(mShowFullPath, "Show full path");
SaveCheckboxValue(mShowNoErrorsMessage, "Show no errors message");
mSettings->setValue(SETTINGS_CHECK_THREADS, jobs);
SaveCheckboxValue(mForce, SETTINGS_CHECK_FORCE);
SaveCheckboxValue(mSaveAllErrors, SETTINGS_SAVE_ALL_ERRORS);
SaveCheckboxValue(mSaveFullPath, SETTINGS_SAVE_FULL_PATH);
SaveCheckboxValue(mShowFullPath, SETTINGS_SHOW_FULL_PATH);
SaveCheckboxValue(mShowNoErrorsMessage, SETTINGS_SHOW_NO_ERRORS);
}
void SettingsDialog::SaveCheckboxValue(QCheckBox *box, const QString &name)
{
mSettings.setValue(name, CheckStateToBool(box->checkState()));
mSettings->setValue(name, CheckStateToBool(box->checkState()));
}
void SettingsDialog::AddApplication()
@ -225,7 +228,7 @@ void SettingsDialog::AddApplication()
if (dialog.exec() == QDialog::Accepted)
{
mTempApplications.AddApplicationType(dialog.GetName(), dialog.GetPath());
mTempApplications->AddApplicationType(dialog.GetName(), dialog.GetPath());
mListWidget->addItem(dialog.GetName());
}
}
@ -238,7 +241,7 @@ void SettingsDialog::DeleteApplication()
foreach(item, selected)
{
mTempApplications.RemoveApplication(mListWidget->row(item));
mTempApplications->RemoveApplication(mListWidget->row(item));
mListWidget->clear();
PopulateListWidget();
}
@ -252,13 +255,13 @@ void SettingsDialog::ModifyApplication()
{
int row = mListWidget->row(item);
ApplicationDialog dialog(mTempApplications.GetApplicationName(row),
mTempApplications.GetApplicationPath(row),
ApplicationDialog dialog(mTempApplications->GetApplicationName(row),
mTempApplications->GetApplicationPath(row),
tr("Modify an application"));
if (dialog.exec() == QDialog::Accepted)
{
mTempApplications.SetApplicationType(row, dialog.GetName(), dialog.GetPath());
mTempApplications->SetApplicationType(row, dialog.GetName(), dialog.GetPath());
item->setText(dialog.GetName());
}
}
@ -270,7 +273,7 @@ void SettingsDialog::DefaultApplication()
if (selected.size() > 0)
{
int index = mListWidget->row(selected[0]);
mTempApplications.MoveFirst(index);
mTempApplications->MoveFirst(index);
mListWidget->clear();
PopulateListWidget();
}
@ -278,13 +281,13 @@ void SettingsDialog::DefaultApplication()
void SettingsDialog::PopulateListWidget()
{
for (int i = 0; i < mTempApplications.GetApplicationCount(); i++)
for (int i = 0; i < mTempApplications->GetApplicationCount(); i++)
{
mListWidget->addItem(mTempApplications.GetApplicationName(i));
mListWidget->addItem(mTempApplications->GetApplicationName(i));
}
// If list contains items select first item
if (mTempApplications.GetApplicationCount())
if (mTempApplications->GetApplicationCount())
{
mListWidget->setCurrentRow(0);
}
@ -292,7 +295,7 @@ void SettingsDialog::PopulateListWidget()
void SettingsDialog::Ok()
{
mApplications.Copy(mTempApplications);
mApplications->Copy(mTempApplications);
accept();
}

View File

@ -41,7 +41,9 @@ class SettingsDialog : public QDialog
{
Q_OBJECT
public:
SettingsDialog(QSettings &programSettings, ApplicationList &list, QWidget *parent = 0);
SettingsDialog(QSettings *programSettings,
ApplicationList *list,
QWidget *parent = 0);
virtual ~SettingsDialog();
/**
@ -216,20 +218,20 @@ protected:
* @brief Settings
*
*/
QSettings &mSettings;
QSettings *mSettings;
/**
* @brief List of applications user has specified
*
*/
ApplicationList &mApplications;
ApplicationList *mApplications;
/**
* @brief Temporary list of applications
* This will be copied to actual list of applications (mApplications)
* when user clicks ok.
*/
ApplicationList mTempApplications;
ApplicationList *mTempApplications;
private:
};

View File

@ -158,11 +158,11 @@ void ThreadHandler::Initialize(ResultsView *view)
void ThreadHandler::LoadSettings(QSettings &settings)
{
SetThreadCount(settings.value("Check threads", 1).toInt());
SetThreadCount(settings.value(SETTINGS_CHECK_THREADS, 1).toInt());
}
void ThreadHandler::SaveSettings(QSettings &settings)
{
settings.setValue("Check threads", mThreads.size());
settings.setValue(SETTINGS_CHECK_THREADS, mThreads.size());
}

View File

@ -0,0 +1,93 @@
#include "translationhandler.h"
#include <QApplication>
#include <QDebug>
TranslationHandler::TranslationHandler(QObject *parent) :
QObject(parent),
mCurrentLanguage(-1),
mTranslator(new QTranslator(this))
{
//Add our default languages
mNames << QObject::tr("English")
<< QObject::tr("Finnish")
<< QObject::tr("Swedish")
<< QObject::tr("German")
<< QObject::tr("Russian");
mFiles << "cppcheck_en"
<< "cppcheck_fi"
<< "cppcheck_se"
<< "cppcheck_de"
<< "cppcheck_ru";
//Load english as a fallback language
QTranslator *english = new QTranslator();
if (english->load("cppcheck_en"))
{
qApp->installTranslator(english);
}
else
{
qDebug() << "Failed to load english translation!";
delete english;
}
}
TranslationHandler::~TranslationHandler()
{
}
const QStringList TranslationHandler::GetNames()
{
return mNames;
}
const QStringList TranslationHandler::GetFiles()
{
return mFiles;
}
bool TranslationHandler::SetLanguage(const int index, QString &error)
{
//If english is the language
if (index == 0)
{
//Just remove all extra translators
if (mTranslator)
{
qApp->removeTranslator(mTranslator);
}
mCurrentLanguage = index;
return true;
}
//Make sure the translator is otherwise valid
if (index >= mNames.size())
{
error = QObject::tr("Incorrect language specified!");
return false;
}
//Load the new language
if (!mTranslator->load(mFiles[index]))
{
error = QObject::tr("Failed to load language from file %1");
error = error.arg(mFiles[index]);
return false;
}
qApp->installTranslator(mTranslator);
mCurrentLanguage = index;
return true;
}
int TranslationHandler::GetCurrentLanguage() const
{
return mCurrentLanguage;
}

26
gui/translationhandler.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef TRANSLATIONHANDLER_H
#define TRANSLATIONHANDLER_H
#include <QStringList>
#include <QTranslator>
#include <QObject>
class TranslationHandler : QObject
{
Q_OBJECT
public:
TranslationHandler(QObject *parent);
virtual ~TranslationHandler();
const QStringList GetNames();
const QStringList GetFiles();
bool SetLanguage(const int index, QString &error);
int GetCurrentLanguage() const;
protected:
int mCurrentLanguage;
QStringList mNames;
QStringList mFiles;
QTranslator *mTranslator;
private:
};
#endif // TRANSLATIONHANDLER_H