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

void DCOptions::InitDocument (  ) 

Definition at line 96 of file dcoptions.cpp.

References plviAutoResponse, plviConnection, plviConnectionMode, plviConnectionSettings, plviDCGUI, plviDCGUIIdentify, plviEncoding, plviGUI, plviGUIChat, plviGUICommands, plviGUIFilelistBrowser, plviGUIGeneral, plviGUIIcons, plviGUIMenus, plviGUITransfer, plviGUIUser, plviLog, plviOther, plviSecurity, plviSound, plviTransfer, plviTransferFolder, plviTransferSettings, setupIconThemeComboBoxes(), slotAddHubListUrl(), slotAddSharedFolder(), slotAutoAwayMode(), slotBrowseAppFont(), slotBrowseBrowser(), slotBrowseDataFolder(), slotBrowseDownloadFinishedFolder(), slotBrowseDownloadFolder(), slotBrowseLanguageFile(), slotBrowseLogFile(), slotBrowseShareList(), slotBrowseSoundFileConnect(), slotBrowseSoundFileDisconnect(), slotBrowseSoundFileFirstReceive(), slotBrowseSoundFileReceive(), slotBrowseSoundFileSend(), slotBrowseSoundPlayer(), slotBrowseTransferCert(), slotBrowseTransferKey(), slotChangePhoto(), slotContextMenuAutoResponses(), slotContextMenuUserChatCommands(), slotContextMenuUserMenuCommands(), slotCreateShareList(), slotDisableSound(), slotDontShareDotFilesChanged(), slotDoubleClickedChatColor(), slotEditHubListUrl(), slotEditSharedFolder(), slotEnableShowJoinsParts(), slotExternalPlayer(), slotGenerateKeyCert(), slotGetInterface(), slotGetInternetIP(), slotINTERFACEChange(), slotIPHOSTNAMEChange(), slotListViewOptionClicked(), slotLogChatAddNickNameFilter(), slotLogChatDelNickNameFilter(), slotLogChatEnableLogging(), slotLogChatEnableNickNameFilter(), slotModeActiveChange(), slotModePassiveChange(), slotPreviewSoundFileConnect(), slotPreviewSoundFileDisconnect(), slotPreviewSoundFileFirstReceive(), slotPreviewSoundFileReceive(), slotPreviewSoundFileSend(), slotRemoveHubListUrl(), slotRemoveSharedFolder(), slotSave(), slotSelectLanguage(), slotSetTheme(), slotShareListInfo(), slotSoundPlayConnect(), slotSoundPlayDisconnect(), slotSoundPlayFirstReceive(), slotSoundPlayRecieve(), slotSoundPlaySend(), and slotTestHost().

Referenced by DCOptions().

