Revision 1919
| trunk/nntpgrab_x64.nsi (revision 1919) | ||
|---|---|---|
| 83 | 83 |
File "dist\bin\libssp-0.dll" |
| 84 | 84 |
File "dist\bin\libstdc++-6.dll" |
| 85 | 85 |
File "dist\bin\libsoup-2.4-1.dll" |
| 86 |
File "dist\bin\libsoup-gnome-2.4-1.dll" |
|
| 87 |
File "dist\bin\libsqlite3-0.dll" |
|
| 88 |
File "dist\bin\libtasn1-3.dll" |
|
| 86 | 89 |
File "dist\bin\libxml2-2.dll" |
| 87 | 90 |
File "dist\bin\nntpgrab_gui.exe" |
| 88 | 91 |
File "dist\bin\nntpgrab_gui_debug.exe" |
| trunk/server/main.c (revision 1919) | ||
|---|---|---|
| 259 | 259 |
char *errors = NULL; |
| 260 | 260 |
char *warnings = NULL; |
| 261 | 261 |
NGConfigOpts opts; |
| 262 |
#ifdef WIN32 |
|
| 263 |
WORD wVersionRequested; |
|
| 264 |
WSADATA wsaData; |
|
| 265 |
int ret; |
|
| 266 |
#endif |
|
| 267 | 262 |
|
| 268 | 263 |
#if !defined(DARWIN) && !defined(WIN32) && !defined(ENABLE_GUI) |
| 269 | 264 |
gboolean do_fork = FALSE; |
| ... | ... | |
| 303 | 298 |
|
| 304 | 299 |
nntpgrab_utils_perform_base_initialization(); |
| 305 | 300 |
|
| 306 |
#ifdef WIN32 |
|
| 307 |
// exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the |
|
| 308 |
// program crashes a .RPT file will be created containing the backtrace |
|
| 309 |
LoadLibraryA("exchndl.dll");
|
|
| 310 |
|
|
| 311 |
// Initialise Winsock |
|
| 312 |
wVersionRequested = MAKEWORD(2, 2); |
|
| 313 |
|
|
| 314 |
ret = WSAStartup(wVersionRequested, &wsaData); |
|
| 315 |
if (ret != 0) {
|
|
| 316 |
/* Tell the user that we could not find a usable */ |
|
| 317 |
/* WinSock DLL. */ |
|
| 318 |
g_error(_("Winsock could not be initialised"));
|
|
| 319 |
return -1; |
|
| 320 |
} |
|
| 321 |
|
|
| 322 |
/* Confirm that the WinSock DLL supports 2.2. */ |
|
| 323 |
/* Note that if the DLL supports versions greater */ |
|
| 324 |
/* than 2.2 in addition to 2.2, it will still return */ |
|
| 325 |
/* 2.2 in wVersion since that is the version we */ |
|
| 326 |
/* requested. */ |
|
| 327 |
|
|
| 328 |
if (LOBYTE( wsaData.wVersion ) != 2 || |
|
| 329 |
HIBYTE( wsaData.wVersion ) != 2) {
|
|
| 330 |
/* Tell the user that we could not find a usable */ |
|
| 331 |
/* WinSock DLL. */ |
|
| 332 |
WSACleanup(); |
|
| 333 |
|
|
| 334 |
g_error(_("Winsock 2.2 or higher is required for this program"));
|
|
| 335 |
|
|
| 336 |
return -1; |
|
| 337 |
} |
|
| 338 |
#endif |
|
| 339 |
|
|
| 340 | 301 |
#ifdef ENABLE_GUI |
| 341 | 302 |
// Is there an graphical environment running? |
| 342 | 303 |
#if !defined(WIN32) && !defined(DARWIN) |
| trunk/server/nntpgrab_server_gtk.desktop (revision 1919) | ||
|---|---|---|
| 1 | 1 |
[Desktop Entry] |
| 2 | 2 |
Encoding=UTF-8 |
| 3 | 3 |
Name=NNTPGrab Server (GTK) |
| 4 |
GenericName=NNTPGrab Server (GTK) |
|
| 4 |
Name[nl]=NNTPGrab Server (GTK) |
|
| 5 |
Name[fr]=Serveur NNTPGrab (GTK) |
|
| 6 |
Name[tr]=NNTPGrab Sunucusu (GTK) |
|
| 7 |
GenericName=NNTPGrab Server (GTK) |
|
| 8 |
GenericName[nl]=NNTPGrab Server (GTK) |
|
| 9 |
GenericName[fr]=Serveur NNTPGrab (GTK) |
|
| 10 |
GenericName[tr]=NNTPGrab Sunucusu (GTK) |
|
| 5 | 11 |
Comment=Usenet download program |
| 12 |
Comment[nl]=Usenet download programma |
|
| 13 |
Comment[fr]=Logiciel de téléchargement depuis Usenet |
|
| 14 |
Comment[tr]=Usenet'ten dosya indirme programı |
|
| 6 | 15 |
Exec=nntpgrab_server_gtk |
| 7 | 16 |
Icon=nntpgrab.png |
| 8 | 17 |
Terminal=false |
| 9 |
MimeType= |
|
| 10 | 18 |
Type=Application |
| 11 | 19 |
Categories=Network; |
| trunk/server_qt/nntpgrab_qt.cpp (revision 1919) | ||
|---|---|---|
| 44 | 44 |
|
| 45 | 45 |
bool QNNTPGrab::init(char **errmsg, char **warnings) |
| 46 | 46 |
{
|
| 47 |
#ifdef WIN32 |
|
| 48 |
static bool winsock_initialized = false; |
|
| 49 |
WORD wVersionRequested; |
|
| 50 |
WSADATA wsaData; |
|
| 51 |
int ret; |
|
| 52 |
|
|
| 53 |
/* Initialize Winsock */ |
|
| 54 |
if (!winsock_initialized) {
|
|
| 55 |
winsock_initialized = true; |
|
| 56 |
|
|
| 57 |
wVersionRequested = MAKEWORD( 2, 2 ); |
|
| 58 |
|
|
| 59 |
ret = WSAStartup( wVersionRequested, &wsaData ); |
|
| 60 |
if ( ret != 0 ) {
|
|
| 61 |
/* Tell the user that we could not find a usable */ |
|
| 62 |
/* WinSock DLL. */ |
|
| 63 |
/* FIXME: Get rid of the GLib dependency */ |
|
| 64 |
#if 0 |
|
| 65 |
if (errmsg) {
|
|
| 66 |
*errmsg = g_strdup_printf(_("Winsock could not be initialised"));
|
|
| 67 |
} |
|
| 68 |
#endif |
|
| 69 |
return false; |
|
| 70 |
} |
|
| 71 |
|
|
| 72 |
/* Confirm that the WinSock DLL supports 2.2.*/ |
|
| 73 |
/* Note that if the DLL supports versions greater */ |
|
| 74 |
/* than 2.2 in addition to 2.2, it will still return */ |
|
| 75 |
/* 2.2 in wVersion since that is the version we */ |
|
| 76 |
/* requested. */ |
|
| 77 |
|
|
| 78 |
if ( LOBYTE( wsaData.wVersion ) != 2 || |
|
| 79 |
HIBYTE( wsaData.wVersion ) != 2 ) {
|
|
| 80 |
/* Tell the user that we could not find a usable */ |
|
| 81 |
/* WinSock DLL. */ |
|
| 82 |
WSACleanup( ); |
|
| 83 |
|
|
| 84 |
/* FIXME: Get rid of the GLib dependency */ |
|
| 85 |
#if 0 |
|
| 86 |
if (errmsg) {
|
|
| 87 |
*errmsg = g_strdup_printf(_("Winsock 2.2 or higher is required for this program"));
|
|
| 88 |
} |
|
| 89 |
#endif |
|
| 90 |
|
|
| 91 |
return false; |
|
| 92 |
} |
|
| 93 |
} |
|
| 94 |
#endif |
|
| 95 |
|
|
| 96 | 47 |
nntpgrab_utils_perform_base_initialization(); |
| 97 | 48 |
|
| 98 | 49 |
core = nntpgrab_core_new(); |
| trunk/server_qt/main.cpp (revision 1919) | ||
|---|---|---|
| 10 | 10 |
QApplication a(argc, argv); |
| 11 | 11 |
MainServerWindow w; |
| 12 | 12 |
|
| 13 |
#ifdef WIN32 |
|
| 14 |
// exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the |
|
| 15 |
// program crashes a .RPT file will be created containing the backtrace |
|
| 16 |
LoadLibraryA("exchndl.dll");
|
|
| 17 |
#endif |
|
| 18 |
|
|
| 19 | 13 |
w.show(); |
| 20 | 14 |
|
| 21 | 15 |
return a.exec(); |
| trunk/server_qt/server_qt.pro (revision 1919) | ||
|---|---|---|
| 13 | 13 |
../base \ |
| 14 | 14 |
../gui_base |
| 15 | 15 |
# The gui_base include is necessary for the icon_64x64.xpm file |
| 16 |
LIBS += -L../nntpgrab_core/.libs \ |
|
| 17 |
-lnntpgrab \ |
|
| 18 |
-L../base/.libs \ |
|
| 19 |
-lnntpgrab_utils |
|
| 20 | 16 |
|
| 21 |
win32* {
|
|
| 22 |
LIBS += -Wl,-subsystem,windows -lws2_32 |
|
| 17 |
contains(CONFIG, static):win32* {
|
|
| 18 |
LIBS += $$PWD/../nntpgrab_core/.libs/libnntpgrab.dll.a $$PWD/../base/.libs/libnntpgrab_utils.dll.a |
|
| 19 |
} else {
|
|
| 20 |
LIBS += -L../nntpgrab_core/.libs -lnntpgrab -L../base/.libs -lnntpgrab_utils |
|
| 23 | 21 |
} |
| 24 | 22 |
|
| 25 | 23 |
mac {
|
| trunk/server_qt/nntpgrab_server_qt.desktop (revision 1919) | ||
|---|---|---|
| 1 | 1 |
[Desktop Entry] |
| 2 | 2 |
Encoding=UTF-8 |
| 3 | 3 |
Name=NNTPGrab Server (Qt) |
| 4 |
GenericName=NNTPGrab Server (Qt) |
|
| 4 |
Name[nl]=NNTPGrab Server (Qt) |
|
| 5 |
Name[fr]=Serveur NNTPGrab (Qt) |
|
| 6 |
Name[tr]=NNTPGrab Sunucusu (Qt) |
|
| 7 |
GenericName=NNTPGrab Server (Qt) |
|
| 8 |
GenericName[nl]=NNTPGrab Server (Qt) |
|
| 9 |
GenericName[fr]=Serveur NNTPGrab (Qt) |
|
| 10 |
GenericName[tr]=NNTPGrab Sunucusu (Qt) |
|
| 5 | 11 |
Comment=Usenet download program |
| 12 |
Comment[nl]=Usenet download programma |
|
| 13 |
Comment[fr]=Logiciel de téléchargement depuis Usenet |
|
| 14 |
Comment[tr]=Usenet'ten dosya indirme programı |
|
| 6 | 15 |
Exec=nntpgrab_server_qt |
| 7 | 16 |
Icon=nntpgrab.png |
| 8 | 17 |
Terminal=false |
| trunk/plugins/counter/plugin_counter.c (revision 1919) | ||
|---|---|---|
| 121 | 121 |
NGList *servers; |
| 122 | 122 |
NGList *list; |
| 123 | 123 |
|
| 124 |
g_return_if_fail(plugin_data != NULL); |
|
| 124 |
g_return_val_if_fail(plugin_data != NULL, NULL); |
|
| 125 | 125 |
|
| 126 | 126 |
counter_data = (CounterData*) plugin_data->priv; |
| 127 | 127 |
|
| 128 |
g_return_if_fail(counter_data != NULL); |
|
| 128 |
g_return_val_if_fail(counter_data != NULL, NULL); |
|
| 129 | 129 |
|
| 130 | 130 |
builder_counter = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
|
| 131 | 131 |
g_variant_builder_add(builder_counter, "{sv}", "stamp_started", g_variant_new_uint64((guint64) counter_data->stamp_started));
|
| ... | ... | |
| 233 | 233 |
|
| 234 | 234 |
counter_data = (CounterData*) plugin_data->priv; |
| 235 | 235 |
|
| 236 |
g_return_if_fail(counter_data != NULL); |
|
| 236 |
g_return_val_if_fail(counter_data != NULL, FALSE); |
|
| 237 | 237 |
|
| 238 | 238 |
counter_data->stamp_started = time(NULL); |
| 239 | 239 |
|
| trunk/nntpgrab.nsi (revision 1919) | ||
|---|---|---|
| 80 | 80 |
File "dist\bin\QtNetwork4.dll" |
| 81 | 81 |
File "dist\bin\QtGui4.dll" |
| 82 | 82 |
File "dist\bin\libsoup-2.4-1.dll" |
| 83 |
File "dist\bin\libsoup-gnome-2.4-1.dll" |
|
| 84 |
File "dist\bin\libsqlite3-0.dll" |
|
| 85 |
File "dist\bin\libtasn1-3.dll" |
|
| 83 | 86 |
File "dist\bin\libxml2-2.dll" |
| 84 | 87 |
File "dist\bin\libstdc++-6.dll" |
| 85 | 88 |
File "dist\bin\nntpgrab_gui.exe" |
| trunk/base/ngobject.c (revision 1919) | ||
|---|---|---|
| 22 | 22 |
|
| 23 | 23 |
#include |
| 24 | 24 |
#include |
| 25 |
#include |
|
| 26 |
|
|
| 25 | 27 |
#include "nntpgrab_utils.h" |
| 26 | 28 |
|
| 27 | 29 |
#ifdef HAVE_SOUP |
| ... | ... | |
| 78 | 80 |
} |
| 79 | 81 |
#endif |
| 80 | 82 |
|
| 83 |
#ifdef _MSC_VER |
|
| 84 |
static void AppInvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved) |
|
| 85 |
{
|
|
| 86 |
fprintf(stderr, "Invalid parameter detected in function %s. File: %s Line: %d\n", function, file, line); |
|
| 87 |
fprintf(stderr, "Expression: %s\n", expression); |
|
| 88 |
|
|
| 89 |
/* Cause a Debug Breakpoint */ |
|
| 90 |
DebugBreak(); |
|
| 91 |
} |
|
| 92 |
#endif |
|
| 93 |
|
|
| 81 | 94 |
void nntpgrab_utils_perform_base_initialization(void) |
| 82 | 95 |
{
|
| 83 | 96 |
#if defined(WIN32) || defined(DARWIN) |
| 84 | 97 |
char *dirname; |
| 85 | 98 |
char *dirname2; |
| 99 |
WORD wVersionRequested; |
|
| 100 |
WSADATA wsaData; |
|
| 101 |
int ret; |
|
| 102 |
|
|
| 103 |
#ifdef _MSC_VER |
|
| 104 |
_set_invalid_parameter_handler(AppInvalidParameterHandler); |
|
| 105 |
#else |
|
| 106 |
/* exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the |
|
| 107 |
* program crashes a .RPT file will be created containing the backtrace */ |
|
| 108 |
LoadLibraryA("exchndl.dll");
|
|
| 86 | 109 |
#endif |
| 87 | 110 |
|
| 111 |
/* Initialise Winsock */ |
|
| 112 |
wVersionRequested = MAKEWORD(2, 2); |
|
| 113 |
|
|
| 114 |
ret = WSAStartup(wVersionRequested, &wsaData); |
|
| 115 |
if (ret != 0) {
|
|
| 116 |
/* Tell the user that we could not find a usable */ |
|
| 117 |
/* WinSock DLL. */ |
|
| 118 |
g_error(_("Winsock could not be initialised"));
|
|
| 119 |
return; |
|
| 120 |
} |
|
| 121 |
|
|
| 122 |
/* Confirm that the WinSock DLL supports 2.2. */ |
|
| 123 |
/* Note that if the DLL supports versions greater */ |
|
| 124 |
/* than 2.2 in addition to 2.2, it will still return */ |
|
| 125 |
/* 2.2 in wVersion since that is the version we */ |
|
| 126 |
/* requested. */ |
|
| 127 |
|
|
| 128 |
if (LOBYTE( wsaData.wVersion ) != 2 || |
|
| 129 |
HIBYTE( wsaData.wVersion ) != 2) {
|
|
| 130 |
/* Tell the user that we could not find a usable */ |
|
| 131 |
/* WinSock DLL. */ |
|
| 132 |
WSACleanup(); |
|
| 133 |
|
|
| 134 |
g_error(_("Winsock 2.2 or higher is required for this program"));
|
|
| 135 |
|
|
| 136 |
return; |
|
| 137 |
} |
|
| 138 |
#endif |
|
| 139 |
|
|
| 88 | 140 |
if (!g_thread_supported ()) g_thread_init (NULL); |
| 89 | 141 |
g_type_init(); |
| 90 | 142 |
|
| trunk/base/ipc_win32.c (revision 1919) | ||
|---|---|---|
| 115 | 115 |
return FALSE; |
| 116 | 116 |
} |
| 117 | 117 |
|
| 118 |
internal_open_nzb_callback = open_nzb_callback; |
|
| 119 |
internal_bring_to_front_callback = bring_to_front_callback; |
|
| 120 |
internal_user_data = user_data; |
|
| 121 |
|
|
| 118 | 122 |
/* Create the window */ |
| 119 | 123 |
if(!(win_hwnd = CreateWindow(wname, TEXT("NNTPGrabWin"), 0, 0, 0, 0, 0, NULL, NULL, /*get_hinstance()*/ NULL, 0))) { /* FIXME: get_hinstance() */
|
| 120 | 124 |
char *last_error_msg = g_win32_error_message(GetLastError()); |
| ... | ... | |
| 124 | 128 |
return FALSE; |
| 125 | 129 |
} |
| 126 | 130 |
|
| 127 |
internal_open_nzb_callback = open_nzb_callback; |
|
| 128 |
internal_bring_to_front_callback = bring_to_front_callback; |
|
| 129 |
internal_user_data = user_data; |
|
| 130 |
|
|
| 131 | 131 |
return TRUE; |
| 132 | 132 |
} |
| 133 | 133 |
|
| trunk/client/gui/plugins/Makefile.am (revision 1919) | ||
|---|---|---|
| 1 | 1 |
## Process this file with automake to produce Makefile.in |
| 2 | 2 |
include $(top_srcdir)/Makefile.decl |
| 3 | 3 |
|
| 4 |
if HAVE_LIBPEAS |
|
| 4 | 5 |
SUBDIRS = counter |
| 6 |
endif |
|
| 5 | 7 |
|
| trunk/client/gui/nntpgrab.desktop (revision 1919) | ||
|---|---|---|
| 1 | 1 |
[Desktop Entry] |
| 2 | 2 |
Encoding=UTF-8 |
| 3 | 3 |
Name=NNTPGrab |
| 4 |
Name[nl]=NNTPGrab |
|
| 5 |
Name[fr]=NNTPGrab |
|
| 6 |
Name[tr]=NNTPGrab |
|
| 4 | 7 |
GenericName=NNTPGrab |
| 8 |
GenericName[nl]=NNTPGrab |
|
| 9 |
GenericName[fr]=NNTPGrab |
|
| 10 |
GenericName[tr]=NNTPGrab |
|
| 5 | 11 |
Comment=Usenet download program |
| 12 |
Comment[nl]=Usenet download programma |
|
| 13 |
Comment[fr]=Logiciel de téléchargement depuis Usenet |
|
| 14 |
Comment[tr]=Usenet'ten dosya indirme programı |
|
| 6 | 15 |
Exec=nntpgrab_gui |
| 7 | 16 |
Icon=nntpgrab.png |
| 8 | 17 |
MimeType=application/x-nzb; |
| trunk/client/gui/main.c (revision 1919) | ||
|---|---|---|
| 170 | 170 |
GtkTreeModel *model; |
| 171 | 171 |
#endif |
| 172 | 172 |
|
| 173 |
#ifdef WIN32 |
|
| 174 |
WORD wVersionRequested; |
|
| 175 |
WSADATA wsaData; |
|
| 176 |
int ret; |
|
| 177 |
|
|
| 178 |
// Initialise Winsock |
|
| 179 |
wVersionRequested = MAKEWORD(2, 2); |
|
| 180 |
|
|
| 181 |
ret = WSAStartup(wVersionRequested, &wsaData); |
|
| 182 |
if (ret != 0) {
|
|
| 183 |
/* Tell the user that we could not find a usable */ |
|
| 184 |
/* WinSock DLL. */ |
|
| 185 |
g_error(_("Winsock could not be initialised"));
|
|
| 186 |
return -1; |
|
| 187 |
} |
|
| 188 |
|
|
| 189 |
/* Confirm that the WinSock DLL supports 2.2. */ |
|
| 190 |
/* Note that if the DLL supports versions greater */ |
|
| 191 |
/* than 2.2 in addition to 2.2, it will still return */ |
|
| 192 |
/* 2.2 in wVersion since that is the version we */ |
|
| 193 |
/* requested. */ |
|
| 194 |
|
|
| 195 |
if (LOBYTE( wsaData.wVersion ) != 2 || |
|
| 196 |
HIBYTE( wsaData.wVersion ) != 2) {
|
|
| 197 |
/* Tell the user that we could not find a usable */ |
|
| 198 |
/* WinSock DLL. */ |
|
| 199 |
WSACleanup(); |
|
| 200 |
|
|
| 201 |
g_error(_("Winsock 2.2 or higher is required for this program"));
|
|
| 202 |
|
|
| 203 |
return -1; |
|
| 204 |
} |
|
| 205 |
#endif |
|
| 206 |
|
|
| 207 | 173 |
gtk_widget_show(windowMain); |
| 208 | 174 |
|
| 209 | 175 |
#if GTK_CHECK_VERSION(3,0,0) |
| ... | ... | |
| 387 | 353 |
nntpgrab_glue_kill_server(glue); |
| 388 | 354 |
} |
| 389 | 355 |
|
| 390 |
#ifdef _MSC_VER |
|
| 391 |
void AppInvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved ) {
|
|
| 392 |
fprintf( |
|
| 393 |
stderr, |
|
| 394 |
"Invalid parameter detected in function %s. File: %s Line: %d\n", |
|
| 395 |
function, |
|
| 396 |
file, |
|
| 397 |
line |
|
| 398 |
); |
|
| 399 |
fprintf( |
|
| 400 |
stderr, |
|
| 401 |
"Expression: %s\n", |
|
| 402 |
expression |
|
| 403 |
); |
|
| 404 |
// Cause a Debug Breakpoint. |
|
| 405 |
DebugBreak(); |
|
| 406 |
} |
|
| 407 |
#endif |
|
| 408 |
|
|
| 409 | 356 |
gboolean |
| 410 | 357 |
gui_get_is_initialized() |
| 411 | 358 |
{
|
| ... | ... | |
| 607 | 554 |
const char *plugin_dir; |
| 608 | 555 |
#endif |
| 609 | 556 |
|
| 610 |
#ifdef WIN32 |
|
| 611 |
#ifdef _MSC_VER |
|
| 612 |
_set_invalid_parameter_handler(AppInvalidParameterHandler); |
|
| 613 |
#else |
|
| 614 |
// exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the |
|
| 615 |
// program crashes a .RPT file will be created containing the backtrace |
|
| 616 |
LoadLibraryA("exchndl.dll");
|
|
| 617 |
#endif |
|
| 618 |
#endif |
|
| 619 |
|
|
| 620 | 557 |
g_set_application_name("NNTPGrab");
|
| 621 | 558 |
g_set_prgname("NNTPGrab");
|
| 622 | 559 |
|
| trunk/client/gui_qt/nntpgrab_qt.desktop (revision 1919) | ||
|---|---|---|
| 1 | 1 |
[Desktop Entry] |
| 2 | 2 |
Encoding=UTF-8 |
| 3 | 3 |
Name=NNTPGrab (Qt) |
| 4 |
GenericName=NNTPGrab (Qt) |
|
| 4 |
Name[nl]=NNTPGrab (Qt) |
|
| 5 |
Name[fr]=NNTPGrab (Qt) |
|
| 6 |
Name[tr]=NNTPGrab (Qt) |
|
| 7 |
GenericName=NNTPGrab (Qt) |
|
| 8 |
GenericName[nl]=NNTPGrab (Qt) |
|
| 9 |
GenericName[fr]=NNTPGrab (Qt) |
|
| 10 |
GenericName[tr]=NNTPGrab (Qt) |
|
| 5 | 11 |
Comment=Usenet download program |
| 12 |
Comment[nl]=Usenet download programma |
|
| 13 |
Comment[fr]=Logiciel de téléchargement depuis Usenet |
|
| 14 |
Comment[tr]=Usenet'ten dosya indirme programı |
|
| 6 | 15 |
Exec=nntpgrab_gui_qt |
| 7 | 16 |
Icon=nntpgrab.png |
| 8 | 17 |
Terminal=false |
| 9 |
MimeType= |
|
| 10 | 18 |
Type=Application |
| 11 | 19 |
Categories=Network; |
| trunk/client/gui_qt/QNNTPGrabGlue_p.h (revision 1919) | ||
|---|---|---|
| 33 | 33 |
|
| 34 | 34 |
private: |
| 35 | 35 |
QNNTPGrabGlueThread *callbacks_thread; |
| 36 |
bool frontendIsRegistered; |
|
| 36 | 37 |
|
| 37 | 38 |
static void connectionLostWrapper(NntpgrabGlue *glue, const char *errmsg, void *data); |
| 38 | 39 |
static void configChangedWrapper(NntpgrabGlue *glue, void *data); |
| trunk/client/gui_qt/gui_qt.pro (revision 1919) | ||
|---|---|---|
| 115 | 115 |
$$PWD/../.. \ |
| 116 | 116 |
$$PWD/../../gui_base |
| 117 | 117 |
# The gui_base include is necessary for the icon_64x64.xpm file |
| 118 |
LIBS += -L$$PWD/../../glue/.libs \ |
|
| 119 |
-lnntpgrab_glue \ |
|
| 120 |
-L$$PWD/../../base/.libs \ |
|
| 121 |
-lnntpgrab_utils |
|
| 118 |
|
|
| 119 |
contains(CONFIG, static):win32* {
|
|
| 120 |
LIBS += $$PWD/../../glue/.libs/libnntpgrab_glue.dll.a $$PWD/../../base/.libs/libnntpgrab_utils.dll.a |
|
| 121 |
} else {
|
|
| 122 |
LIBS += -L$$PWD/../../glue/.libs \ |
|
| 123 |
-lnntpgrab_glue \ |
|
| 124 |
-L$$PWD/../../base/.libs \ |
|
| 125 |
-lnntpgrab_utils |
|
| 126 |
} |
|
| 122 | 127 |
versiontarget.target = $$PWD/update_version.sh |
| 123 | 128 |
versiontarget.commands = $$PWD/update_version.sh |
| 124 | 129 |
versiontarget.depends = FORCE |
| 125 | 130 |
PRE_TARGETDEPS += $$PWD/update_version.sh |
| 126 | 131 |
QMAKE_EXTRA_TARGETS += versiontarget |
| 127 |
win32*:LIBS += -Wl,-subsystem,windows \ |
|
| 128 |
-lws2_32 |
|
| 129 | 132 |
mac:LIBS += -framework AppKit \ |
| 130 | 133 |
-framework Carbon \ |
| 131 | 134 |
-framework SystemConfiguration \ |
| trunk/client/gui_qt/mainwindow.cpp (revision 1919) | ||
|---|---|---|
| 28 | 28 |
|
| 29 | 29 |
ui->setupUi(this); |
| 30 | 30 |
|
| 31 |
/* Disable/enable the 'Kill the NNTPGrab Server' menu option depending |
|
| 32 |
* on whether we're connected to a NNTPGrab Server or not */ |
|
| 33 |
ui->actionKillNNTPGrabServer->setEnabled(!glue->getIsStandalone()); |
|
| 34 |
|
|
| 31 | 35 |
/* Create the individual tabs */ |
| 32 | 36 |
updateInfoWidget = new WidgetUpdateInfo(); |
| 33 | 37 |
ui->tabWidget->addTab(updateInfoWidget, tr("Information"));
|
| ... | ... | |
| 89 | 93 |
connect(ui->actionEnableAutomaticShutdown, SIGNAL(triggered(void)), |
| 90 | 94 |
SLOT(actionEnableAutomaticShutdown_activated())); |
| 91 | 95 |
|
| 96 |
connect(ui->actionKillNNTPGrabServer, SIGNAL(triggered(bool)), |
|
| 97 |
SLOT(actionKillNNTPGrabServer_activated(void))); |
|
| 92 | 98 |
connect(ui->actionManagePlugins, SIGNAL(triggered(void)), |
| 93 | 99 |
SLOT(actionManagePlugins_activated(void))); |
| 94 | 100 |
connect(ui->actionShowDebugWindow, SIGNAL(triggered(void)), |
| ... | ... | |
| 225 | 231 |
} |
| 226 | 232 |
} |
| 227 | 233 |
|
| 234 |
void MainWindow::actionKillNNTPGrabServer_activated(void) |
|
| 235 |
{
|
|
| 236 |
glue->killNNTPGrabServer(); |
|
| 237 |
close(); |
|
| 238 |
} |
|
| 239 |
|
|
| 228 | 240 |
void MainWindow::actionManagePlugins_activated(void) |
| 229 | 241 |
{
|
| 230 | 242 |
DialogManagePlugins d(glue); |
| trunk/client/gui_qt/QNNTPGrabGlue.h (revision 1919) | ||
|---|---|---|
| 158 | 158 |
bool init(QString hostname, int port, QString username, QString password, bool use_ssl, QString &errmsg, QString &warnings); |
| 159 | 159 |
bool getIsConnected(); |
| 160 | 160 |
bool getIsStandalone(); |
| 161 |
void killNNTPGrabServer(); |
|
| 161 | 162 |
|
| 162 | 163 |
QList |
| 163 | 164 |
bool configGetServerInfo(QString servername, QNNTPGrabGlue::ConfigServer &server); |
| trunk/client/gui_qt/update_version.sh (revision 1919) | ||
|---|---|---|
| 20 | 20 |
mv tmp $SVN_REV_FILE |
| 21 | 21 |
sed s/exported/0/ $SVN_REV_FILE > tmp |
| 22 | 22 |
mv tmp $SVN_REV_FILE |
| 23 |
sed s/'Unversioned directory'/0/ $(SVN_REV_FILE) > tmp; \ |
|
| 23 |
sed s/'Unversioned directory'/0/ $SVN_REV_FILE > tmp; \ |
|
| 24 | 24 |
mv tmp $(SVN_REV_FILE); \ |
| 25 | 25 |
sed s/M.*// $SVN_REV_FILE > tmp |
| 26 | 26 |
mv tmp $SVN_REV_FILE |
| ... | ... | |
| 28 | 28 |
*) |
| 29 | 29 |
sed -i.backup s/:.*// $SVN_REV_FILE |
| 30 | 30 |
sed -i.backup s/exported/0/ $SVN_REV_FILE |
| 31 |
sed -i.backup s/'Unversioned directory'/0/ $(SVN_REV_FILE); \ |
|
| 31 |
sed -i.backup s/'Unversioned directory'/0/ $SVN_REV_FILE; \ |
|
| 32 | 32 |
sed -i.backup s/M.*// $SVN_REV_FILE |
| 33 | 33 |
;; |
| 34 | 34 |
esac |
| trunk/client/gui_qt/DownloadQueueModel.cpp (revision 1919) | ||
|---|---|---|
| 1 | 1 |
#include "DownloadQueueModel.h" |
| 2 |
#include |
|
| 2 | 3 |
|
| 3 | 4 |
DownloadQueueModel::DownloadQueueModel(QNNTPGrabGlue *glue, QObject *parent) : |
| 4 | 5 |
QAbstractItemModel(parent) |
| ... | ... | |
| 253 | 254 |
int ret = (((double)size - sizeRemaining) / size) * 100; |
| 254 | 255 |
|
| 255 | 256 |
if (ret < 0 || ret > 100) {
|
| 256 |
qDebug("Invalid progress detected, size = %lli, size_remaining = %lli", size, sizeRemaining);
|
|
| 257 |
qDebug() << "Invalid progress detected, size = " << size << ", size_remaining = " << sizeRemaining; |
|
| 257 | 258 |
if (ret < 0) {
|
| 258 | 259 |
ret = 0; |
| 259 | 260 |
} |
| trunk/client/gui_qt/mainwindow.ui (revision 1919) | ||
|---|---|---|
| 74 | 74 |
|
| 75 | 75 |
|
| 76 | 76 |
|
| 77 |
|
|
| 77 |
|
|
| 78 | 78 |
|
| 79 | 79 |
|
| 80 | 80 |
|
| 81 | 81 |
|
| 82 | 82 |
|
| 83 | 83 |
|
| 84 |
|
|
| 84 | 85 |
|
| 85 | 86 |
|
| 86 | 87 |
|
| ... | ... | |
| 202 | 203 |
|
| 203 | 204 |
|
| 204 | 205 |
|
| 206 |
|
|
| 207 |
|
|
| 208 |
|
|
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 205 | 214 |
|
| 206 | 215 |
|
| 207 | 216 |
|
| trunk/client/gui_qt/QNNTPGrabGlue.cpp (revision 1919) | ||
|---|---|---|
| 31 | 31 |
|
| 32 | 32 |
QNNTPGrabGluePrivate::QNNTPGrabGluePrivate(QNNTPGrabGlue *parent) : q_ptr(parent) |
| 33 | 33 |
{
|
| 34 |
this->frontendIsRegistered = false; |
|
| 34 | 35 |
} |
| 35 | 36 |
|
| 36 | 37 |
QNNTPGrabGluePrivate::~QNNTPGrabGluePrivate() |
| ... | ... | |
| 367 | 368 |
return nntpgrab_glue_get_is_standalone(d->glue); |
| 368 | 369 |
} |
| 369 | 370 |
|
| 371 |
void QNNTPGrabGlue::killNNTPGrabServer() |
|
| 372 |
{
|
|
| 373 |
Q_D(QNNTPGrabGlue); |
|
| 374 |
return nntpgrab_glue_kill_server(d->glue); |
|
| 375 |
} |
|
| 376 |
|
|
| 370 | 377 |
QList |
| 371 | 378 |
{
|
| 372 | 379 |
Q_D(QNNTPGrabGlue); |
| ... | ... | |
| 979 | 986 |
Q_D(QNNTPGrabGlue); |
| 980 | 987 |
|
| 981 | 988 |
char *errmsg_tmp = NULL; |
| 982 |
bool ret; |
|
| 983 | 989 |
|
| 984 |
ret = nntpgrab_utils_register_frontend(d->requestOpenNZBFileWrapper, d->requestBringToFrontWrapper, this, &errmsg_tmp); |
|
| 990 |
if (d->frontendIsRegistered) {
|
|
| 991 |
return true; |
|
| 992 |
} |
|
| 985 | 993 |
|
| 986 |
if (!ret) {
|
|
| 994 |
d->frontendIsRegistered = nntpgrab_utils_register_frontend(d->requestOpenNZBFileWrapper, d->requestBringToFrontWrapper, this, &errmsg_tmp); |
|
| 995 |
|
|
| 996 |
if (!d->frontendIsRegistered) {
|
|
| 987 | 997 |
errmsg.clear(); |
| 988 | 998 |
errmsg.append(errmsg_tmp); |
| 989 | 999 |
ng_free(errmsg_tmp); |
| 990 | 1000 |
return FALSE; |
| 991 | 1001 |
} |
| 992 | 1002 |
|
| 993 |
return ret; |
|
| 1003 |
return d->frontendIsRegistered; |
|
| 994 | 1004 |
} |
| 995 | 1005 |
|
| 996 | 1006 |
void QNNTPGrabGlue::utilsUnregisterFrontend(void) |
| 997 | 1007 |
{
|
| 1008 |
Q_D(QNNTPGrabGlue); |
|
| 1009 |
|
|
| 998 | 1010 |
nntpgrab_utils_unregister_frontend(); |
| 1011 |
d->frontendIsRegistered = false; |
|
| 999 | 1012 |
} |
| 1000 | 1013 |
|
| 1001 | 1014 |
bool QNNTPGrabGlue::utilsSendOpenNzbFileRequest(QString nzb_file, QString &errmsg) |
| trunk/client/gui_qt/mainwindow.h (revision 1919) | ||
|---|---|---|
| 69 | 69 |
void actionImportNZB_activated(void); |
| 70 | 70 |
void actionDonate_activated(void); |
| 71 | 71 |
void actionEnableAutomaticShutdown_activated(void); |
| 72 |
void actionKillNNTPGrabServer_activated(void); |
|
| 72 | 73 |
void actionManagePlugins_activated(void); |
| 73 | 74 |
void actionShowDebugWindow_activated(void); |
| 74 | 75 |
void actionPauseDownloadQueue_activated(void); |
| trunk/client/gui_qt/main.cpp (revision 1919) | ||
|---|---|---|
| 21 | 21 |
qInstallMsgHandler(messagehandler); |
| 22 | 22 |
NGApplication a(argc, argv); |
| 23 | 23 |
|
| 24 |
#ifdef WIN32 |
|
| 25 |
/* Initialise Winsock */ |
|
| 26 |
WORD wVersionRequested; |
|
| 27 |
WSADATA wsaData; |
|
| 28 |
int ret; |
|
| 29 |
|
|
| 30 |
wVersionRequested = MAKEWORD(2, 2); |
|
| 31 |
|
|
| 32 |
ret = WSAStartup(wVersionRequested, &wsaData); |
|
| 33 |
if (ret != 0) {
|
|
| 34 |
/* Tell the user that we could not find a usable */ |
|
| 35 |
/* WinSock DLL. */ |
|
| 36 |
qWarning(QObject::tr("Winsock could not be initialised").toUtf8().data());
|
|
| 37 |
return -1; |
|
| 38 |
} |
|
| 39 |
|
|
| 40 |
/* Confirm that the WinSock DLL supports 2.2. */ |
|
| 41 |
/* Note that if the DLL supports versions greater */ |
|
| 42 |
/* than 2.2 in addition to 2.2, it will still return */ |
|
| 43 |
/* 2.2 in wVersion since that is the version we */ |
|
| 44 |
/* requested. */ |
|
| 45 |
|
|
| 46 |
if (LOBYTE( wsaData.wVersion ) != 2 || |
|
| 47 |
HIBYTE( wsaData.wVersion ) != 2) {
|
|
| 48 |
/* Tell the user that we could not find a usable */ |
|
| 49 |
/* WinSock DLL. */ |
|
| 50 |
WSACleanup(); |
|
| 51 |
|
|
| 52 |
qWarning(QObject::tr("Winsock 2.2 or higher is required for this program").toUtf8().data());
|
|
| 53 |
|
|
| 54 |
return -1; |
|
| 55 |
} |
|
| 56 |
|
|
| 57 |
// exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the |
|
| 58 |
// program crashes a .RPT file will be created containing the backtrace |
|
| 59 |
LoadLibraryA("exchndl.dll");
|
|
| 60 |
#endif |
|
| 61 |
|
|
| 62 | 24 |
QNNTPGrabGlue::utilsPerformBaseInitialization(); |
| 63 | 25 |
|
| 64 | 26 |
/* Verify that there's no other instance of NNTPGrab running already */ |
| trunk/client/gui_qt/QtSolutions/qtlocalpeer.cpp (revision 1919) | ||
|---|---|---|
| 57 | 57 |
static PProcessIdToSessionId pProcessIdToSessionId = 0; |
| 58 | 58 |
#endif |
| 59 | 59 |
#if defined(Q_OS_UNIX) |
| 60 |
#include |
|
| 61 |
#include |
|
| 60 | 62 |
#include |
| 61 | 63 |
#endif |
| 62 | 64 |
|
Also available in: Unified diff
NNTPGrab

