public LiveWebGalleryDialog(SimpleWebServer server, ILiveWebGalleryOptions options, LiveWebGalleryStats stats) : base(Assembly.GetExecutingAssembly (), "LiveWebGallery.ui", "live_web_gallery_dialog") { this.server = server; this.options = options; this.stats = stats; Modal = false; activate_button.Active = server.Active; UpdateGalleryURL (); limit_checkbox.Active = options.LimitMaxPhotos; limit_spin.Sensitive = options.LimitMaxPhotos; limit_spin.Value = options.MaxPhotos; UpdateQueryRadios (); HandleQueryTagSelected (options.QueryTag != null ? options.QueryTag : App.Instance.Database.Tags.GetTagById(1)); allow_tagging_checkbox.Active = options.TaggingAllowed; tag_edit_button.Sensitive = options.TaggingAllowed; HandleEditableTagSelected (options.EditableTag != null ? options.EditableTag : App.Instance.Database.Tags.GetTagById(3)); HandleStatsChanged (null, null); activate_button.Toggled += HandleActivated; copy_button.Clicked +=HandleCopyClicked; current_view_radio.Toggled += HandleRadioChanged; tagged_radio.Toggled += HandleRadioChanged; selected_radio.Toggled += HandleRadioChanged; tag_button.Clicked += HandleQueryTagClicked; limit_checkbox.Toggled += HandleLimitToggled; limit_spin.ValueChanged += HandleLimitValueChanged; allow_tagging_checkbox.Toggled += HandleAllowTaggingToggled; tag_edit_button.Clicked += HandleTagForEditClicked; stats.StatsChanged += HandleStatsChanged; }
public void Run(object o, EventArgs e) { if (web_server == null) { stats = new LiveWebGalleryStats (); RequestHandler gallery = new GalleryRequestHandler (stats); options = gallery as ILiveWebGalleryOptions; web_server = new SimpleWebServer (); web_server.Stats = stats; web_server.RegisterHandler ("", gallery); web_server.RegisterHandler ("gallery", gallery); web_server.RegisterHandler ("ui", new ResourceRequestHandler ()); web_server.RegisterHandler ("ping", new PingRequestHandler ()); web_server.RegisterHandler ("photo", new PhotoRequestHandler (stats)); web_server.RegisterHandler ("thumb", new ThumbnailRequestHandler (stats)); web_server.RegisterHandler ("tag", new TagAddRemoveRequestHandler (options)); } dialog = new LiveWebGalleryDialog (web_server, options, stats); dialog.Response += HandleResponse; dialog.ShowAll (); }