Browse Source

Implemented saving and loading settings

Visibility of toolbar, toolbar location, size of window, width of
table headers. Fixes #6
tastytea 1 month ago
parent
commit
5163b4adbb
Signed by: tastytea <tastytea@tastytea.de> GPG Key ID: CFC39497F1B26E07
10 changed files with 212 additions and 74 deletions
  1. 3
    0
      .gitmodules
  2. 11
    4
      CMakeLists.txt
  3. 118
    2
      src/interface_qt.cpp
  4. 6
    0
      src/interface_qt.hpp
  5. 3
    0
      src/whyblocked.ui
  6. 1
    0
      src/xdgcfg.cpp
  7. 1
    0
      src/xdgcfg.hpp
  8. 34
    34
      translations/whyblocked_de.ts
  9. 34
    34
      translations/whyblocked_en.ts
  10. 1
    0
      xdgcfg

+ 3
- 0
.gitmodules View File

@@ -0,0 +1,3 @@
1
+[submodule "xdgcfg"]
2
+	path = xdgcfg
3
+	url = https://schlomp.space/tastytea/xdgcfg.git

+ 11
- 4
CMakeLists.txt View File

@@ -1,6 +1,6 @@
1 1
 cmake_minimum_required (VERSION 3.6)
2 2
 project (whyblocked
3
-         VERSION 0.11.1
3
+         VERSION 0.12.0
4 4
          LANGUAGES CXX
5 5
 )
6 6
 
@@ -15,6 +15,7 @@ pkg_check_modules(SQLITE3 sqlite3)
15 15
 find_package(Qt5Core CONFIG REQUIRED)
16 16
 if(NOT WITHOUT_GUI)
17 17
     find_package(Qt5Widgets CONFIG REQUIRED)
18
+    pkg_check_modules(LIBCONFIG REQUIRED libconfig++)
18 19
 endif()
19 20
 
20 21
 set(CMAKE_CXX_STANDARD 14)
@@ -29,9 +30,11 @@ set(CMAKE_AUTOUIC ON)
29 30
 include_directories(${PROJECT_BINARY_DIR})
30 31
 include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
31 32
 include_directories(${SQLITE3_INCLUDE_DIRS})
33
+include_directories(${LIBCONFIG_INCLUDE_DIRS})
32 34
 
33 35
 link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
34 36
 link_directories(${SQLITE3_LIBRARY_DIRS})
37
+link_directories(${LIBCONFIG_LIBRARY_DIRS})
35 38
 
36 39
 # Write version in header
