Shuffle and NSTrack option saving fix

This commit is contained in:
cora48 2015-03-23 12:37:02 +03:00
parent b70c77ecbd
commit fdfd38b0f7
3 changed files with 53 additions and 57 deletions

View File

@ -150,17 +150,6 @@ class Connector_old
public: public:
int _Updater(); int _Updater();
// lopaStr _FTPLobby(char *ip,
// int port,
// PathStr *ps);
// lopaStr _BALobby(char *cookie,
// char *ip,
// int port,
// char *path,
// char *method,
// char *data);
lopaStr _WFLobby(char *cookie, lopaStr _WFLobby(char *cookie,
char *ip, char *ip,
int port, int port,
@ -187,5 +176,3 @@ public:
extern lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC); extern lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC);
//extern lopaStr _BALobby(char *cookie, char *ip, int port, char *path, char *method);
//extern lopaStr _FTPLobby(char *ip, int port, PathStr *ps);

View File

@ -3126,9 +3126,15 @@ void RestoreSession()
PortString.replace("\n", ""); PortString.replace("\n", "");
if(PortString.length() > 0) {
ui->lineEditPort->setText(PortString); ui->lineEditPort->setText(PortString);
ui->portLine->setText(PortString); ui->portLine->setText(PortString);
ui->importPorts->setText(PortString); ui->importPorts->setText(PortString);
} else {
ui->lineEditPort->setText(PORTSET);
ui->portLine->setText(PORTSET);
ui->importPorts->setText(PORTSET);
}
delete []fPorts; delete []fPorts;
} }
@ -3136,6 +3142,7 @@ void RestoreSession()
{ {
ui->lineEditPort->setText(PORTSET); ui->lineEditPort->setText(PORTSET);
ui->portLine->setText(PORTSET); ui->portLine->setText(PORTSET);
ui->importPorts->setText(PORTSET);
}; };
}; };
@ -3150,6 +3157,22 @@ void RestoreSession()
lex[strlen(lex) - 1] = '\0'; lex[strlen(lex) - 1] = '\0';
ui->pingingOnOff->setChecked(strcmp(lex, "true") == 0 ? true : false); ui->pingingOnOff->setChecked(strcmp(lex, "true") == 0 ? true : false);
}; };
} else if (strstr(resStr, "[SHUFFLE]:") != NULL) {
lex = strstr(resStr, "[SHUFFLE]:") + strlen("[SHUFFLE]:");
if (strlen(lex) > 1)
{
lex[strlen(lex) - 1] = '\0';
ui->shuffle_onoff->setChecked(strcmp(lex, "true") == 0 ? true : false);
};
} else if (strstr(resStr, "[NSTRACK]:") != NULL) {
lex = strstr(resStr, "[NSTRACK]:") + strlen("[NSTRACK]:");
if (strlen(lex) > 1)
{
lex[strlen(lex) - 1] = '\0';
ui->trackerOnOff->setChecked(strcmp(lex, "true") == 0 ? true : false);
};
} }
setUIText("[PING_TO]:", ui->PingTO, resStr); setUIText("[PING_TO]:", ui->PingTO, resStr);
setUIText("[THREAD_DELAY]:", ui->threadDelayBox, resStr); setUIText("[THREAD_DELAY]:", ui->threadDelayBox, resStr);

View File

@ -245,69 +245,55 @@ void _SaveBackupToFile()
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
}; };
strcpy(saveStr, "[NDBSERVER]:"); sprintf(saveStr, "[NDBSERVER]:%s\n", trcSrv);
strcat(saveStr, trcSrv);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[NDBSCRIPT]:"); sprintf(saveStr, "[NDBSCRIPT]:%s\n", trcScr);
strcat(saveStr, trcScr);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[NDBPORT]:"); sprintf(saveStr, "[NDBPORT]:%s\n", trcSrvPortLine);
strcat(saveStr, trcSrvPortLine);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PROXY]:"); sprintf(saveStr, "[PROXY]:%s\n", trcProxy);
strcat(saveStr, trcProxy);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PROXYPORT]:"); sprintf(saveStr, "[PROXYPORT]:%s\n", trcPort);
strcat(saveStr, trcPort);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCSERVER]:"); sprintf(saveStr, "[IRCSERVER]:%s\n", ircServer);
strcat(saveStr, ircServer);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPORT]:"); sprintf(saveStr, "[IRCPORT]:%s\n", ircPort);
strcat(saveStr, ircPort);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPROXY]:"); sprintf(saveStr, "[IRCPROXY]:%s\n", ircProxy);
strcat(saveStr, ircProxy);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPROXYPORT]:"); sprintf(saveStr, "[IRCPROXYPORT]:%s\n", ircProxyPort);
strcat(saveStr, ircProxyPort);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCNICK]:"); sprintf(saveStr, "[IRCNICK]:%s\n", ircNick);
strcat(saveStr, ircNick);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PING]:"); sprintf(saveStr, "[PING]:%s\n", gPingNScan ? "true" : "false");
strcat(saveStr, gPingNScan ? "true" : "false"); strcat(saveBuffer, saveStr);
strcat(saveStr, "\n"); ZeroMemory(saveStr, sizeof(saveStr));
sprintf(saveStr, "[SHUFFLE]:%s\n", gShuffle ? "true" : "false");
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
sprintf(saveStr, "[NSTRACK]:%s\n", trackerOK ? "true" : "false");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));