{
      QTextCodec *codec;
      QStringList codecList;
      int i;
      
      // insert speed
      ComboBox_SPEED->insertItem( "28.8Kbps" );
      ComboBox_SPEED->insertItem( "33.6Kbps" );
      ComboBox_SPEED->insertItem( "56Kbps" );
      ComboBox_SPEED->insertItem( "Modem" );
      ComboBox_SPEED->insertItem( "Satellite" );
      ComboBox_SPEED->insertItem( "ISDN" );
      ComboBox_SPEED->insertItem( "DSL" );
      ComboBox_SPEED->insertItem( "Cable" );
      ComboBox_SPEED->insertItem( "LAN(T1)" );
      ComboBox_SPEED->insertItem( "LAN(T3)" );
      ComboBox_SPEED->insertItem( "Microwave" );
      ComboBox_SPEED->insertItem( "Wireless" );
      ComboBox_SPEED->insertItem( "0.005" );
      ComboBox_SPEED->insertItem( "0.01" );
      ComboBox_SPEED->insertItem( "0.02" );
      ComboBox_SPEED->insertItem( "0.05" );
      ComboBox_SPEED->insertItem( "0.1" );
      ComboBox_SPEED->insertItem( "0.2" );
      ComboBox_SPEED->insertItem( "0.5" );
      ComboBox_SPEED->insertItem( "1" );
      ComboBox_SPEED->insertItem( "2" );
      ComboBox_SPEED->insertItem( "5" );
      ComboBox_SPEED->insertItem( "10" );
      ComboBox_SPEED->insertItem( "20" );
      ComboBox_SPEED->insertItem( "50" );
      ComboBox_SPEED->insertItem( "100" );
      
      // remote filelist browser default encoding combo box
      for (i=0;(codec = QTextCodec::codecForIndex(i));i++)
      {
            codecList << codec->name();
      }

      codecList.sort();
      ComboBox_DEFAULTRENCODING->insertItem("DEFAULT");
      ComboBox_DEFAULTRENCODING->insertStringList(codecList);
      
      ComboBox_REMOTE_ENCODING->insertItem("UTF-8");
      ComboBox_REMOTE_ENCODING->insertItem("WINDOWS-1252");
      ComboBox_REMOTE_ENCODING->insertItem("WINDOWS-1251");
      ComboBox_REMOTE_ENCODING->insertItem("WINDOWS-1256");
      ComboBox_REMOTE_ENCODING->insertItem("WINDOWS-1257");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-8859-1");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-8859-2");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-8859-7");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-8859-8");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-8859-9");
      ComboBox_REMOTE_ENCODING->insertItem("ISO-2022-JP");
      ComboBox_REMOTE_ENCODING->insertItem("SHIFT-JIS");
      ComboBox_REMOTE_ENCODING->insertItem("CP949");
      ComboBox_REMOTE_ENCODING->insertItem("KOI8-R");
      ComboBox_REMOTE_ENCODING->insertItem("GB18030");
      ComboBox_REMOTE_ENCODING->insertItem("TIS-620");
      
      // set width mode
      ListView_OPTIONTREE->setColumnWidthMode( 0, QListView::Maximum );
      // hide the column header
      ListView_OPTIONTREE->header()->hide();
      // disable sort
      ListView_OPTIONTREE->setSorting(-1);

      // setup spin boxes
      SpinBox_MAXUPLOADRATE->setMinValue(0);
      SpinBox_MAXUPLOADRATE->setMaxValue(99999999);
      SpinBox_MAXDOWNLOADRATE->setMinValue(0);
      SpinBox_MAXDOWNLOADRATE->setMaxValue(99999999);
      SpinBox_AUTOSEARCHINTERVAL->setMinValue(60);     // one minute
      SpinBox_AUTOSEARCHINTERVAL->setMaxValue(604800); // one week
      SpinBox_SMALLFILESIZE->setMinValue(1024);        // 1KiB
      SpinBox_SMALLFILESIZE->setMaxValue(104857600);   // 100MiB
      SpinBox_AUTORESPONSEDELAY->setMinValue(0);
      SpinBox_AUTORESPONSEDELAY->setMaxValue(3600);

      // set up icons theme lists
      setupIconThemeComboBoxes();

      // setup the option tree
      plviEncoding = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviEncoding->setText(0, tr( "Encoding" ) );
      
      plviAutoResponse = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviAutoResponse->setText(0, tr( "Auto Responses" ) );
      
      plviSecurity = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviSecurity->setText( 0, tr( "Security" ) );

      plviOther = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviOther->setText( 0, tr( "Hub Lists" ) );

      plviLog = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviLog->setText( 0, tr( "Log" ) );

      plviSound = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviSound->setText( 0, tr( "Sound" ) );

      plviGUI = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviGUI->setText( 0, tr( "GUI" ) );
      plviGUI->setOpen( true );
      plviGUIFilelistBrowser = new QListViewItem( plviGUI, 0 );
      plviGUIFilelistBrowser->setText(0, tr( "Filelist browser" ) );
      plviGUIIcons =  new QListViewItem( plviGUI, 0 );
      plviGUIIcons->setText(0, tr ( "Icons" ) );
      plviGUIUser = new QListViewItem( plviGUI, 0 );
      plviGUIUser->setText( 0, tr( "User" ) );
      plviGUIMenus = new QListViewItem( plviGUI, 0 );
      plviGUIMenus->setText(0, tr( "Menus" ) );
      plviGUICommands = new QListViewItem( plviGUI, 0 );
      plviGUICommands->setText( 0, tr( "Commands" ) );
      plviGUIChat = new QListViewItem( plviGUI, 0 );
      plviGUIChat->setText( 0, tr( "Chat" ) );
      plviGUITransfer = new QListViewItem( plviGUI, 0 );
      plviGUITransfer->setText( 0, tr( "Transfer" ) );
      plviGUIGeneral = new QListViewItem( plviGUI, 0 );
      plviGUIGeneral->setText( 0, tr( "General" ) );

      plviConnection = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviConnection->setText( 0, tr( "Connection" ) );
      plviConnection->setOpen( true );
      plviConnectionSettings = new QListViewItem( plviConnection, 0 );
      plviConnectionSettings->setText( 0, tr( "Settings" ) );
      plviConnectionMode = new QListViewItem( plviConnection, 0 );
      plviConnectionMode->setText( 0, tr( "Mode" ) );

      plviTransfer = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviTransfer->setText( 0, tr( "Transfer" ) );
      plviTransfer->setOpen( true );
      plviTransferSettings = new QListViewItem( plviTransfer, 0 );
      plviTransferSettings->setText( 0, tr( "Settings" ) );
      plviTransferFolder = new QListViewItem( plviTransfer, 0 );
      plviTransferFolder->setText( 0, tr( "Folder" ) );

      plviDCGUI = new QListViewItem( ListView_OPTIONTREE, 0 );
      plviDCGUI->setText( 0, tr( "Valknut" ) );
      plviDCGUI->setOpen( true );
      plviDCGUIIdentify = new QListViewItem( plviDCGUI, 0 );
      plviDCGUIIdentify->setText( 0, tr( "Identify" ) );

      connect( ToolButton_PHOTO, SIGNAL(clicked()), this, SLOT(slotChangePhoto()) );

      connect( ListView_OPTIONTREE, SIGNAL(clicked( QListViewItem * )), this, SLOT(slotListViewOptionClicked( QListViewItem * )) );
      
      connect( listView_MENU_COMMANDS, SIGNAL(contextMenuRequested( QListViewItem *, const QPoint &, int )), this, SLOT(slotContextMenuUserMenuCommands(QListViewItem *, const QPoint &, int)));
      listView_MENU_COMMANDS->setDefaultRenameAction( QListView::Accept );
      listView_MENU_COMMANDS->setShowSortIndicator( TRUE );
      
      connect( listView_CHAT_COMMANDS, SIGNAL(contextMenuRequested( QListViewItem *, const QPoint &, int )), this, SLOT(slotContextMenuUserChatCommands(QListViewItem *, const QPoint &, int)));
      listView_CHAT_COMMANDS->setDefaultRenameAction( QListView::Accept );
      listView_CHAT_COMMANDS->setShowSortIndicator( TRUE );
      
      connect( listView_AUTO_RESPONSES, SIGNAL(contextMenuRequested( QListViewItem *, const QPoint &, int)), this, SLOT(slotContextMenuAutoResponses(QListViewItem *, const QPoint &, int)));
      listView_AUTO_RESPONSES->setDefaultRenameAction( QListView::Accept );
      listView_AUTO_RESPONSES->setShowSortIndicator( TRUE );
      
      connect( ToolButton_BROWSESOUNDFILECONNECT, SIGNAL(clicked()), this, SLOT(slotBrowseSoundFileConnect()) );
      connect( ToolButton_BROWSESOUNDFILEDISCONNECT, SIGNAL(clicked()), this, SLOT(slotBrowseSoundFileDisconnect()) );
      connect( ToolButton_BROWSESOUNDFILESEND, SIGNAL(clicked()), this, SLOT(slotBrowseSoundFileSend()) );
      connect( ToolButton_BROWSESOUNDFILERECEIVE, SIGNAL(clicked()), this, SLOT(slotBrowseSoundFileReceive()) );
      connect( ToolButton_BROWSESOUNDFILEFIRSTRECEIVE, SIGNAL(clicked()), this, SLOT(slotBrowseSoundFileFirstReceive()) );

      connect( ToolButton_PREVIEWSOUNDFILECONNECT, SIGNAL(clicked()), this, SLOT(slotPreviewSoundFileConnect()) );
      connect( ToolButton_PREVIEWSOUNDFILEDISCONNECT, SIGNAL(clicked()), this, SLOT(slotPreviewSoundFileDisconnect()) );
      connect( ToolButton_PREVIEWSOUNDFILESEND, SIGNAL(clicked()), this, SLOT(slotPreviewSoundFileSend()) );
      connect( ToolButton_PREVIEWSOUNDFILERECEIVE, SIGNAL(clicked()), this, SLOT(slotPreviewSoundFileReceive()) );
      connect( ToolButton_PREVIEWSOUNDFILEFIRSTRECEIVE, SIGNAL(clicked()), this, SLOT(slotPreviewSoundFileFirstReceive()) );

      connect( ToolButton_BROWSESOUNDPLAYER, SIGNAL(clicked()), this, SLOT(slotBrowseSoundPlayer()) );

      // Transfer->Folder
      connect( ToolButton_BROWSEDOWNLOADFOLDER, SIGNAL(clicked()), this, SLOT(slotBrowseDownloadFolder()) );
      connect( ToolButton_BROWSEDOWNLOADFINISHEDFOLDER, SIGNAL(clicked()), this, SLOT(slotBrowseDownloadFinishedFolder()) );

      connect( ToolButton_CREATESHARELIST, SIGNAL(clicked()), this, SLOT(slotCreateShareList()) );
      connect( ToolButton_BROWSEFILELIST, SIGNAL(clicked()), this, SLOT(slotBrowseShareList()) );
      connect( ToolButton_SHARELISTINFO, SIGNAL(clicked()), this, SLOT(slotShareListInfo()) );
      connect( ToolButton_ADDSHAREDFOLDER, SIGNAL(clicked()), this, SLOT(slotAddSharedFolder()) );
      connect( ToolButton_REMOVESHAREDFOLDER, SIGNAL(clicked()), this, SLOT(slotRemoveSharedFolder()) );
      connect( ToolButton_EDITSHAREDFOLDER, SIGNAL(clicked()), this, SLOT(slotEditSharedFolder()) );
      connect( CheckBox_DONTSHAREDOTFILES, SIGNAL(clicked()), this, SLOT(slotDontShareDotFilesChanged()) );

      //
      connect( PushButton_SAVE, SIGNAL(clicked()), this, SLOT(slotSave()) );
      connect( PushButton_CANCEL, SIGNAL(clicked()), this, SLOT(reject()) );
      
      connect( PushButton_TESTHOST, SIGNAL(clicked()), this, SLOT(slotTestHost()) );
      connect( PushButton_GETINTERFACE, SIGNAL(clicked()), this, SLOT(slotGetInterface()) );
      connect( PushButton_GETINTERNETIP, SIGNAL(clicked()), this, SLOT(slotGetInternetIP()) );

      // GUI->General
      connect( ToolButton_BROWSELANGUAGEFILE, SIGNAL(clicked()), this, SLOT(slotBrowseLanguageFile()) );
      connect( ToolButton_SELECTLANGUAGE, SIGNAL(clicked()), this, SLOT(slotSelectLanguage()) );
      connect( PushButton_SETTHEME, SIGNAL(clicked()), this, SLOT(slotSetTheme()) );
      connect( ToolButton_BROWSEAPPFONT, SIGNAL(clicked()), this, SLOT(slotBrowseAppFont()) );
      connect( ToolButton_BROWSEDATAFOLDER, SIGNAL(clicked()), this, SLOT(slotBrowseDataFolder()) );

      // GUI->Chat
      connect( ToolButton_BROWSEBROWSER, SIGNAL(clicked()), this, SLOT(slotBrowseBrowser()) );
      connect( ListBox_CHATCOLOR, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(slotDoubleClickedChatColor(QListBoxItem *)) );

      // GUI->Client
      connect( CheckBox_AUTOAWAYMODE, SIGNAL(clicked()), this, SLOT(slotAutoAwayMode()) );

      // LOG->Chat
      connect( CheckBox_LOGCHAT_ENABLELOGGING, SIGNAL(clicked()), this, SLOT(slotLogChatEnableLogging()) );
      connect( CheckBox_LOGCHAT_ENABLENICKNAMEFILTER, SIGNAL(clicked()), this, SLOT(slotLogChatEnableNickNameFilter()) );
      connect( ToolButton_LOGCHAT_NICKNAMEFILTER_ADD, SIGNAL(clicked()), this, SLOT(slotLogChatAddNickNameFilter()) );
      connect( ToolButton_LOGCHAT_NICKNAMEFILTER_DEL, SIGNAL(clicked()), this, SLOT(slotLogChatDelNickNameFilter()) );

      //
      connect( ToolButton_BROWSETRANSFERCERT, SIGNAL(clicked()), this, SLOT(slotBrowseTransferCert()) );
      connect( ToolButton_BROWSETRANSFERKEY, SIGNAL(clicked()), this, SLOT(slotBrowseTransferKey()) );

      connect( RadioButton_ACTIVEMODE, SIGNAL(toggled(bool)), this, SLOT(slotModeActiveChange(bool)) );
      connect( RadioButton_PASSIVEMODE, SIGNAL(toggled(bool)), this, SLOT(slotModePassiveChange(bool)) );
      connect( RadioButton_IPHOSTNAME, SIGNAL(toggled(bool)), this, SLOT(slotIPHOSTNAMEChange(bool)) );
      connect( RadioButton_INTERFACE, SIGNAL(toggled(bool)), this, SLOT(slotINTERFACEChange(bool)) );

      // Hub List
      connect( ToolButton_ADDHUBLISTURL, SIGNAL(clicked()), this, SLOT(slotAddHubListUrl()) );
      connect( ToolButton_EDITHUBLISTURL, SIGNAL(clicked()), this, SLOT(slotEditHubListUrl()) );
      connect( ToolButton_REMOVEHUBLISTURL, SIGNAL(clicked()), this, SLOT(slotRemoveHubListUrl()) );

      connect( CheckBox_SOUNDDISABLED, SIGNAL(clicked()), this, SLOT(slotDisableSound()) );
      
      connect( CheckBox_EXTERNALPLAYER, SIGNAL(clicked()), this, SLOT(slotExternalPlayer()) );
      connect( CheckBox_SOUNDPLAYCONNECT, SIGNAL(clicked()), this, SLOT(slotSoundPlayConnect()) );
      connect( CheckBox_SOUNDPLAYDISCONNECT, SIGNAL(clicked()), this, SLOT(slotSoundPlayDisconnect()) );
      connect( CheckBox_SOUNDPLAYSEND, SIGNAL(clicked()), this, SLOT(slotSoundPlaySend()) );
      connect( CheckBox_SOUNDPLAYRECEIVE, SIGNAL(clicked()), this, SLOT(slotSoundPlayRecieve()) );
      connect( CheckBox_SOUNDPLAYFIRSTRECEIVE, SIGNAL(clicked()), this, SLOT(slotSoundPlayFirstReceive()) );

      connect( ToolButton_BROWSELOGFILE, SIGNAL(clicked()), this, SLOT(slotBrowseLogFile()) );
      
      connect( CheckBox_CHATSHOWJOINSANDPARTS, SIGNAL(clicked()), this, SLOT(slotEnableShowJoinsParts()) );
      
      connect( PushButton_GENERATE_CERT, SIGNAL(clicked()), this, SLOT(slotGenerateKeyCert()) );
      
      // style options
      ComboBox_THEME->clear();

      if ( g_pConfig->GetThemeSupport() == TRUE )
      {
            QStringList list = QStyleFactory::keys();

            if ( list.count() > 0 )
            {
                  list.sort();
                  ComboBox_THEME->insertStringList(list);
                  list.clear();
            }
      }
      else
      {
            // disable the theme support
            ComboBox_THEME->setEnabled(FALSE);
            PushButton_SETTHEME->setEnabled(FALSE);
      }
}


Generated by  Doxygen 1.6.0   Back to index