37 40
 configure_file (
@@ -42,13 +45,17 @@ configure_file (
42 45
 set(COMMON_LIBRARIES
43 46
     ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs)
44 47
 
45
-add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
48
+add_executable(whyblocked
49
+               src/interface_text.cpp src/whyblocked.cpp)
46 50
 target_link_libraries(whyblocked ${COMMON_LIBRARIES} Qt5::Core)
47 51
 install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
48 52
 
49 53
 if(NOT WITHOUT_GUI)
50
-    add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp)
51
-    target_link_libraries(whyblocked-gui ${COMMON_LIBRARIES} Qt5::Widgets)
54
+    add_executable(whyblocked-gui
55
+                   src/interface_qt.cpp src/whyblocked.cpp src/xdgcfg.cpp)
56
+    target_link_libraries(whyblocked-gui
57
+                          ${COMMON_LIBRARIES} Qt5::Widgets
58
+                          ${LIBCONFIG_LIBRARIES} stdc++fs)
52 59
 
53 60
     install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
54 61
     install(FILES de.tastytea.Whyblocked.desktop DESTINATION

+ 118
- 2
src/interface_qt.cpp View File

@@ -18,22 +18,136 @@
18 18
 #include <array>
19 19
 #include <QMessageBox>
20 20
 #include <QDebug>
21
+#include <iostream>
21 22
 #include <QTranslator>
22 23
 #include <QLibraryInfo>
23 24
 #include <QtCore/qmimedata.h>
25
+#include <libconfig.h++>
24 26
 #include "version.hpp"
25 27
 #include "whyblocked.hpp"
26 28
 #include "interface_qt.hpp"
27 29
 
28
-MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent)
30
+MainWindow::MainWindow(QMainWindow *parent)
31
+: QMainWindow(parent)
32
+, _config("whyblocked.cfg")
33
+, _headersize({ 250, 125, 125 })
29 34
 {
30 35
     setupUi(this);
31 36
 
32 37
     _model = new QStandardItemModel;
33 38
     tableview->setModel(_model);
39
+
40
+    if (_config.read() == 0)
41
+    {
42
+        libconfig::Setting &root = _config.get_cfg().getRoot();
43
+        string key;
44
+
45
+        key = "size";
46
+        if (root.exists(key) && root[key.c_str()].isArray())
47
+        {
48
+            this->resize(root[key.c_str()][0], root[key.c_str()][1]);
49
+        }
50
+
51
+        key = "toolbar_position";
52
+        if (root.exists(key))
53
+        {
54
+            const string value = root[key.c_str()].c_str();
55
+            if (value == "top")
56
+            {
57
+                this->removeToolBar(toolbar);
58
+                this->addToolBar(Qt::TopToolBarArea, toolbar);
59
+            }
60
+            else if (value == "right")
61
+            {
62
+                this->removeToolBar(toolbar);
63
+                this->addToolBar(Qt::RightToolBarArea, toolbar);
64
+            }
65
+            else if (value == "bottom")
66
+            {
67
+                this->removeToolBar(toolbar);
68
+                this->addToolBar(Qt::BottomToolBarArea, toolbar);
69
+            }
70
+            else if (value == "left")
71
+            {
72
+                this->removeToolBar(toolbar);
73
+                this->addToolBar(Qt::LeftToolBarArea, toolbar);
74
+            }
75
+        }
76
+
77
+        key = "toolbar_visible";
78
+        if (root.exists(key))
79
+        {
80
+            toolbar->setVisible(root[key.c_str()]);
81
+        }
82
+
83
+        key = "table_headers";
84
+        if (root.exists(key) && root[key.c_str()].isArray())
85
+        {
86
+            const libconfig::Setting &value = root[key.c_str()];
87
+            _headersize = { value[0], value[1], value[2] };
88
+        }
89
+    }
90
+
34 91
     populate_tableview();
35 92
 }
36 93
 
94
+MainWindow::~MainWindow()
95
+{
96
+    libconfig::Setting &root = _config.get_cfg().getRoot();
97
+    // We can't add an element that already exists, so we delete it beforehand.
98
+    for (const string &key :
99
+         { "size", "toolbar_position", "toolbar_visible", "table_headers" })
100
+    {
101
+        if (root.exists(key))
102
+        {
103
+            root.remove(key);
104
+        }
105
+    }
106
+    
107
+    libconfig::Setting &size = root.add("size", libconfig::Setting::TypeArray);
108
+    size.add(libconfig::Setting::TypeInt) = this->width();
109
+    size.add(libconfig::Setting::TypeInt) = this->height();
110
+
111
+    libconfig::Setting &pos = root.add("toolbar_position",
112
+                                       libconfig::Setting::TypeString);
113
+    if (toolbar->orientation() == Qt::Orientation::Horizontal)
114
+    {
115
+        if (toolbar-> geometry().top() < 100)
116
+        {
117
+            pos = "top";
118
+        }
119
+        else
120
+        {
121
+            pos = "bottom";
122
+        }
123
+    }
124
+    else
125
+    {
126
+        if (toolbar->geometry().left() == 0)
127
+        {
128
+            pos = "left";
129
+        }
130
+        else
131
+        {
132
+            pos = "right";
133
+        }
134
+    }
135
+
136
+    root.add("toolbar_visible", libconfig::Setting::TypeBoolean)
137
+        = !toolbar->isHidden();
138
+
139
+    libconfig::Setting &headers = root.add("table_headers",
140
+                                           libconfig::Setting::TypeArray);
141
+    headers.add(libconfig::Setting::TypeInt) =
142
+        tableview->horizontalHeader()->sectionSize(0);
143
+    headers.add(libconfig::Setting::TypeInt) =
144
+        tableview->horizontalHeader()->sectionSize(1);
145
+    headers.add(libconfig::Setting::TypeInt) =
146
+        tableview->horizontalHeader()->sectionSize(2);
147
+
148
+    _config.write();
149
+}
150
+
37 151
 void MainWindow::populate_tableview()
38 152
 {
39 153
     _model->clear();
@@ -43,7 +157,9 @@ void MainWindow::populate_tableview()
43 157
         tr("Blocked/Silenced"),
44 158
         tr("Reason")
45 159
     });
