Browse Source

Removed error report via statusbar, added error reporting via message box.

tastytea 3 months ago
parent
commit
540877fb75
Signed by: tastytea <tastytea@tastytea.de> GPG Key ID: CFC39497F1B26E07

+ 1
- 1
CMakeLists.txt View File

1
 cmake_minimum_required (VERSION 3.2)
1
 cmake_minimum_required (VERSION 3.2)
2
 project (whyblocked
2
 project (whyblocked
3
-         VERSION 0.12.1
3
+         VERSION 0.12.2
4
          LANGUAGES CXX
4
          LANGUAGES CXX
5
 )
5
 )
6
 
6
 

+ 3
- 3
packages.CMakeLists.txt View File

1
 # Packages
1
 # Packages
2
 set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
2
 set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
3
-set(CPACK_PACKAGE_VERSION_MAJOR ${mastodon-cpp_VERSION_MAJOR})
4
-set(CPACK_PACKAGE_VERSION_MINOR ${mastodon-cpp_VERSION_MINOR})
5
-set(CPACK_PACKAGE_VERSION_PATCH ${mastodon-cpp_VERSION_PATCH})
3
+set(CPACK_PACKAGE_VERSION_MAJOR ${${CMAKE_PROJECT_NAME}_VERSION_MAJOR})
4
+set(CPACK_PACKAGE_VERSION_MINOR ${${CMAKE_PROJECT_NAME}_VERSION_MINOR})
5
+set(CPACK_PACKAGE_VERSION_PATCH ${${CMAKE_PROJECT_NAME}_VERSION_PATCH})
6
 set(CPACK_PACKAGE_VERSION ${whyblocked_VERSION})
6
 set(CPACK_PACKAGE_VERSION ${whyblocked_VERSION})
7
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Whyblocked reminds you why you blocked someone.")
7
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Whyblocked reminds you why you blocked someone.")
8
 set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")
8
 set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")

+ 4
- 10
src/interface_qt.cpp View File

17
 #include <regex>
17
 #include <regex>
18
 #include <array>
18
 #include <array>
19
 #include <QMessageBox>
19
 #include <QMessageBox>
20
-#include <QDebug>
21
-#include <iostream>
22
 #include <QTranslator>
20
 #include <QTranslator>
23
 #include <QLibraryInfo>
21
 #include <QLibraryInfo>
24
 #include <QtCore/qmimedata.h>
22
 #include <QtCore/qmimedata.h>
89
     }
87
     }
90
 
88
 
91
     populate_tableview();
89
     populate_tableview();
90
+    statusBar()->showMessage(tr("Try dragging an account from your webbrowser "
91
+                                "into this window."));
92
 }
92
 }
93
 
93
 
94
 MainWindow::~MainWindow()
94
 MainWindow::~MainWindow()
171
                     QString::fromStdString(std::get<2>(line)));
171
                     QString::fromStdString(std::get<2>(line)));
172
         }
172
         }
173
     }
173
     }
174
-
175
-    statusBar()->showMessage(tr("Database loaded."));
176
 }
174
 }
177
 
175
 
178
 void MainWindow::add_row(const QString &user, const int &blocked,
176
 void MainWindow::add_row(const QString &user, const int &blocked,
240
         {
238
         {
241
             const string user = row.data().toString().toStdString();
239
             const string user = row.data().toString().toStdString();
242
             database::remove(user);
240
             database::remove(user);
243
-            statusBar()->showMessage(tr("Removed %1 from database.")
244
-                                     .arg(QString::fromStdString(user)));
245
             _model->removeRow(row.row());
241
             _model->removeRow(row.row());
246
         }
242
         }
247
         label_receipts->clear();
243
         label_receipts->clear();
248
     }
244
     }
249
     else
245
     else
250
     {
246
     {
251
-        statusBar()->showMessage(tr("Select data to remove."));
247
+        QMessageBox::warning(this, tr("Nothing selected"),
248
+                             tr("Please select entries to remove."));
252
     }
249
     }
253
 }
250
 }
254
 
251
 
410
         database::add_receipt(data.user, receipt);
407
         database::add_receipt(data.user, receipt);
