Ignore:
Timestamp:
Jan 31, 2011, 12:04:50 AM (11 years ago)
Author:
Arno Wacker
Message:

Network Manager:

  • Added simple estimation of network size (SENS) protocol on Top of the FullMesh overlay (works only with FullMesh)
  • Just proof of concept; protocol will be moved inside the overlay later
  • Beware, that under some conditions it might break...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/P2PEditorSettings.cs

    r2379 r2533  
    5353           
    5454            }
     55
     56            settings.PropertyChanged += new PropertyChangedEventHandler(settings_PropertyChanged);
     57
    5558            UpdateSettings();
    5659        }
     60
    5761
    5862        #region Update visibility of server group
     
    140144        }
    141145
    142         // TODO New ControlType needed to choose dialogs? OpenFileDialog not fitting.
    143         [TaskPane("workspacePath_caption", "workspacePath_tooltip", null, 3, true, ControlType.TextBox)]
    144         public string WorkspacePath
    145         {
    146             get { return settings.WorkspacePath; }
    147             set
    148             {
    149                 if (value != settings.WorkspacePath)
    150                 {
    151                     settings.WorkspacePath = value;
    152                     OnPropertyChanged("WorkspacePath");
    153                     HasChanges = true;
    154                 }
    155             }
    156         }
    157 
     146       
    158147        [TaskPane("start_caption", "start_tooltip", null, 3, true, ControlType.Button)]
    159148        public void ButtonStart()
     
    186175        }
    187176
    188         [TaskPane("distributedJobListRefreshInterval_caption", "distributedJobListRefreshInterval_tooltip", GroupExperienced, 0, false,
     177
     178
     179        [TaskPane("networksize_caption", "networksize_tooltip", null, 6, false, ControlType.TextBoxReadOnly)]
     180        public string NetSize
     181        {
     182            get { return settings.NetSize; }
     183            set
     184            {
     185                if (value != settings.NetSize)
     186                {
     187                    settings.NetSize = value;
     188                    OnPropertyChanged("NetSize");   
     189                }
     190            }
     191        }
     192
     193
     194        // TODO New ControlType needed to choose dialogs? OpenFileDialog not fitting.
     195        [TaskPane("workspacePath_caption", "workspacePath_tooltip", GroupExperienced, 0, true, ControlType.TextBox)]
     196        public string WorkspacePath
     197        {
     198            get { return settings.WorkspacePath; }
     199            set
     200            {
     201                if (value != settings.WorkspacePath)
     202                {
     203                    settings.WorkspacePath = value;
     204                    OnPropertyChanged("WorkspacePath");
     205                    HasChanges = true;
     206                }
     207            }
     208        }
     209
     210
     211        [TaskPane("distributedJobListRefreshInterval_caption", "distributedJobListRefreshInterval_tooltip", GroupExperienced, 1, false,
    189212            ControlType.NumericUpDown, ValidationType.RangeInteger, 0, int.MaxValue)]
    190213        public int DistributedJobListRefreshInterval
     
    202225        }
    203226
    204         [TaskPane("connectOnStartup_caption", "connectOnStartup_tooltip", GroupExperienced, 1, true,
     227        [TaskPane("connectOnStartup_caption", "connectOnStartup_tooltip", GroupExperienced, 2, true,
    205228            ControlType.CheckBox)]
    206229        public bool ConnectOnStartup
     
    218241        }
    219242
    220         [TaskPane("linkmanager_caption", "linkmanager_tooltip", GroupExpert, 0, false,
     243        [TaskPane("linkmanager_caption", "linkmanager_tooltip", GroupExpert, 3, false,
    221244            ControlType.ComboBox, new[] {"Snal"})]
    222245        public int LinkManager
     
    234257        }
    235258
    236         [TaskPane("bootstrapper_caption", "bootstrapper_tooltip", GroupExpert, 1, false
     259        [TaskPane("bootstrapper_caption", "bootstrapper_tooltip", GroupExpert, 4, false
    237260            , ControlType.ComboBox, new[] {"LocalMachineBootstrapper", "IrcBootstrapper", "DnsBootstrapper"})]
    238261        public int Bootstrapper
     
    250273        }
    251274
    252         [TaskPane("architecture_caption", "architecture_tooltip", GroupExpert, 2, false,
     275        [TaskPane("architecture_caption", "architecture_tooltip", GroupExpert, 5, false,
    253276            ControlType.ComboBox, new[] { "FullMesh", "Chord", "Server" , "WebDHT" })]
    254277        public int Architecture
     
    267290        }
    268291
    269         [TaskPane("localPort_caption", "localPort_tooltip", GroupExpert, 4, false,
     292        [TaskPane("localPort_caption", "localPort_tooltip", GroupExpert, 6, false,
    270293            ControlType.NumericUpDown, ValidationType.RangeInteger, 0, 65535)]
    271294        public int LocalPort
     
    283306        }
    284307
    285         [TaskPane("useLocalAddressDetection_caption", "useLocalAddressDetection_tooltip", GroupExpert, 5, false,
     308        [TaskPane("useLocalAddressDetection_caption", "useLocalAddressDetection_tooltip", GroupExpert, 7, false,
    286309            ControlType.CheckBox)]
    287310        public bool UseLocalAddressDetection
     
    299322        }
    300323
    301         [TaskPane("log2monitor_caption", "log2monitor_tooltip", GroupExpert, 6, false,
     324        [TaskPane("log2monitor_caption", "log2monitor_tooltip", GroupExpert, 8, false,
    302325            ControlType.CheckBox)]
    303326        public bool Log2Monitor
     
    315338        }
    316339
    317         [TaskPane("serverHost_caption", "serverHost_tooltip", GroupServer, 1, false, ControlType.TextBox)]
     340        [TaskPane("serverHost_caption", "serverHost_tooltip", GroupServer, 9, false, ControlType.TextBox)]
    318341        public string ServerHost
    319342        {
     
    330353        }
    331354
    332         [TaskPane("serverPort_caption", "serverPort_tooltip", GroupServer, 4, false,
     355        [TaskPane("serverPort_caption", "serverPort_tooltip", GroupServer, 10, false,
    333356            ControlType.NumericUpDown, ValidationType.RangeInteger, 0, 65535)]
    334357        public int ServerPort
     
    348371        #endregion
    349372
     373        /// <summary>
     374        /// This is needed, if some settings are changed via "P2PSettings.Default.xyz". In some cases (e.g. controltype: TextBoxreadonly)
     375        /// the GUI will not be updated automatically without this additionaly firing of the event
     376        /// </summary>
     377        /// <param name="sender"></param>
     378        /// <param name="e"></param>
     379        private void settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
     380        {
     381            OnPropertyChanged(e.PropertyName);
     382            //this.p2PEditor.GuiLogMessage("Property changed: " + e.PropertyName, NotificationLevel.Debug);
     383        }
     384
    350385        private void OnPropertyChanged(string p)
    351386        {
Note: See TracChangeset for help on using the changeset viewer.