46
-    tableview->horizontalHeader()->resizeSection(0, 250);
160
+    tableview->horizontalHeader()->resizeSection(0, _headersize[0]);
161
+    tableview->horizontalHeader()->resizeSection(1, _headersize[1]);
162
+    tableview->horizontalHeader()->resizeSection(2, _headersize[2]);
47 163
 
48 164
     result_view result;
49 165
     if (database::view(result))

+ 6
- 0
src/interface_qt.hpp View File

@@ -18,10 +18,13 @@
18 18
 #define INTERFACE_QT_HPP
19 19
 
20 20
 #include <string>
21
+#include <memory>
22
+#include <array>
21 23
 #include <QMainWindow>
22 24
 #include <QStandardItemModel>
23 25
 #include <QDialog>
24 26
 #include <QtGui/qevent.h>
27
+#include "xdgcfg.hpp"
25 28
 #include "ui_whyblocked.h"
26 29
 #include "ui_whyblocked_add.h"
27 30
 
@@ -41,6 +44,7 @@ class MainWindow : public QMainWindow, private Ui::MainWindow
41 44
 
42 45
 public:
43 46
     explicit MainWindow(QMainWindow *parent = nullptr);
47
+    ~MainWindow();
44 48
     void add_row(const QString &user, const int &blocked,
45 49
                  const QString &reason);
46 50
 
@@ -53,6 +57,8 @@ private:
53 57
     void dropEvent(QDropEvent *event);
54 58
 
55 59
     QStandardItemModel *_model;
60
+    xdgcfg _config;
61
+    std::array<int, 3> _headersize;
56 62
 
57 63
 private slots:
58 64
     void add();

+ 3
- 0
src/whyblocked.ui View File

@@ -100,6 +100,9 @@
100 100
    <property name="windowTitle">
101 101
     <string>Toolbar</string>
102 102
    </property>
103
+   <property name="floatable">
104
+    <bool>false</bool>
105
+   </property>
103 106
    <attribute name="toolBarArea">
104 107
     <enum>TopToolBarArea</enum>
105 108
    </attribute>

+ 1
- 0
src/xdgcfg.cpp View File

@@ -0,0 +1 @@
1
+../xdgcfg/src/xdgcfg.cpp

+ 1
- 0
src/xdgcfg.hpp View File

@@ -0,0 +1 @@
1
+../xdgcfg/src/xdgcfg.hpp

+ 34
- 34
translations/whyblocked_de.ts View File

@@ -69,12 +69,12 @@
69 69
         <translation></translation>
70 70
     </message>
71 71
     <message>
72
-        <location filename="../src/interface_qt.cpp" line="262"/>
72
+        <location filename="../src/interface_qt.cpp" line="378"/>
73 73
         <source>Insert receipt here.</source>
74 74
         <translation>Beleg hier einfügen.</translation>
75 75
     </message>
76 76
     <message>