411
     }
408
     }
412
 
409
 
413
-    _parent->statusBar()->showMessage(tr("Added %1 to database.")
414
-                                      .arg(QString::fromStdString(data.user)));
415
-
416
     delete this;
410
     delete this;
417
 }
411
 }
418
 
412
 

+ 3
- 0
src/whyblocked_add.ui View File

167
      </item>
167
      </item>
168
      <item row="4" column="1" rowspan="3">
168
      <item row="4" column="1" rowspan="3">
169
       <widget class="QListWidget" name="list_receipts">
169
       <widget class="QListWidget" name="list_receipts">
170
+       <property name="toolTip">
171
+        <string>You can drag URLs in here</string>
172
+       </property>
170
        <property name="editTriggers">
173
        <property name="editTriggers">
171
         <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
174
         <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
172
        </property>
175
        </property>

+ 23
- 23
translations/whyblocked_de.ts View File

69
         <translation></translation>
69
         <translation></translation>
70
     </message>
70
     </message>
71
     <message>
71
     <message>
72
-        <location filename="../src/interface_qt.cpp" line="378"/>
73
-        <source>Insert receipt here.</source>
74
-        <translation>Beleg hier einfügen.</translation>
72
+        <location filename="../src/whyblocked_add.ui" line="171"/>
73
+        <source>You can drag URLs in here</source>
74
+        <translation type="unfinished">Du kannst URLs hier hineinziehen</translation>
75
     </message>
75
     </message>
76
     <message>
76
     <message>
77
-        <location filename="../src/interface_qt.cpp" line="413"/>
78
-        <source>Added %1 to database.</source>
79
-        <translation>%1 zur Datenbank hinzugefügt.</translation>
77
+        <location filename="../src/interface_qt.cpp" line="375"/>
78
+        <source>Insert receipt here.</source>
79
+        <translation>Beleg hier einfügen.</translation>
80
     </message>
80
     </message>
81
 </context>
81
 </context>
82
 <context>
82
 <context>
188
     </message>
188
     </message>
189
     <message>
189
     <message>
190
         <location filename="../src/whyblocked.ui" line="229"/>
190
         <location filename="../src/whyblocked.ui" line="229"/>
191
-        <location filename="../src/interface_qt.cpp" line="211"/>
191
+        <location filename="../src/interface_qt.cpp" line="209"/>
192
         <source>Edit entry</source>
192
         <source>Edit entry</source>
193
         <translation>Eintrag bearbeiten</translation>
193
         <translation>Eintrag bearbeiten</translation>
194
     </message>
194
     </message>
208
         <translation>Begründung</translation>
208
         <translation>Begründung</translation>
209
     </message>
209
     </message>
210
     <message>
210
     <message>
211
-        <location filename="../src/interface_qt.cpp" line="175"/>
212
-        <source>Database loaded.</source>
213
-        <translation>Datenbank geladen.</translation>
211
+        <location filename="../src/interface_qt.cpp" line="90"/>
212
+        <source>Try dragging an account from your webbrowser into this window.</source>
213
+        <translation>Versuche, einen account von deinem webbrowser in dieses fenster zu ziehen.</translation>
214
     </message>
214
     </message>
215
     <message>
215
     <message>
216
-        <location filename="../src/interface_qt.cpp" line="185"/>
216
+        <location filename="../src/interface_qt.cpp" line="183"/>
217
         <source>blocked</source>
217
         <source>blocked</source>
218
         <translation>blockiert</translation>
218
         <translation>blockiert</translation>
219
     </message>
219
     </message>
220
     <message>
220
     <message>
221
-        <location filename="../src/interface_qt.cpp" line="189"/>
221
+        <location filename="../src/interface_qt.cpp" line="187"/>
222
         <source>silenced</source>
222
         <source>silenced</source>
223
         <translation>gedämpft</translation>
223
         <translation>gedämpft</translation>
224
     </message>
224
     </message>
225
     <message>
225
     <message>
226
-        <location filename="../src/interface_qt.cpp" line="205"/>
226
+        <location filename="../src/interface_qt.cpp" line="203"/>
227
         <source>Invalid selection</source>
