From 8b2a0585391e750b7f6e8797a03680dccadcd23c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 7 Feb 2013 18:00:14 +0100 Subject: [PATCH 1/2] "Hide all with id" popup menu item added Give the user a chance to quickly hide all errors of specific type he is not interested in. --- gui/resultstree.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++- gui/resultstree.h | 6 ++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 72645f70c..6f03f07ca 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -534,12 +534,14 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) QAction *copymessage = new QAction(tr("Copy message"), &menu); QAction *copymessageid = new QAction(tr("Copy message id"), &menu); QAction *hide = new QAction(tr("Hide"), &menu); - + QAction *hideallid = new QAction(tr("Hide all with id"), &menu); + if (multipleSelection) { copyfilename->setDisabled(true); copypath->setDisabled(true); copymessage->setDisabled(true); copymessageid->setDisabled(true); + hideallid->setDisabled(true); } menu.addAction(copyfilename); @@ -547,12 +549,14 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) menu.addAction(copymessage); menu.addAction(copymessageid); menu.addAction(hide); + menu.addAction(hideallid); connect(copyfilename, SIGNAL(triggered()), this, SLOT(CopyFilename())); connect(copypath, SIGNAL(triggered()), this, SLOT(CopyFullPath())); connect(copymessage, SIGNAL(triggered()), this, SLOT(CopyMessage())); connect(copymessageid, SIGNAL(triggered()), this, SLOT(CopyMessageId())); connect(hide, SIGNAL(triggered()), this, SLOT(HideResult())); + connect(hideallid, SIGNAL(triggered()), this, SLOT(HideAllIdResult())); } //Start the menu @@ -762,6 +766,48 @@ void ResultsTree::HideResult() } } +void ResultsTree::HideAllIdResult() +{ + if (mContextItem) { + // Make sure we are working with the first column + if (mContextItem->column() != 0) + mContextItem = mContextItem->parent()->child(mContextItem->row(), 0); + QVariantMap data = mContextItem->data().toMap(); + + QString messageId = data["id"].toString(); + + // hide all errors with that message Id + int filecount = mModel.rowCount(); + for (int i = 0; i < filecount; i++) { + //Get file i + QStandardItem *file = mModel.item(i, 0); + if (!file) { + continue; + } + + //Get the amount of errors this file contains + int errorcount = file->rowCount(); + + for (int j = 0; j < errorcount; j++) { + //Get the error itself + QStandardItem *child = file->child(j, 0); + if (!child) { + continue; + } + + QVariantMap userdata = child->data().toMap(); + if (userdata["id"].toString() == messageId) { + userdata["hide"] = true; + child->setData(QVariant(userdata)); + } + } + } + + RefreshTree(); + emit ResultsHidden(true); + } +} + void ResultsTree::Context(int application) { StartApplication(mContextItem, application); diff --git a/gui/resultstree.h b/gui/resultstree.h index a22686736..fb80b038c 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -217,6 +217,12 @@ protected slots: */ void HideResult(); + /** + * @brief Slot for context menu item to hide all messages with the current message Id + * + */ + void HideAllIdResult(); + /** * @brief Slot for selection change in the results tree. * From 90c0a6408feb40ad0dacb8e3a67344cbb28e958d Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 8 Feb 2013 08:26:24 +0100 Subject: [PATCH 2/2] Translations updated --- gui/cppcheck_de.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_es.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_fi.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_fr.ts | 4 ++++ gui/cppcheck_it.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_ja.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_ko.ts | 4 ++++ gui/cppcheck_nl.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_ru.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_sr.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_sv.ts | 33 +++++++++++++++++++-------------- gui/cppcheck_zh_CN.ts | 33 +++++++++++++++++++-------------- 12 files changed, 198 insertions(+), 140 deletions(-) diff --git a/gui/cppcheck_de.ts b/gui/cppcheck_de.ts index ead626881..aff1a007b 100644 --- a/gui/cppcheck_de.ts +++ b/gui/cppcheck_de.ts @@ -981,22 +981,22 @@ Möchten Sie die Datei von der Liste der zuletzt benutzten Projekte entfernen? ResultsTree - + File Datei - + Severity Schweregrad - + Line Zeile - + Summary Zusammenfassung @@ -1007,7 +1007,7 @@ Möchten Sie die Datei von der Liste der zuletzt benutzten Projekte entfernen? - + [Inconclusive] [unklar] @@ -1042,13 +1042,18 @@ Möchten Sie die Datei von der Liste der zuletzt benutzten Projekte entfernen?Verstecken - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1057,7 +1062,7 @@ Configure the editor application for Cppcheck in preferences/Applications. - + No default editor application selected. Please select the default editor application in preferences/Applications. @@ -1066,12 +1071,12 @@ Please select the default editor application in preferences/Applications. - + Could not find the file! Datei konnte nicht gefunden werden! - + Could not start %1 Please check the application path and parameters are correct. @@ -1080,7 +1085,7 @@ Please check the application path and parameters are correct. Bitte überprüfen Sie ob der Pfad und die Parameter der Anwendung richtig eingestellt sind. - + Could not find file: %1 Please select the directory where file is located. @@ -1089,12 +1094,12 @@ Please select the directory where file is located. Bitte wählen Sie das Verzeichnis, in dem sich die Datei befindet. - + Select Directory Wähle Verzeichnis - + Id Id diff --git a/gui/cppcheck_es.ts b/gui/cppcheck_es.ts index a5219bec9..1eece1f70 100644 --- a/gui/cppcheck_es.ts +++ b/gui/cppcheck_es.ts @@ -952,22 +952,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File Fichero - + Severity Importancia - + Line Línea - + Summary Resumen @@ -978,7 +978,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1023,13 +1023,18 @@ Do you want to remove the file from the recently used projects -list? Oculta - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1037,19 +1042,19 @@ Configure the editor application for Cppcheck in preferences/Applications.Configura el programa para ver ficheros en Cppcheck preferencias/Aplicaciones. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! ¡No se ha encontrado el fichero! - + Could not start %1 Please check the application path and parameters are correct. @@ -1058,7 +1063,7 @@ Please check the application path and parameters are correct. Por favor comprueba que la ruta a la aplicación y los parámetros son correctos. - + Could not find file: %1 Please select the directory where file is located. @@ -1067,12 +1072,12 @@ Please select the directory where file is located. Por favor selecciona la carpeta donde se encuentra. - + Select Directory Selecciona carpeta - + Id diff --git a/gui/cppcheck_fi.ts b/gui/cppcheck_fi.ts index 53e1d5077..217487e60 100644 --- a/gui/cppcheck_fi.ts +++ b/gui/cppcheck_fi.ts @@ -957,22 +957,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File Tiedosto - + Severity Tyyppi - + Line Rivi - + Summary @@ -983,7 +983,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1018,13 +1018,18 @@ Do you want to remove the file from the recently used projects -list? - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1032,19 +1037,19 @@ Configure the editor application for Cppcheck in preferences/Applications.Voit asetuksista määritellä muita ohjelmia joilla avata tämän virheen sisältävän tiedoston. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! - + Could not start %1 Please check the application path and parameters are correct. @@ -1053,19 +1058,19 @@ Please check the application path and parameters are correct. Tarkista että ohjelman polku ja parametrit ovat oikeat. - + Could not find file: %1 Please select the directory where file is located. - + Select Directory - + Id diff --git a/gui/cppcheck_fr.ts b/gui/cppcheck_fr.ts index 94b21a93d..055253385 100644 --- a/gui/cppcheck_fr.ts +++ b/gui/cppcheck_fr.ts @@ -863,6 +863,10 @@ Please select the default editor application in preferences/Applications.Copy message id + + Hide all with id + + ResultsView diff --git a/gui/cppcheck_it.ts b/gui/cppcheck_it.ts index 7cf13c2ad..d83c56423 100644 --- a/gui/cppcheck_it.ts +++ b/gui/cppcheck_it.ts @@ -982,22 +982,22 @@ Vuoi rimuovere il file dalla lista dei progetti recentemente usati? ResultsTree - + File File - + Severity Severità - + Line Linea - + Summary Riassunto @@ -1008,7 +1008,7 @@ Vuoi rimuovere il file dalla lista dei progetti recentemente usati? - + [Inconclusive] [Inconcludente] @@ -1043,13 +1043,18 @@ Vuoi rimuovere il file dalla lista dei progetti recentemente usati?Nascondi - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1058,7 +1063,7 @@ Configure the editor application for Cppcheck in preferences/Applications. - + No default editor application selected. Please select the default editor application in preferences/Applications. @@ -1067,12 +1072,12 @@ Please select the default editor application in preferences/Applications. - + Could not find the file! Non è stato possibile trovare il file! - + Could not start %1 Please check the application path and parameters are correct. @@ -1081,7 +1086,7 @@ Please check the application path and parameters are correct. Per favore verifica che il percorso dell'applicazione e i parametri siano corretti. - + Could not find file: %1 Please select the directory where file is located. @@ -1090,12 +1095,12 @@ Please select the directory where file is located. Per favore selezioa la cartella dove il file è posizionato. - + Select Directory Seleziona Cartella - + Id Id diff --git a/gui/cppcheck_ja.ts b/gui/cppcheck_ja.ts index 269b2391e..8c860a345 100644 --- a/gui/cppcheck_ja.ts +++ b/gui/cppcheck_ja.ts @@ -954,22 +954,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File ファイル - + Severity 警告種別 - + Line - + Summary 内容 @@ -980,7 +980,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] [結論の出ない] @@ -1015,13 +1015,18 @@ Do you want to remove the file from the recently used projects -list? 非表示 - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1029,19 +1034,19 @@ Configure the editor application for Cppcheck in preferences/Applications.メニューの「編集」→「設定」からテキストファイルを表示するアプリケーションを設定してください。 - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! ファイルが見つかりません - + Could not start %1 Please check the application path and parameters are correct. @@ -1050,7 +1055,7 @@ Please check the application path and parameters are correct. 実行ファイルパスや引数の設定を確認してください。 - + Could not find file: %1 Please select the directory where file is located. @@ -1059,12 +1064,12 @@ Please select the directory where file is located. ディレクトリにファイルが存在するか確認してください。 - + Select Directory ディレクトリを選択 - + Id diff --git a/gui/cppcheck_ko.ts b/gui/cppcheck_ko.ts index 9acb065e4..4f4799cc0 100644 --- a/gui/cppcheck_ko.ts +++ b/gui/cppcheck_ko.ts @@ -901,6 +901,10 @@ Please select the directory where file is located. Copy message id + + Hide all with id + + ResultsView diff --git a/gui/cppcheck_nl.ts b/gui/cppcheck_nl.ts index 7e26cdcf3..0922acf6d 100644 --- a/gui/cppcheck_nl.ts +++ b/gui/cppcheck_nl.ts @@ -957,22 +957,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File Bestand - + Severity Ernst - + Line Regel - + Summary @@ -983,7 +983,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1018,13 +1018,18 @@ Do you want to remove the file from the recently used projects -list? - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1032,19 +1037,19 @@ Configure the editor application for Cppcheck in preferences/Applications.U dient een applicatie te configureren in de instellingen om deze fout in te openen. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! - + Could not start %1 Please check the application path and parameters are correct. @@ -1053,19 +1058,19 @@ Please check the application path and parameters are correct. Gelieve te controleren of de het pad en de parameters correct zijn. - + Could not find file: %1 Please select the directory where file is located. - + Select Directory - + Id diff --git a/gui/cppcheck_ru.ts b/gui/cppcheck_ru.ts index f34ce6354..9856c16e5 100644 --- a/gui/cppcheck_ru.ts +++ b/gui/cppcheck_ru.ts @@ -984,22 +984,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File Файл - + Severity Важность - + Line Строка - + Summary Кратко @@ -1010,7 +1010,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1045,13 +1045,18 @@ Do you want to remove the file from the recently used projects -list? Скрыть - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1059,38 +1064,38 @@ Configure the editor application for Cppcheck in preferences/Applications. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! Не удается найти файл! - + Could not start %1 Please check the application path and parameters are correct. - + Could not find file: %1 Please select the directory where file is located. - + Select Directory Выберите директорию - + Id Id diff --git a/gui/cppcheck_sr.ts b/gui/cppcheck_sr.ts index 32e269d6d..d9e946672 100644 --- a/gui/cppcheck_sr.ts +++ b/gui/cppcheck_sr.ts @@ -951,22 +951,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File File - + Severity Severity - + Line Line - + Summary @@ -977,7 +977,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1012,32 +1012,37 @@ Do you want to remove the file from the recently used projects -list? - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. You can open this error by specifying applications in program's settings. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! - + Could not start %1 Please check the application path and parameters are correct. @@ -1046,19 +1051,19 @@ Please check the application path and parameters are correct. Please check the application path and parameters are correct. - + Could not find file: %1 Please select the directory where file is located. - + Select Directory - + Id diff --git a/gui/cppcheck_sv.ts b/gui/cppcheck_sv.ts index 53ec4bf4d..b6ed2bc41 100644 --- a/gui/cppcheck_sv.ts +++ b/gui/cppcheck_sv.ts @@ -980,22 +980,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File Fil - + Severity Typ - + Line Rad - + Summary Sammanfattning @@ -1006,7 +1006,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] @@ -1041,13 +1041,18 @@ Do you want to remove the file from the recently used projects -list? Dölj - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1055,19 +1060,19 @@ Configure the editor application for Cppcheck in preferences/Applications.Konfigurera program i inställningar/program. - + No default editor application selected. Please select the default editor application in preferences/Applications. - + Could not find the file! Kunde inte hitta filen! - + Could not start %1 Please check the application path and parameters are correct. @@ -1076,7 +1081,7 @@ Please check the application path and parameters are correct. Kontrollera att sökvägen och parametrarna är korrekta. - + Could not find file: %1 Please select the directory where file is located. @@ -1085,12 +1090,12 @@ Please select the directory where file is located. Välj mappen där filen finns. - + Select Directory Välj mapp - + Id diff --git a/gui/cppcheck_zh_CN.ts b/gui/cppcheck_zh_CN.ts index ca8d90a5d..4d125bed4 100644 --- a/gui/cppcheck_zh_CN.ts +++ b/gui/cppcheck_zh_CN.ts @@ -982,22 +982,22 @@ Do you want to remove the file from the recently used projects -list? ResultsTree - + File 文件 - + Severity 严重性 - + Line - + Summary 概要 @@ -1008,7 +1008,7 @@ Do you want to remove the file from the recently used projects -list? - + [Inconclusive] [不确定的] @@ -1043,13 +1043,18 @@ Do you want to remove the file from the recently used projects -list? 隐藏 - - + + Hide all with id + + + + + Cppcheck Cppcheck - + No editor application configured. Configure the editor application for Cppcheck in preferences/Applications. @@ -1059,7 +1064,7 @@ Configure the editor application for Cppcheck in preferences/Applications. - + No default editor application selected. Please select the default editor application in preferences/Applications. @@ -1068,12 +1073,12 @@ Please select the default editor application in preferences/Applications. - + Could not find the file! 找不到文件! - + Could not start %1 Please check the application path and parameters are correct. @@ -1082,7 +1087,7 @@ Please check the application path and parameters are correct. 请检查此应用程序的路径与参数是否正确。 - + Could not find file: %1 Please select the directory where file is located. @@ -1091,12 +1096,12 @@ Please select the directory where file is located. 请选择文件所在目录。 - + Select Directory 选择目录 - + Id Id