77
-        <location filename="../src/interface_qt.cpp" line="297"/>
77
+        <location filename="../src/interface_qt.cpp" line="413"/>
78 78
         <source>Added %1 to database.</source>
79 79
         <translation>%1 zur Datenbank hinzugefügt.</translation>
80 80
     </message>
@@ -102,158 +102,158 @@
102 102
         <translation>Werkzeugleiste</translation>
103 103
     </message>
104 104
     <message>
105
-        <location filename="../src/whyblocked.ui" line="128"/>
105
+        <location filename="../src/whyblocked.ui" line="131"/>
106 106
         <source>&amp;Database</source>
107 107
         <translation>&amp;Datenbank</translation>
108 108
     </message>
109 109
     <message>
110
-        <location filename="../src/whyblocked.ui" line="138"/>
110
+        <location filename="../src/whyblocked.ui" line="141"/>
111 111
         <source>&amp;Help</source>
112 112
         <translation>&amp;Hilfe</translation>
113 113
     </message>
114 114
     <message>
115
-        <location filename="../src/whyblocked.ui" line="151"/>
115
+        <location filename="../src/whyblocked.ui" line="154"/>
116 116
         <source>&amp;Add</source>
117 117
         <translation>&amp;Hinzufügen</translation>
118 118
     </message>
119 119
     <message>
120
-        <location filename="../src/whyblocked.ui" line="154"/>
120
+        <location filename="../src/whyblocked.ui" line="157"/>
121 121
         <source>Add user or instance</source>
122 122
         <translation>Benutzer oder Instanz hinzufügen</translation>
123 123
     </message>
124 124
     <message>
125
-        <location filename="../src/whyblocked.ui" line="157"/>
125
+        <location filename="../src/whyblocked.ui" line="160"/>
126 126
         <source>Ctrl+N</source>
127 127
         <translation></translation>
128 128
     </message>
129 129
     <message>
130
-        <location filename="../src/whyblocked.ui" line="166"/>
130
+        <location filename="../src/whyblocked.ui" line="169"/>
131 131
         <source>Re&amp;move</source>
132 132
         <translation>Ent&amp;fernen</translation>
133 133
     </message>
134 134
     <message>
135
-        <location filename="../src/whyblocked.ui" line="169"/>
135
+        <location filename="../src/whyblocked.ui" line="172"/>
136 136
         <source>Remove user or instance</source>
137 137
         <translation>Benutzer oder Instanz entfernen</translation>
138 138
     </message>
139 139
     <message>
140
-        <location filename="../src/whyblocked.ui" line="172"/>
140
+        <location filename="../src/whyblocked.ui" line="175"/>
141 141
         <source>Del</source>
142 142
         <translation></translation>
143 143
     </message>
144 144
     <message>
145
-        <location filename="../src/whyblocked.ui" line="181"/>
145
+        <location filename="../src/whyblocked.ui" line="184"/>
146 146
         <source>&amp;About</source>
147 147
         <translation>&amp;Über</translation>
148 148
     </message>
149 149
     <message>
150
-        <location filename="../src/whyblocked.ui" line="184"/>
150
+        <location filename="../src/whyblocked.ui" line="187"/>
151 151
         <source>About this application</source>
152 152
         <translation>Über dieses Programm</translation>
153 153
     </message>
154 154
     <message>
155
-        <location filename="../src/whyblocked.ui" line="193"/>
155
+        <location filename="../src/whyblocked.ui" line="196"/>
156 156
         <source>&amp;Reload</source>
157 157
         <translation>Neu &amp;laden</translation>
158 158
     </message>
159 159
     <message>
160
-        <location filename="../src/whyblocked.ui" line="196"/>
160
+        <location filename="../src/whyblocked.ui" line="199"/>
161 161
         <source>Reload database</source>
162 162
         <translation>Datenbank neu laden</translation>
163 163
     </message>
164 164
     <message>