227
         <source>Invalid selection</source>
228
         <translation>Ungültige Auswahl</translation>
228
         <translation>Ungültige Auswahl</translation>
229
     </message>
229
     </message>
230
     <message>
230
     <message>
231
-        <location filename="../src/interface_qt.cpp" line="206"/>
231
+        <location filename="../src/interface_qt.cpp" line="204"/>
232
         <source>Please select only 1 entry to edit.</source>
232
         <source>Please select only 1 entry to edit.</source>
233
         <translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
233
         <translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
234
     </message>
234
     </message>
235
     <message>
235
     <message>
236
-        <location filename="../src/interface_qt.cpp" line="243"/>
237
-        <source>Removed %1 from database.</source>
238
-        <translation>%1 aus der Datenbank gelöscht.</translation>
236
+        <location filename="../src/interface_qt.cpp" line="247"/>
237
+        <source>Nothing selected</source>
238
+        <translation>Nichts ausgewählt</translation>
239
     </message>
239
     </message>
240
     <message>
240
     <message>
241
-        <location filename="../src/interface_qt.cpp" line="251"/>
242
-        <source>Select data to remove.</source>
243
-        <translation>Wähle Daten zum löschen aus.</translation>
241
+        <location filename="../src/interface_qt.cpp" line="248"/>
242
+        <source>Please select entries to remove.</source>
243
+        <translation>Bitte wähle einträge aus, die gelöscht werden sollen.</translation>
244
     </message>
244
     </message>
245
     <message>
245
     <message>
246
-        <location filename="../src/interface_qt.cpp" line="257"/>
246
+        <location filename="../src/interface_qt.cpp" line="254"/>
247
         <source>About Whyblocked</source>
247
         <source>About Whyblocked</source>
248
         <translation>Über Whyblocked</translation>
248
         <translation>Über Whyblocked</translation>
249
     </message>
249
     </message>
250
     <message>
250
     <message>
251
-        <location filename="../src/interface_qt.cpp" line="258"/>
251
+        <location filename="../src/interface_qt.cpp" line="255"/>
252
         <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
252
         <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
253
         <translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation>
253
         <translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation>
254
     </message>
254
     </message>
255
     <message>
255
     <message>
256
-        <location filename="../src/interface_qt.cpp" line="281"/>
256
+        <location filename="../src/interface_qt.cpp" line="278"/>
257
         <source>Receipts:</source>
257
         <source>Receipts:</source>
258
         <translation>Belege:</translation>
258
         <translation>Belege:</translation>
259
     </message>
259
     </message>

+ 18
- 18
translations/whyblocked_en.ts View File

69
         <translation type="unfinished"></translation>
69
         <translation type="unfinished"></translation>
70
     </message>
70
     </message>
71
     <message>
71
     <message>
72
-        <location filename="../src/interface_qt.cpp" line="378"/>
73
-        <source>Insert receipt here.</source>
72
+        <location filename="../src/whyblocked_add.ui" line="171"/>
73
+        <source>You can drag URLs in here</source>
74
         <translation type="unfinished"></translation>
74
         <translation type="unfinished"></translation>
75
     </message>
75
     </message>
76
     <message>
76
     <message>
77
-        <location filename="../src/interface_qt.cpp" line="413"/>
78
-        <source>Added %1 to database.</source>
77
+        <location filename="../src/interface_qt.cpp" line="375"/>
78
+        <source>Insert receipt here.</source>
79
         <translation type="unfinished"></translation>
79
         <translation type="unfinished"></translation>
80
     </message>
80
     </message>
81
 </context>
81
 </context>
188
     </message>
188
     </message>
189
     <message>
189
     <message>
190
         <location filename="../src/whyblocked.ui" line="229"/>
190
         <location filename="../src/whyblocked.ui" line="229"/>
191
-        <location filename="../src/interface_qt.cpp" line="211"/>
191
+        <location filename="../src/interface_qt.cpp" line="209"/>
192
         <source>Edit entry</source>
192
         <source>Edit entry</source>
193
         <translation type="unfinished"></translation>
