Revision 1792
| trunk/client/gui_qt/AutoImport.cpp (revision 1792) | ||
|---|---|---|
| 3 | 3 |
|
| 4 | 4 |
#include "AutoImport.h" |
| 5 | 5 |
#include "DialogImportNZB.h" |
| 6 |
#include "mainwindow.h" |
|
| 6 | 7 |
|
| 7 |
AutoImport::AutoImport(QNNTPGrabGlue *glue) |
|
| 8 |
AutoImport::AutoImport(MainWindow *mainwindow, QNNTPGrabGlue *glue) |
|
| 8 | 9 |
{
|
| 9 | 10 |
this->glue = glue; |
| 11 |
this->mainwindow = mainwindow; |
|
| 10 | 12 |
|
| 13 |
connect(glue, SIGNAL(pluginEvent(QString,QString,QList |
|
| 14 |
|
|
| 11 | 15 |
connect(&watcher, SIGNAL(directoryChanged(QString)), SLOT(directoryChanged(QString))); |
| 12 | 16 |
|
| 13 | 17 |
connect(&fileReadyTimer, SIGNAL(timeout()), SLOT(fileReadyTimer_timeout())); |
| ... | ... | |
| 85 | 89 |
d.quickImport(collection_name, QString(contents), false); |
| 86 | 90 |
|
| 87 | 91 |
filesQueued.remove(path); |
| 92 |
|
|
| 93 |
QString msg = tr("The file '%1'\nwas successfully imported with the collection name '%2'").arg(path, collection_name);
|
|
| 94 |
mainwindow->showNotification(tr("NZB File Imported"), msg);
|
|
| 88 | 95 |
} |
| 96 |
|
|
| 97 |
void AutoImport::onPluginEvent(QString plugin_name, QString event_name, QList |
|
| 98 |
{
|
|
| 99 |
if (plugin_name != "Auto-import" || event_name != "nzb_imported") {
|
|
| 100 |
return; |
|
| 101 |
} |
|
| 102 |
|
|
| 103 |
QString msg = tr("The file '%1'\non the NNTPGrab Server was successfully\nimported with the collection name '%2'").arg(args[0], args[1]);
|
|
| 104 |
mainwindow->showNotification(tr("NZB File Imported"), msg);
|
|
| 105 |
} |
|
| trunk/client/gui_qt/WidgetConfigAutoImport.h (revision 1792) | ||
|---|---|---|
| 6 | 6 |
#include "QNNTPGrabGlue.h" |
| 7 | 7 |
#include "AutoImport.h" |
| 8 | 8 |
|
| 9 |
class MainWindow; /* Prevent recursion */ |
|
| 10 |
|
|
| 9 | 11 |
namespace Ui {
|
| 10 | 12 |
class WidgetConfigAutoImport; |
| 11 | 13 |
} |
| ... | ... | |
| 13 | 15 |
class WidgetConfigAutoImport : public QWidget {
|
| 14 | 16 |
Q_OBJECT |
| 15 | 17 |
public: |
| 16 |
WidgetConfigAutoImport(QNNTPGrabGlue *glue, QWidget *parent = 0); |
|
| 18 |
WidgetConfigAutoImport(MainWindow *mainwindow, QNNTPGrabGlue *glue, QWidget *parent = 0); |
|
| 17 | 19 |
~WidgetConfigAutoImport(); |
| 18 | 20 |
|
| 19 | 21 |
protected: |
| trunk/client/gui_qt/WidgetConfig.cpp (revision 1792) | ||
|---|---|---|
| 35 | 35 |
ui->horizontalLayout->addWidget(nzbcreator); |
| 36 | 36 |
#endif |
| 37 | 37 |
|
| 38 |
auto_import = new WidgetConfigAutoImport(glue); |
|
| 38 |
auto_import = new WidgetConfigAutoImport(mainwindow, glue); |
|
| 39 | 39 |
auto_import->hide(); |
| 40 | 40 |
ui->horizontalLayout->addWidget(auto_import); |
| 41 | 41 |
|
| trunk/client/gui_qt/mainwindow.cpp (revision 1792) | ||
|---|---|---|
| 278 | 278 |
break; |
| 279 | 279 |
}; |
| 280 | 280 |
|
| 281 |
trayIcon.showMessage(title, msg); |
|
| 281 |
showNotification(title, msg); |
|
| 282 | 282 |
} |
| 283 | 283 |
|
| 284 | 284 |
void MainWindow::onSchedularStateChanged(QNNTPGrabGlue::SchedularState state, QString reason) |
| ... | ... | |
| 305 | 305 |
close(); |
| 306 | 306 |
} |
| 307 | 307 |
|
| 308 |
void MainWindow::showNotification(QString title, QString msg) |
|
| 309 |
{
|
|
| 310 |
trayIcon.showMessage(title, msg); |
|
| 311 |
} |
|
| 312 |
|
|
| 308 | 313 |
void MainWindow::setShowNotificationOnFileDownloaded(bool enabled) |
| 309 | 314 |
{
|
| 310 | 315 |
showNotificationOnFileDownloaded = enabled; |
| trunk/client/gui_qt/WidgetConfigAutoImport.cpp (revision 1792) | ||
|---|---|---|
| 2 | 2 |
#include "ui_WidgetConfigAutoImport.h" |
| 3 | 3 |
#include "ConfigGuiOpts.h" |
| 4 | 4 |
|
| 5 |
WidgetConfigAutoImport::WidgetConfigAutoImport(QNNTPGrabGlue *glue, QWidget *parent) : |
|
| 5 |
WidgetConfigAutoImport::WidgetConfigAutoImport(MainWindow *mainwindow, QNNTPGrabGlue *glue, QWidget *parent) : |
|
| 6 | 6 |
QWidget(parent), |
| 7 | 7 |
ui(new Ui::WidgetConfigAutoImport), |
| 8 |
auto_import(glue) |
|
| 8 |
auto_import(mainwindow, glue) |
|
| 9 | 9 |
{
|
| 10 | 10 |
ui->setupUi(this); |
| 11 | 11 |
|
| trunk/client/gui_qt/mainwindow.h (revision 1792) | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
void setShowNotificationOnFileDownloaded(bool enabled); |
| 31 | 31 |
void setShowNotificationOnFileDecoded(bool enabled); |
| 32 |
void showNotification(QString title, QString msg); |
|
| 32 | 33 |
void showTrayIcon(); |
| 33 | 34 |
void hideTrayIcon(); |
| 34 | 35 |
|
| trunk/client/gui_qt/translations/nntpgrab_nl.ts (revision 1792) | ||
|---|---|---|
| 5 | 5 |
|
| 6 | 6 |
|
| 7 | 7 |
|
| 8 |
|
|
| 8 |
|
|
| 9 | 9 |
|
| 10 | 10 |
|
| 11 | 11 |
|
| 12 | 12 |
|
| 13 |
|
|
| 13 |
|
|
| 14 | 14 |
|
| 15 | 15 |
|
| 16 | 16 |
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
was successfully imported with the collection name '%2' |
|
| 21 |
|
|
| 22 |
is met succes geimporteerd met de collectie naam '%2' |
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
on the NNTPGrab Server was successfully |
|
| 34 |
imported with the collection name '%2' |
|
| 35 |
|
|
| 36 |
op de NNTPGrab Server was met succes |
|
| 37 |
geimporteerd met de collectie naam '%2' |
|
| 38 |
|
|
| 17 | 39 |
|
| 18 | 40 |
|
| 19 | 41 |
|
| ... | ... | |
| 1144 | 1166 |
|
| 1145 | 1167 |
|
| 1146 | 1168 |
|
| 1147 |
|
|
| 1169 |
|
|
| 1148 | 1170 |
|
| 1149 | 1171 |
|
| 1150 | 1172 |
|
| ... | ... | |
| 1192 | 1214 |
|
| 1193 | 1215 |
|
| 1194 | 1216 |
|
| 1195 |
|
|
| 1196 |
|
|
| 1217 |
|
|
| 1218 |
|
|
| 1197 | 1219 |
|
| 1198 | 1220 |
|
| 1199 | 1221 |
|
| 1200 | 1222 |
|
| 1201 |
|
|
| 1202 |
|
|
| 1223 |
|
|
| 1224 |
|
|
| 1203 | 1225 |
|
| 1204 | 1226 |
|
| 1205 | 1227 |
|
| 1206 | 1228 |
|
| 1207 |
|
|
| 1229 |
|
|
| 1208 | 1230 |
|
| 1209 | 1231 |
|
| 1210 | 1232 |
|
| 1211 | 1233 |
|
| 1212 |
|
|
| 1213 |
|
|
| 1234 |
|
|
| 1235 |
|
|
| 1214 | 1236 |
|
| 1215 | 1237 |
|
| 1216 | 1238 |
|
| 1217 | 1239 |
|
| 1218 |
|
|
| 1240 |
|
|
| 1219 | 1241 |
|
| 1220 | 1242 |
|
| 1221 | 1243 |
|
| 1222 | 1244 |
|
| 1223 |
|
|
| 1245 |
|
|
| 1224 | 1246 |
|
| 1225 | 1247 |
%s |
| 1226 | 1248 |
|
| 1227 | 1249 |
%s |
| 1228 | 1250 |
|
| 1229 | 1251 |
|
| 1230 |
|
|
| 1252 |
|
|
| 1231 | 1253 |
|
| 1232 | 1254 |
%s |
| 1233 | 1255 |
|
| 1234 | 1256 |
%s |
| 1235 | 1257 |
|
| 1236 | 1258 |
|
| 1237 |
|
|
| 1259 |
|
|
| 1238 | 1260 |
|
| 1239 | 1261 |
|
| 1240 | 1262 |
|
| 1241 | 1263 |
|
| 1242 |
|
|
| 1264 |
|
|
| 1243 | 1265 |
|
| 1244 | 1266 |
|
| 1245 | 1267 |
|
| 1246 | 1268 |
|
| 1247 |
|
|
| 1269 |
|
|
| 1248 | 1270 |
|
| 1249 | 1271 |
|
| 1250 | 1272 |
|
| 1251 | 1273 |
|
| 1252 |
|
|
| 1274 |
|
|
| 1253 | 1275 |
|
| 1254 | 1276 |
|
| 1255 | 1277 |
|
| trunk/client/gui_qt/AutoImport.h (revision 1792) | ||
|---|---|---|
| 8 | 8 |
|
| 9 | 9 |
#include "QNNTPGrabGlue.h" |
| 10 | 10 |
|
| 11 |
class MainWindow; /* Prevent recursion */ |
|
| 12 |
|
|
| 11 | 13 |
class AutoImport : public QObject |
| 12 | 14 |
{
|
| 13 | 15 |
Q_OBJECT |
| 14 | 16 |
|
| 15 | 17 |
public: |
| 16 |
AutoImport(QNNTPGrabGlue *glue); |
|
| 18 |
AutoImport(MainWindow *mainwindow, QNNTPGrabGlue *glue); |
|
| 17 | 19 |
|
| 18 | 20 |
void enableWatch(QString path); |
| 19 | 21 |
void disableWatch(); |
| 20 | 22 |
|
| 21 | 23 |
private: |
| 22 | 24 |
QNNTPGrabGlue *glue; |
| 25 |
MainWindow *mainwindow; |
|
| 23 | 26 |
QFileSystemWatcher watcher; |
| 24 | 27 |
QString path; |
| 25 | 28 |
QTimer fileReadyTimer; |
| ... | ... | |
| 30 | 33 |
private slots: |
| 31 | 34 |
void directoryChanged(QString path); |
| 32 | 35 |
void fileReadyTimer_timeout(); |
| 36 |
|
|
| 37 |
void onPluginEvent(QString plugin_name, QString event_name, QList |
|
| 33 | 38 |
}; |
| 34 | 39 |
|
| 35 | 40 |
#endif // AUTOIMPORT_H |
Also available in: Unified diff
NNTPGrab