165
-        <location filename="../src/whyblocked.ui" line="199"/>
165
+        <location filename="../src/whyblocked.ui" line="202"/>
166 166
         <source>Ctrl+R</source>
167 167
         <translation></translation>
168 168
     </message>
169 169
     <message>
170
-        <location filename="../src/whyblocked.ui" line="208"/>
170
+        <location filename="../src/whyblocked.ui" line="211"/>
171 171
         <source>&amp;Quit</source>
172 172
         <translation>&amp;Beenden</translation>
173 173
     </message>
174 174
     <message>
175
-        <location filename="../src/whyblocked.ui" line="211"/>
175
+        <location filename="../src/whyblocked.ui" line="214"/>
176 176
         <source>Quit application</source>
177 177
         <translation>Programm beenden</translation>
178 178
     </message>
179 179
     <message>
180
-        <location filename="../src/whyblocked.ui" line="214"/>
180
+        <location filename="../src/whyblocked.ui" line="217"/>
181 181
         <source>Ctrl+Q</source>
182 182
         <translation></translation>
183 183
     </message>
184 184
     <message>
185
-        <location filename="../src/whyblocked.ui" line="223"/>
185
+        <location filename="../src/whyblocked.ui" line="226"/>
186 186
         <source>&amp;Edit</source>
187 187
         <translation>B&amp;earbeiten</translation>
188 188
     </message>
189 189
     <message>
190
-        <location filename="../src/whyblocked.ui" line="226"/>
191
-        <location filename="../src/interface_qt.cpp" line="95"/>
190
+        <location filename="../src/whyblocked.ui" line="229"/>
191
+        <location filename="../src/interface_qt.cpp" line="211"/>
192 192
         <source>Edit entry</source>
193 193
         <translation>Eintrag bearbeiten</translation>
194 194
     </message>
195 195
     <message>
196
-        <location filename="../src/interface_qt.cpp" line="42"/>
196
+        <location filename="../src/interface_qt.cpp" line="156"/>
197 197
         <source>User/Instance</source>
198 198
         <translation>Benutzer/Instanz</translation>
199 199
     </message>
200 200
     <message>
201
-        <location filename="../src/interface_qt.cpp" line="43"/>
201
+        <location filename="../src/interface_qt.cpp" line="157"/>
202 202
         <source>Blocked/Silenced</source>
203 203
         <translation>Blockiert/Gedämpft</translation>
204 204
     </message>
205 205
     <message>
206
-        <location filename="../src/interface_qt.cpp" line="44"/>
206
+        <location filename="../src/interface_qt.cpp" line="158"/>
207 207
         <source>Reason</source>
208 208
         <translation>Begründung</translation>
209 209
     </message>
210 210
     <message>
211
-        <location filename="../src/interface_qt.cpp" line="59"/>
211
+        <location filename="../src/interface_qt.cpp" line="175"/>
212 212
         <source>Database loaded.</source>
213 213
         <translation>Datenbank geladen.</translation>
214 214
     </message>
215 215
     <message>
216
-        <location filename="../src/interface_qt.cpp" line="69"/>
216
+        <location filename="../src/interface_qt.cpp" line="185"/>
217 217
         <source>blocked</source>
218 218
         <translation>blockiert</translation>
219 219
     </message>
220 220
     <message>
221
-        <location filename="../src/interface_qt.cpp" line="73"/>
221
+        <location filename="../src/interface_qt.cpp" line="189"/>
222 222
         <source>silenced</source>
223 223
         <translation>gedämpft</translation>
224 224
     </message>
225 225
     <message>
226
-        <location filename="../src/interface_qt.cpp" line="89"/>
226
+        <location filename="../src/interface_qt.cpp" line="205"/>
227 227
         <source>Invalid selection</source>
228 228
         <translation>Ungültige Auswahl</translation>
229 229
     </message>
230 230
     <message>