193
         <translation type="unfinished"></translation>
194
     </message>
194
     </message>
208
         <translation type="unfinished"></translation>
208
         <translation type="unfinished"></translation>
209
     </message>
209
     </message>
210
     <message>
210
     <message>
211
-        <location filename="../src/interface_qt.cpp" line="175"/>
212
-        <source>Database loaded.</source>
211
+        <location filename="../src/interface_qt.cpp" line="90"/>
212
+        <source>Try dragging an account from your webbrowser into this window.</source>
213
         <translation type="unfinished"></translation>
213
         <translation type="unfinished"></translation>
214
     </message>
214
     </message>
215
     <message>
215
     <message>
216
-        <location filename="../src/interface_qt.cpp" line="185"/>
216
+        <location filename="../src/interface_qt.cpp" line="183"/>
217
         <source>blocked</source>
217
         <source>blocked</source>
218
         <translation type="unfinished"></translation>
218
         <translation type="unfinished"></translation>
219
     </message>
219
     </message>
220
     <message>
220
     <message>
221
-        <location filename="../src/interface_qt.cpp" line="189"/>
221
+        <location filename="../src/interface_qt.cpp" line="187"/>
222
         <source>silenced</source>
222
         <source>silenced</source>
223
         <translation type="unfinished"></translation>
223
         <translation type="unfinished"></translation>
224
     </message>
224
     </message>
225
     <message>
225
     <message>
226
-        <location filename="../src/interface_qt.cpp" line="205"/>
226
+        <location filename="../src/interface_qt.cpp" line="203"/>
227
         <source>Invalid selection</source>
227
         <source>Invalid selection</source>
228
         <translation type="unfinished"></translation>
228
         <translation type="unfinished"></translation>
229
     </message>
229
     </message>
230
     <message>
230
     <message>
231
-        <location filename="../src/interface_qt.cpp" line="206"/>
231
+        <location filename="../src/interface_qt.cpp" line="204"/>
232
         <source>Please select only 1 entry to edit.</source>
232
         <source>Please select only 1 entry to edit.</source>
233
         <translation type="unfinished"></translation>
233
         <translation type="unfinished"></translation>
234
     </message>
234
     </message>
235
     <message>
235
     <message>
236
-        <location filename="../src/interface_qt.cpp" line="243"/>
237
-        <source>Removed %1 from database.</source>
236
+        <location filename="../src/interface_qt.cpp" line="247"/>
237
+        <source>Nothing selected</source>
238
         <translation type="unfinished"></translation>
238
         <translation type="unfinished"></translation>
239
     </message>
239
     </message>
240
     <message>
240
     <message>
241
-        <location filename="../src/interface_qt.cpp" line="251"/>
242
-        <source>Select data to remove.</source>
241
+        <location filename="../src/interface_qt.cpp" line="248"/>
242
+        <source>Please select entries to remove.</source>
243
         <translation type="unfinished"></translation>
243
         <translation type="unfinished"></translation>
244
     </message>
244
     </message>
245
     <message>
245
     <message>
246
-        <location filename="../src/interface_qt.cpp" line="257"/>
246
+        <location filename="../src/interface_qt.cpp" line="254"/>
247
         <source>About Whyblocked</source>
247
         <source>About Whyblocked</source>
248
         <translation type="unfinished"></translation>
248
         <translation type="unfinished"></translation>
249
     </message>
249
     </message>
250
     <message>
250
     <message>
251
-        <location filename="../src/interface_qt.cpp" line="258"/>
251
+        <location filename="../src/interface_qt.cpp" line="255"/>
252
         <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
252
         <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
253
         <translation type="unfinished"></translation>
253
         <translation type="unfinished"></translation>
254
     </message>
254
     </message>
255
     <message>
255
     <message>
256
-        <location filename="../src/interface_qt.cpp" line="281"/>
256
+        <location filename="../src/interface_qt.cpp" line="278"/>
257
         <source>Receipts:</source>
257
         <source>Receipts:</source>
258
         <translation type="unfinished"></translation>
258
         <translation type="unfinished"></translation>
259
     </message>
259
     </message>

Loading…
Cancel
Save