Logo Search packages:      
Sourcecode: valknut version File versions  Download package

void DCOptions::GetValues (  ) 

Definition at line 1548 of file dcoptions.cpp.

References SaveAutoResponses(), SaveSharedFolders(), SaveUserChatCommands(), and SaveUserMenuCommands().

Referenced by DCGuiApp::slotFileOptions().

{
      bool ok;

      g_pConfig->SetNick(LineEdit_NICK->text().ascii());
      g_pConfig->SetSearchNick(LineEdit_SEARCHNICK->text().ascii());
      g_pConfig->SetAwayMessage(TextEdit_AWAYMESSAGE->text().replace( QRegExp("\\n"), "\xd\xa" ).ascii());
      g_pConfig->SetDescription(LineEdit_DESCRIPTION->text().ascii());
      g_pConfig->SetAwayPrefix(LineEdit_AWAYPREFIX->text().ascii());
      g_pConfig->SetDescriptionTag(CheckBox_DESCRIPTION_TAG->isChecked());
      g_pConfig->SetUseExtendedHubCount(CheckBox_EXT_HUB_COUNT->isChecked());
      g_pConfig->SetEMail(LineEdit_EMAIL->text().ascii());
      g_pConfig->SetAntiSpam(CheckBox_ANTISPAM->isChecked());
      g_pConfig->SetCheckPrivateAddressSpace(CheckBox_CHECKPRIVATEADDRESSSPACE->isChecked());
      g_pConfig->SetShowChatSendButton(CheckBox_SHOWCHATSENDBUTTON->isChecked());
      g_pConfig->SetBrowser(LineEdit_BROWSER->text().ascii());
      g_pConfig->SetDynamicUploadRate(CheckBox_DYNAMICUPLOADRATE->isChecked());
      g_pConfig->SetShowChatInTab(CheckBox_SHOWCHATINTAB->isChecked());
      g_pConfig->SetChatMaxParagraph(SpinBox_CHATMAXPARAGRAPH->value());
      g_pConfig->SetTransferAutoSearch(CheckBox_TRANSFERAUTOSEARCH->isChecked());
      g_pConfig->SetDisableHashList(CheckBox_DISABLEHASHLIST->isChecked());
      g_pConfig->SetCompressedTransfers(CheckBox_COMPRESSEDTRANSFERS->isChecked());

      g_pConfig->SetUserPhotoFileName(ToolButton_PHOTO->textLabel().ascii());

      g_pConfig->SetSpeed(ComboBox_SPEED->currentText().ascii());
      g_pConfig->SetDefaultFBRemoteEncoding(ComboBox_DEFAULTRENCODING->currentText());
      g_pConfig->SetDownloadFolder(LineEdit_DOWNLOADFOLDER->text().ascii());
      g_pConfig->SetDownloadFinishedFolder(LineEdit_DOWNLOADFINISHEDFOLDER->text().ascii());
      g_pConfig->SetValknutDataPath(LineEdit_DATAFOLDER->text());
      
      g_pConfig->SetAutoRecreateShareList(CheckBox_AUTORECREATESHARELIST->isChecked());
      g_pConfig->SetDontShareDotFiles(CheckBox_DONTSHAREDOTFILES->isChecked());
      g_pConfig->SetRecreateShareListTime(SpinBox_RECREATESHARELISTTIME->value());

      g_pConfig->SetFloodOpKickMessage(LineEdit_FLOODOPKICKMESSAGE->text().replace( QRegExp("\\n"), "\xd\xa" ).ascii());
      g_pConfig->SetFloodCount(SpinBox_FLOODCOUNT->value());
      g_pConfig->SetFloodOpKick(CheckBox_FLOODOPKICK->isChecked());

      g_pConfig->SetTransferCert(LineEdit_TRANSFERCERT->text().ascii());
      g_pConfig->SetTransferKey(LineEdit_TRANSFERKEY->text().ascii());

      SaveSharedFolders();
      SaveUserMenuCommands();
      SaveUserChatCommands();

      g_pConfig->SetAutoResponderEnabled(CheckBox_ENABLE_AUTO_RESPONDER->isChecked());
      g_pConfig->SetAutoResponderEnabledForPM(CheckBox_ENABLE_AUTO_RESPONDER_FOR_PM->isChecked());
      g_pConfig->SetAutoResponseDelay(SpinBox_AUTORESPONSEDELAY->value());
      g_pConfig->SetAutoResponseIgnores(LineEdit_AUTO_RESPONSE_IGNORE->text().ascii());
      SaveAutoResponses();

      g_pConfig->SetMaxUpload( SpinBox_MAXSIMULTANEOUSUPLOADS->value() );
      g_pConfig->SetMaxUploadRate( floor((SpinBox_MAXUPLOADRATE->cleanText().toFloat()*1024)+0.5) );
      g_pConfig->SetMaxDownloadRate( floor((SpinBox_MAXDOWNLOADRATE->cleanText().toFloat()*1024)+0.5) );
      g_pConfig->SetDownloadQueueTime(SpinBox_SAVEDOWNLOADQUEUETIME->value());
      g_pConfig->SetAutoSearchInterval(SpinBox_AUTOSEARCHINTERVAL->value());
      g_pConfig->SetSmallFileSize(SpinBox_SMALLFILESIZE->value());

      g_pConfig->SetTCPListenPort(LineEdit_TCPLISTENPORT->text().toInt(&ok));
      g_pConfig->SetUDPListenPort(LineEdit_UDPLISTENPORT->text().toInt(&ok));
      g_pConfig->SetExternalIP(RadioButton_IPHOSTNAME->isOn());

      if ( RadioButton_ACTIVEMODE->isOn() )
            g_pConfig->SetMode(ecmACTIVE);
      else
            g_pConfig->SetMode(ecmPASSIVE);

      g_pConfig->SetHost(LineEdit_IP->text().ascii());
      g_pConfig->SetListenHost(LineEdit_LISTENIP->text().ascii());      
      g_pConfig->SetSendMessageOnActiveModeRequest(CheckBox_SENDMESSAGEONACTIVEMODEREQUEST->isChecked());

      // gui settings
      g_pConfig->SetOpenPrivateChatWindow(CheckBox_OPENPRIVATECHATWINDOW->isChecked());
      g_pConfig->SetEnableEmoticons(CheckBox_EMOTICONS->isChecked());

      if ( RadioButton_UNITBYTE->isChecked() )
            g_pConfig->SetUnit(euBYTE);
      else if ( RadioButton_UNITKBYTE->isChecked() )
            g_pConfig->SetUnit(euKBYTE);
      else if ( RadioButton_UNITMBYTE->isChecked() )
            g_pConfig->SetUnit(euMBYTE);
      else if ( RadioButton_UNITGBYTE->isChecked() )
            g_pConfig->SetUnit(euGBYTE);
      else
            g_pConfig->SetUnit(euAUTO);
      
      g_pConfig->SetTheme(ComboBox_THEME->currentText().ascii());
      g_pConfig->SetSendChat(ComboBox_SENDCHAT->currentText().ascii());
      g_pConfig->SetLanguageFile(LineEdit_LANGUAGEFILE->text().ascii());
      g_pConfig->SetShowStatusMessage(CheckBox_SHOWSTATUSMESSAGE->isChecked());
      g_pConfig->SetQueryOnExit(CheckBox_QUERYONEXIT->isChecked());
      g_pConfig->SetQueryOnFileDelete(CheckBox_QUERYONFILEDELETE->isChecked());
      g_pConfig->SetSendHidePrivateChatToPublicChat(CheckBox_SENDHIDEPRIVATECHATTOPUBLICCHAT->isChecked());
      g_pConfig->SetChatSendOfflineMessages(CheckBox_CHATSENDOFFLINEMESSAGES->isChecked());
      g_pConfig->SetChatRecvOfflineMessages(CheckBox_CHATRECVOFFLINEMESSAGES->isChecked());
      g_pConfig->SetChatMessageMaxLines( SpinBox_CHATMESSAGEMAXLINES->value() );
      g_pConfig->SetSuppressedNicks( LineEdit_SUPPRESS_NICKS->text() );

      // sound settings
      g_pConfig->SetSoundDisabled(CheckBox_SOUNDDISABLED->isChecked());
      g_pConfig->SetSoundDisabledAway(CheckBox_SOUNDDISABLEDAWAY->isChecked());

      g_pConfig->SetSoundEnabled(eusCONNECT,CheckBox_SOUNDPLAYCONNECT->isChecked());
      g_pConfig->SetSoundEnabled(eusDISCONNECT,CheckBox_SOUNDPLAYDISCONNECT->isChecked());
      g_pConfig->SetSoundEnabled(eusSEND,CheckBox_SOUNDPLAYSEND->isChecked());
      g_pConfig->SetSoundEnabled(eusRECEIVE,CheckBox_SOUNDPLAYRECEIVE->isChecked());
      g_pConfig->SetSoundEnabled(eusFIRSTRECEIVE,CheckBox_SOUNDPLAYFIRSTRECEIVE->isChecked());

      g_pConfig->SetExternalSoundPlayer(CheckBox_EXTERNALPLAYER->isChecked());
      g_pConfig->SetExternalPlayer(LineEdit_EXTERNALPLAYER->text().ascii());
      g_pConfig->SetSoundFile( eusCONNECT, LineEdit_SOUNDFILECONNECT->text().ascii());
      g_pConfig->SetSoundFile( eusDISCONNECT, LineEdit_SOUNDFILEDISCONNECT->text().ascii());
      g_pConfig->SetSoundFile( eusSEND, LineEdit_SOUNDFILESEND->text().ascii());
      g_pConfig->SetSoundFile( eusRECEIVE, LineEdit_SOUNDFILERECEIVE->text().ascii());
      g_pConfig->SetSoundFile( eusFIRSTRECEIVE, LineEdit_SOUNDFILEFIRSTRECEIVE->text().ascii());

      g_pConfig->SetAppFont(LineEdit_APPFONT->text().ascii());

      // gui->chat
      g_pConfig->SetChatShowJoinsAndParts(CheckBox_CHATSHOWJOINSANDPARTS->isChecked());
      g_pConfig->SetChatShowJoinsAndPartsOnlyFav(CheckBox_CHATSHOWJOINSANDPARTSONLYFAV->isChecked());
      
      // gui->client
      g_pConfig->SetOpenClientWindowsMinimized(CheckBox_CLIENTWINDOWSMINIMIZED->isChecked());
      g_pConfig->SetUserListRightAlignment(CheckBox_USERLISTRIGHTALIGNMENT->isChecked());
      g_pConfig->SetAutoAwayMode(CheckBox_AUTOAWAYMODE->isChecked());
      g_pConfig->SetAutoAwayTime(SpinBox_AUTOAWAYTIME->value());
      g_pConfig->SetClientColumn(eclcCOMMENT,CheckBox_CLIENTCOLUMNS_COMMENT->isChecked());
      g_pConfig->SetClientColumn(eclcTAG,CheckBox_CLIENTCOLUMNS_TAG->isChecked());
      g_pConfig->SetClientColumn(eclcSPEED,CheckBox_CLIENTCOLUMNS_SPEED->isChecked());
      g_pConfig->SetClientColumn(eclcEMAIL,CheckBox_CLIENTCOLUMNS_EMAIL->isChecked());
      g_pConfig->SetClientColumn(eclcSHARE,CheckBox_CLIENTCOLUMNS_SHARE->isChecked());
      g_pConfig->SetClientColumn(eclcIP,CheckBox_CLIENTCOLUMNS_IP->isChecked());
      g_pConfig->SetClientColumn(eclcLOCKPK,CheckBox_CLIENTCOLUMNS_LOCKPK->isChecked());
      g_pConfig->SetClientColumn(eclcSUPPORTS,CheckBox_CLIENTCOLUMNS_SUPPORTS->isChecked());
      g_pConfig->SetDoubleClickAction(ComboBox_DOUBLECLICK->currentText());
      
      // gui->icons
      if ( ComboBox_APPLICATION_ICONS->count() > 0 )
      {
            g_pConfig->SetApplicationIconTheme(ComboBox_APPLICATION_ICONS->currentText());
      }
      if ( ComboBox_EMOTICONS->count() > 0 )
      {
            g_pConfig->SetEmoticonTheme(ComboBox_EMOTICONS->currentText());
      }
      if ( ComboBox_USERLIST_ICONS->count() > 0 )
      {
            g_pConfig->SetUserListIconTheme(ComboBox_USERLIST_ICONS->currentText());
      }
      // reload icons with new theme
      g_pIconLoader->Load();
      
      // log settings
      g_pConfig->SetLogFile(CheckBox_LOGFILE->isChecked());
      g_pConfig->SetLogFinishedDownloads(CheckBox_LOGDOWNLOADS->isChecked());
      g_pConfig->SetLogFinishedUploads(CheckBox_LOGUPLOADS->isChecked());
      g_pConfig->SetLogDetails(CheckBox_LOGDETAILS->isChecked());
      g_pConfig->SetLogFileName( LineEdit_LOGFILENAME->text().ascii() );
      g_pConfig->SetTimeStamp(etsPRIVATECHAT,CheckBox_TIMESTAMPPRIVATECHAT->isChecked());
      g_pConfig->SetTimeStamp(etsHUBCHAT,CheckBox_TIMESTAMPHUBCHAT->isChecked());

      g_pConfig->SetLogChatOption(elcoENABLELOGGING, CheckBox_LOGCHAT_ENABLELOGGING->isChecked() );
      g_pConfig->SetLogChatOption(elcoAPPENDDATE, CheckBox_LOGCHAT_APPENDDATE->isChecked() );
      g_pConfig->SetLogChatOption(elcoAPPENDHUBNAME, CheckBox_LOGCHAT_APPENDHUBNAME->isChecked() );
      g_pConfig->SetLogChatOption(elcoAPPENDHUBHOST, CheckBox_LOGCHAT_APPENDHUBHOST->isChecked() );
      g_pConfig->SetLogChatOption(elcoDISABLEPUBLICCHAT, CheckBox_LOGCHAT_DISABLEPUBLICCHAT->isChecked() );
      g_pConfig->SetLogChatOption(elcoENABLENICKNAMEFILTER, CheckBox_LOGCHAT_ENABLENICKNAMEFILTER->isChecked() );
      g_pConfig->SetLogChatOption(elcoNICKNAMEFILTER_ENABLELOGGING, CheckBox_LOGCHAT_NICKNAMEFILTER_ENABLELOGGING->isChecked() );

      CList<CString> nnflist;
      uint i = 0;

      for(i=0;i<ListBox_LOGCHAT_NICKNAMEFILTER_LIST->count();i++)
      {
            nnflist.Add( new CString(ListBox_LOGCHAT_NICKNAMEFILTER_LIST->text(i).ascii()) );
      }

      g_pConfig->SetLogChatNickNameFilter( &nnflist );

      // other settings
      g_pConfig->SetHubListStoreLocal(CheckBox_HUBLISTSTORELOCAL->isChecked());
      g_pConfig->SetReconnectCount( SpinBox_RECONNECTCOUNT->value() );
      g_pConfig->SetReconnectTimeout( SpinBox_RECONNECTTIMEOUT->value() );
      g_pConfig->SetTransferResendTimeout(SpinBox_TRANSFERRESENDTIMEOUT->value());
      g_pConfig->SetTransferResponseTimeout(SpinBox_TRANSFERRESPONSETIMEOUT->value());
      g_pConfig->SetForceMoveEnabled(CheckBox_FORCEMOVEENABLED->isChecked());
      g_pConfig->SetReloadHubListTime(SpinBox_RELOADHUBLISTTIME->value());

      // transfer view settings
      g_pConfig->SetTransferViewOptions(etvoCHUNKPERCENT,CheckBox_TV_PERCENTCHUNK->isChecked());
      g_pConfig->SetTransferViewOptions(etvoFILEPERCENT,CheckBox_TV_PERCENTFILE->isChecked());
      g_pConfig->SetTransferViewOptions(etvoCHUNKSIZE,CheckBox_TV_CHUNKSIZE->isChecked());
      g_pConfig->SetTransferViewOptions(etvoFILESIZE,CheckBox_TV_FILESIZE->isChecked());
      g_pConfig->SetTransferViewOptions(etvoDOWNLOADRATESINGLE,CheckBox_TV_DOWNLOADRATESINGLE->isChecked());
      g_pConfig->SetTransferViewOptions(etvoELAPSEDTIMESINGLE,CheckBox_TV_ELAPSEDTIMESINGLE->isChecked());
      g_pConfig->SetTransferViewOptions(etvoDOWNLOADRATEMULTI,CheckBox_TV_DOWNLOADRATEMULTI->isChecked());
      g_pConfig->SetTransferViewOptions(etvoELAPSEDTIMEMULTI,CheckBox_TV_ELAPSEDTIMEMULTI->isChecked());
      g_pConfig->SetUserUploadSlots(SpinBox_USERUPLOADSLOTS->value());

        if ( RadioButton_NONE->isChecked() )
            g_pConfig->SetHubOfflineTransferClose( ectNONE );
      else if ( RadioButton_UPLOAD->isChecked() )
            g_pConfig->SetHubOfflineTransferClose( ectUPLD );
      else if ( RadioButton_DOWNLOAD->isChecked() )
            g_pConfig->SetHubOfflineTransferClose( ectDLD );
      else if ( RadioButton_BOTH->isChecked() )
            g_pConfig->SetHubOfflineTransferClose( ectBOTH );

      CList<DCConfigHubListUrl> hublisturllist;

      QCheckListItem * cli = (QCheckListItem*)ListView_HUBLISTURL->firstChild();

      while(cli)
      {
            DCConfigHubListUrl * hublisturl = new DCConfigHubListUrl();

            hublisturl->sUrl     = cli->text(0);
            hublisturl->bEnabled = cli->isOn();

            hublisturllist.Add(hublisturl);

            cli = (QCheckListItem*)cli->nextSibling();
      }

      g_pConfig->SetHubListUrlList(&hublisturllist);

      i=0;

      g_pConfig->SetChatColor(eccCHATTIMESTAMP,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATLOCALNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATLOCALTEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATREMOTENICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATREMOTETEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATSTATUSNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATSTATUSTEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATTIMESTAMP,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATLOCALNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATLOCALTEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATREMOTENICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATREMOTETEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATSTATUSNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATSTATUSTEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICPRIVATECHATNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICPRIVATECHATTEXT,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccCHATSAY,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccPUBLICCHATMENICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      g_pConfig->SetChatColor(eccOPNICK,QColor(ListBox_CHATCOLOR->item(i++)->pixmap()->convertToImage().pixel(0,0)).name().ascii());
      
      g_pConfig->SetRemoteEncoding(ComboBox_REMOTE_ENCODING->currentText().ascii());
      
      g_pConfig->SetFoldersInRightPane(CheckBox_FOLDERS_RIGHT_PANE->isChecked());
      g_pConfig->SetFolderSizesInLeftPane(CheckBox_SIZES_LEFT_PANE->isChecked());
}


Generated by  Doxygen 1.6.0   Back to index