231
-        <location filename="../src/interface_qt.cpp" line="90"/>
231
+        <location filename="../src/interface_qt.cpp" line="206"/>
232 232
         <source>Please select only 1 entry to edit.</source>
233 233
         <translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
234 234
     </message>
235 235
     <message>
236
-        <location filename="../src/interface_qt.cpp" line="127"/>
236
+        <location filename="../src/interface_qt.cpp" line="243"/>
237 237
         <source>Removed %1 from database.</source>
238 238
         <translation>%1 aus der Datenbank gelöscht.</translation>
239 239
     </message>
240 240
     <message>
241
-        <location filename="../src/interface_qt.cpp" line="135"/>
241
+        <location filename="../src/interface_qt.cpp" line="251"/>
242 242
         <source>Select data to remove.</source>
243 243
         <translation>Wähle Daten zum löschen aus.</translation>
244 244
     </message>
245 245
     <message>
246
-        <location filename="../src/interface_qt.cpp" line="141"/>
246
+        <location filename="../src/interface_qt.cpp" line="257"/>
247 247
         <source>About Whyblocked</source>
248 248
         <translation>Über Whyblocked</translation>
249 249
     </message>
250 250
     <message>
251
-        <location filename="../src/interface_qt.cpp" line="142"/>
251
+        <location filename="../src/interface_qt.cpp" line="258"/>
252 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 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 254
     </message>
255 255
     <message>
256
-        <location filename="../src/interface_qt.cpp" line="165"/>
256
+        <location filename="../src/interface_qt.cpp" line="281"/>
257 257
         <source>Receipts:</source>
258 258
         <translation>Belege:</translation>
259 259
     </message>

+ 34
- 34
translations/whyblocked_en.ts View File

@@ -69,12 +69,12 @@
69 69
         <translation type="unfinished"></translation>
70 70
     </message>
71 71
     <message>
72
-        <location filename="../src/interface_qt.cpp" line="262"/>
72
+        <location filename="../src/interface_qt.cpp" line="378"/>
73 73
         <source>Insert receipt here.</source>
74 74
         <translation type="unfinished"></translation>
75 75
     </message>
76 76
     <message>
77
-        <location filename="../src/interface_qt.cpp" line="297"/>
77
+        <location filename="../src/interface_qt.cpp" line="413"/>
78 78
         <source>Added %1 to database.</source>
79 79
         <translation type="unfinished"></translation>
80 80
     </message>
@@ -102,158 +102,158 @@
102 102
         <translation type="unfinished"></translation>
103 103
     </message>
104 104
     <message>
105
-        <location filename="../src/whyblocked.ui" line="128"/>
105
+        <location filename="../src/whyblocked.ui" line="131"/>
106 106
         <source>&amp;Database</source>
107 107
         <translation type="unfinished"></translation>
108 108
     </message>
109 109
     <message>
110
-        <location filename="../src/whyblocked.ui" line="138"/>
110
+        <location filename="../src/whyblocked.ui" line="141"/>
111 111
         <source>&amp;Help</source>
112 112
         <translation type="unfinished"></translation>
113 113
     </message>
114 114
     <message>
115
-        <location filename="../src/whyblocked.ui" line="151"/>
115
+        <location filename="../src/whyblocked.ui" line="154"/>
116 116
         <source>&amp;Add</source>
117 117
         <translation type="unfinished"></translation>
118 118
     </message>
119 119
     <message>
120
-        <location filename="../src/whyblocked.ui" line="154"/>
120
+        <location filename="../src/whyblocked.ui" line="157"/>
121 121
         <source>Add user or instance</source>
122 122
         <translation type="unfinished"></translation>
123 123
     </message>
124 124
     <message>
125
-        <location filename="../src/whyblocked.ui" line="157"/>
125
+        <location filename="../src/whyblocked.ui" line="160"/>
126 126
         <source>Ctrl+N</source>
127 127
         <translation type="unfinished"></translation>
128 128
     </message>
129 129
     <message>
130
-        <location filename="../src/whyblocked.ui" line="166"/>
130
+        <location filename="../src/whyblocked.ui" line="169"/>
131 131
         <source>Re&amp;move</source>
132 132
         <translation type="unfinished"></translation>
133 133
     </message>
134 134
     <message>
135
-        <location filename="../src/whyblocked.ui" line="169"/>
135
+        <location filename="../src/whyblocked.ui" line="172"/>
136 136
         <source>Remove user or instance</source>
137 137
         <translation type="unfinished"></translation>
138 138
     </message>
139 139
     <message>
140
-        <location filename="../src/whyblocked.ui" line="172"/>
140
+        <location filename="../src/whyblocked.ui" line="175"/>
141 141
         <source>Del</source>
142 142
         <translation type="unfinished"></translation>
143 143
     </message>
144 144
     <message>
145
-        <location filename="../src/whyblocked.ui" line="181"/>
145
+        <location filename="../src/whyblocked.ui" line="184"/>
146 146
         <source>&amp;About</source>
147 147
         <translation type="unfinished"></translation>
148 148
     </message>
149 149
     <message>
150
-        <location filename="../src/whyblocked.ui" line="184"/>
150
+        <location filename="../src/whyblocked.ui" line="187"/>
151 151
         <source>About this application</source>
152 152
         <translation type="unfinished"></translation>
153 153
     </message>
154 154
     <message>
155
-        <location filename="../src/whyblocked.ui" line="193"/>
155
+        <location filename="../src/whyblocked.ui" line="196"/>
156 156
         <source>&amp;Reload</source>
157 157
         <translation type="unfinished"></translation>
158 158
     </message>
159 159
     <message>
160
-        <location filename="../src/whyblocked.ui" line="196"/>
160
+        <location filename="../src/whyblocked.ui" line="199"/>
161 161
         <source>Reload database</source>
162 162
         <translation type="unfinished"></translation>
163 163
     </message>
164 164
     <message>
165
-        <location filename="../src/whyblocked.ui" line="199"/>
165
+        <location filename="../src/whyblocked.ui" line="202"/>
166 166
         <source>Ctrl+R</source>
167 167
         <translation type="unfinished"></translation>
168 168
     </message>
169 169
     <message>
170
-        <location filename="../src/whyblocked.ui" line="208"/>
170
+        <location filename="../src/whyblocked.ui" line="211"/>
171 171
         <source>&amp;Quit</source>
172 172
         <translation type="unfinished"></translation>
173 173
     </message>
174 174
     <message>
175
-        <location filename="../src/whyblocked.ui" line="211"/>
175
+        <location filename="../src/whyblocked.ui" line="214"/>
176 176
         <source>Quit application</source>
177 177
         <translation type="unfinished"></translation>
178 178
     </message>
179 179
     <message>
180
-        <location filename="../src/whyblocked.ui" line="214"/>
180
+        <location filename="../src/whyblocked.ui" line="217"/>
181 181
         <source>Ctrl+Q</source>
182 182
         <translation type="unfinished"></translation>
183 183
     </message>
184 184
     <message>
185
-        <location filename="../src/whyblocked.ui" line="223"/>
185
+        <location filename="../src/whyblocked.ui" line="226"/>
186 186
         <source>&amp;Edit</source>
187 187
         <translation type="unfinished"></translation>
188 188
     </message>
189 189
     <message>
190
-        <location filename="../src/whyblocked.ui" line="226"/>
191
-        <location filename="../src/interface_qt.cpp" line="95"/>
190
+        <location filename="../src/whyblocked.ui" line="229"/>
191
+        <location filename="../src/interface_qt.cpp" line="211"/>
192 192
         <source>Edit entry</source>
193 193
         <translation type="unfinished"></translation>
194 194
     </message>
195 195
     <message>
196
-        <location filename="../src/interface_qt.cpp" line="42"/>
196
+        <location filename="../src/interface_qt.cpp" line="156"/>
197 197
         <source>User/Instance</source>
198 198
         <translation type="unfinished"></translation>
199 199
     </message>
200 200
     <message>
201
-        <location filename="../src/interface_qt.cpp" line="43"/>
201
+        <location filename="../src/interface_qt.cpp" line="157"/>
202 202
         <source>Blocked/Silenced</source>
203 203
         <translation type="unfinished"></translation>
204 204
     </message>
205 205
     <message>
206
-        <location filename="../src/interface_qt.cpp" line="44"/>
206
+        <location filename="../src/interface_qt.cpp" line="158"/>
207 207
         <source>Reason</source>
208 208
         <translation type="unfinished"></translation>
209 209
     </message>
210 210
     <message>
211
-        <location filename="../src/interface_qt.cpp" line="59"/>
211
+        <location filename="../src/interface_qt.cpp" line="175"/>
212 212
         <source>Database loaded.</source>
213 213
         <translation type="unfinished"></translation>
214 214
     </message>
215 215
     <message>
216
-        <location filename="../src/interface_qt.cpp" line="69"/>
216
+        <location filename="../src/interface_qt.cpp" line="185"/>
217 217
         <source>blocked</source>
218 218
         <translation type="unfinished"></translation>
219 219
     </message>
220 220
     <message>
221
-        <location filename="../src/interface_qt.cpp" line="73"/>
221
+        <location filename="../src/interface_qt.cpp" line="189"/>
222 222
         <source>silenced</source>
223 223
         <translation type="unfinished"></translation>
224 224
     </message>
225 225
     <message>
226
-        <location filename="../src/interface_qt.cpp" line="89"/>
226
+        <location filename="../src/interface_qt.cpp" line="205"/>
227 227
         <source>Invalid selection</source>
228 228
         <translation type="unfinished"></translation>
229 229
     </message>
230 230
     <message>
231
-        <location filename="../src/interface_qt.cpp" line="90"/>
231
+        <location filename="../src/interface_qt.cpp" line="206"/>
232 232
         <source>Please select only 1 entry to edit.</source>
233 233
         <translation type="unfinished"></translation>
234 234
     </message>
235 235
     <message>
236
-        <location filename="../src/interface_qt.cpp" line="127"/>
236
+        <location filename="../src/interface_qt.cpp" line="243"/>
237 237
         <source>Removed %1 from database.</source>
238 238
         <translation type="unfinished"></translation>
239 239
     </message>
240 240
     <message>
241
-        <location filename="../src/interface_qt.cpp" line="135"/>
241
+        <location filename="../src/interface_qt.cpp" line="251"/>
242 242
         <source>Select data to remove.</source>
243 243
         <translation type="unfinished"></translation>
244 244
     </message>
245 245
     <message>
246
-        <location filename="../src/interface_qt.cpp" line="141"/>
246
+        <location filename="../src/interface_qt.cpp" line="257"/>
247 247
         <source>About Whyblocked</source>
248 248
         <translation type="unfinished"></translation>
249 249
     </message>
250 250
     <message>
251
-        <location filename="../src/interface_qt.cpp" line="142"/>
251
+        <location filename="../src/interface_qt.cpp" line="258"/>
252 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 253
         <translation type="unfinished"></translation>
254 254
     </message>
255 255
     <message>
256
-        <location filename="../src/interface_qt.cpp" line="165"/>
256
+        <location filename="../src/interface_qt.cpp" line="281"/>
257 257
         <source>Receipts:</source>
258 258
         <translation type="unfinished"></translation>
259 259
     </message>

+ 1
- 0
xdgcfg

@@ -0,0 +1 @@
1
+Subproject commit 6c0976baa74f959ed3218af56e56ff58202a5a05

Loading…
Cancel
Save