예제 #1
0
파일: MainWindow.cs 프로젝트: tigger/tripod
        void BuildLayout ()
        {
            primary_vbox = new VBox ();
            
            var label = new Label ("Super duper test UI!");
            label.Show ();
            primary_vbox.Add (label);
            
            var button_box = new HButtonBox ();
            button_box.Show ();
            primary_vbox.Add (button_box);
            
            var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder);
            folder_button.FileSet += delegate {
                folder = folder_button.Uri;
                Log.Information ("Selected " + folder);
            };
            folder_button.Show ();
            button_box.Add (folder_button);
            
            var import_button = new Button { Label = "Start Import" };
            import_button.Activated += StartImport;
            import_button.Clicked += StartImport;
            import_button.Show ();
            button_box.Add (import_button);

            primary_vbox.Show ();
            Add (primary_vbox);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Sharpend.GtkSharp.FileChooserWrapper"/> class.
 /// 
 /// </summary>
 /// <param name='title'>
 /// Title.
 /// </param>
 /// <param name='chooser'>
 /// Chooser.
 /// </param>
 /// <param name='entryPath'>
 /// Entry to display selected path (optional, can be null)
 /// </param>
 /// <param name='action'>
 /// Action.
 /// </param>
 public FileChooserButtonWrapper(String title, FileChooserButton chooser, Entry entryPath,FileChooserAction action)
 {
     Chooser = chooser;
     EntryPath = entryPath;
     Chooser.Action = action;
     ConfigFile = null;
     CurrentFilter = null;
     Chooser.Title = title;
     init();
 }
예제 #3
0
		public FormDatabasePreferences() : base(7, 3, false)
		{	
			typeLabel = new Gtk.Label("Type :");
			serverLabel = new Gtk.Label("Server :");
			portLabel = new Gtk.Label("Port :");
			userLabel = new Gtk.Label("Username :"******"Password :"******"Database :");
			mediaLabel = new Gtk.Label("Medias path :");
			typeCombo = ComboBox.NewText();
			serverEntry = new Entry();
			portSpinButton = new SpinButton(0f,65536f,1f);
			userEntry = new Entry();
			passEntry = new Entry();
			dbEntry = new Entry();
			passCheck = new CheckButton("Save password");
			dbButton= new Button(Stock.Open);
			mediaButton= new FileChooserButton("Choose the media directory", FileChooserAction.SelectFolder);
						
			typeLabel.SetAlignment(0, (float)0.5);
			serverLabel.SetAlignment(0, (float)0.5);
			portLabel.SetAlignment(0, (float)0.5);
			userLabel.SetAlignment(0, (float)0.5);
			passLabel.SetAlignment(0, (float)0.5);
			dbLabel.SetAlignment(0, (float)0.5);
			mediaLabel.SetAlignment(0, (float)0.5);
			
			typeCombo.AppendText("SQLite");
			typeCombo.AppendText("PostgreSQL");
			typeCombo.Changed += OnTypeComboChanged;
			
			passEntry.Visibility = false;
			dbButton.Clicked += OnDbButton; 
			
			this.Attach(typeLabel, 0, 1, 0, 1);
			this.Attach(serverLabel, 0, 1, 1, 2);
			this.Attach(portLabel, 0, 1, 2, 3);
			this.Attach(userLabel, 0, 1, 3, 4);
			this.Attach(passLabel, 0, 1, 4, 5);
			this.Attach(dbLabel, 0, 1, 5, 6);
			this.Attach(mediaLabel, 0, 1, 6, 7);
			
			this.Attach(typeCombo, 1, 3, 0, 1);
			
			this.Attach(serverEntry, 1, 3, 1, 2);
			this.Attach(portSpinButton, 1, 3, 2, 3);
			this.Attach(userEntry, 1, 3, 3, 4);
			this.Attach(passEntry, 1, 2, 4, 5);
			this.Attach(dbEntry, 1, 2, 5, 6);
			
			this.Attach(passCheck, 2, 3, 4, 5);			
			this.Attach(dbButton, 2, 3, 5, 6);		
			this.Attach(mediaButton, 1, 3, 6, 7);
			
		}
예제 #4
0
        public CreateTorrentDialog(TorrentController torrentController)
        {
            this.Build();
            this.torrentController = torrentController;

            newTorrentLocationButton = new FileChooserButton(_("Select file"), FileChooserAction.Open);

            selectFileHbox.Add(newTorrentLocationButton);
            newTorrentLocationButton.Show();

            BuildTrackerWidgets();
        }
예제 #5
0
        FileChooserButton CreateTestDllButton()
        {
            var entry = new FileChooserButton(_("Open..."), FileChooserAction.Open);
              var testDll = GetVariable<string>("test_dll");

              entry.SetFilename(testDll.Value);

              entry.SelectionChanged += delegate
            {
              testDll.Value = entry.Filename ?? testDll.Value;
            };
              return entry;
        }
예제 #6
0
		private void on_dialog_response (object sender, ResponseArgs args) {
			if (args.ResponseId != Gtk.ResponseType.Ok) {
				// FIXME this is to work around a bug in gtk+ where
				// the filesystem events are still listened to when
				// a FileChooserButton is destroyed but not finalized
				// and an event comes in that wants to update the child widgets.
				uri_chooser.Dispose ();
				uri_chooser = null;
			} else if (args.ResponseId == Gtk.ResponseType.Ok) {
				zip ();
			}
			zipdiag.Destroy ();
		}
예제 #7
0
        public Dialog(VariableSet variables)
            : base("Picture Frame", variables)
        {
            var vbox = new VBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(vbox, true, true, 0);

              var entry = new FileChooserButton(_("Load Frame..."), FileChooserAction.Open);

              entry.SelectionChanged += delegate
            {
              GetVariable<string>("image_path").Value = entry.Filename;
            };
              vbox.PackStart(entry, false, false, 0);
        }
예제 #8
0
		public DruidStoragePage()
		{
			this.Build();
			
			torrentButton = new FileChooserButton("Select torrent storage directory...", FileChooserAction.SelectFolder);
			dataButton = new FileChooserButton("Select default download directory...", FileChooserAction.SelectFolder);
			
			torrentButton.ShowAll();
			dataButton.ShowAll();
			
			storageTable.Attach(dataButton, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
			storageTable.Attach(torrentButton, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
			
			torrentButton.SetCurrentFolder(System.IO.Path.Combine(System.IO.Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),"monotorrent"), "torrents"));
			dataButton.SetCurrentFolder(Environment.GetFolderPath (Environment.SpecialFolder.Personal));
		}
예제 #9
0
 private void on_dialog_response(object sender, ResponseArgs args)
 {
     if (args.ResponseId != Gtk.ResponseType.Ok)
     {
         // FIXME this is to work around a bug in gtk+ where
         // the filesystem events are still listened to when
         // a FileChooserButton is destroyed but not finalized
         // and an event comes in that wants to update the child widgets.
         uri_chooser.Dispose();
         uri_chooser = null;
     }
     else if (args.ResponseId == Gtk.ResponseType.Ok)
     {
         zip();
     }
     zipdiag.Destroy();
 }
예제 #10
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        Catalog.Init("gpdfsplitter", "/usr/share/locale");		//LOCALIZATION

        Title = Catalog.GetString("gPDFsplitter");

        table = new Table(4,5,false);
        table.BorderWidth = 5;
        table.Attach( new Label( Catalog.GetString("1. Select the file:") ), 0, 1, 0, 1 );
        table.Attach( new Label( Catalog.GetString("2. Select a range:") ), 0, 1, 1, 3 );
        table.Attach( new Label( Catalog.GetString("3. Output file name:") ), 0, 1, 3, 4);
        table.Attach( new Label( Catalog.GetString("4. Split:") ), 0, 1, 4, 5 );

        inputBut = new FileChooserButton("Select file", FileChooserAction.Open);
        inputBut.Filter = new FileFilter();
        inputBut.Filter.AddMimeType( "application/pdf" );
        inputBut.FileSet += OnFileSelect;
        table.Attach( inputBut, 1, 4, 0, 1);

        outputBut = new Entry( Catalog.GetString("output.pdf") );
        outputBut.MaxLength = 15;
        outputBut.TooltipText = Catalog.GetString("Directory is home or actual");
        table.Attach( outputBut, 1, 4, 3,4);

        done = new Button("done");
        done.Clicked += OnDone;
        table.Attach( done, 1,4,4,5);

        start = new SpinButton(0,1,1);
        end = new SpinButton(0,1,1);
        table.Attach( start, 2,3, 1,2);
        table.Attach( end, 3,4, 1,2);

        rb1 = new RadioButton( Catalog.GetString("interval") );
        rb2 = new RadioButton( rb1,  Catalog.GetString("chapter") );
        table.Attach( rb1 , 1, 2, 1, 2);
        table.Attach( rb2 , 1, 2, 2, 3);

        table.Attach( new Label( Catalog.GetString("Not implemented yet") ), 2,4,2,3 );

        Add( table );
        ShowAll();
    }
예제 #11
0
		private void Init ()
		{
			btnFileChooser = new Gtk.FileChooserButton (
				"Please choose a file!", Gtk.FileChooserAction.Open);

			btnFileChooser.SelectionChanged += HandleSelectionChanged;

			var label = new Gtk.Label ();
			label.Text = "Please choose config file:";

			var hbox = new HBox();
			hbox.PackStart(label, false, false, 10);
			hbox.PackStart(btnFileChooser, true, true, 10);

			var vbox = new VBox();
			vbox.PackStart(hbox, true, true, 2);
			this.Add (vbox);
		}
예제 #12
0
		public void ShowDialog () {
			Glade.XML xml = new Glade.XML (null, "ZipExport.glade", "zipdiag", "f-spot");
			xml.Autoconnect (this);
			zipdiag.Modal = false;
			zipdiag.TransientFor = null;

			uri_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select export folder"),
								 Gtk.FileChooserAction.SelectFolder);
			uri_chooser.LocalOnly = true;
			uri_chooser.SetFilename (System.IO.Path.Combine (FSpot.Global.HomeDirectory, "Desktop"));
			dirchooser_hbox.PackStart (uri_chooser, false, false, 2);
			filename.Text = "f-spot_export.zip";

			zipdiag.Response += on_dialog_response;
			filename.Changed += on_filename_change;
			scale_check.Toggled += on_scalecheck_change;
			on_scalecheck_change (null, null);

			zipdiag.ShowAll ();
		}
예제 #13
0
        public void ShowDialog()
        {
            Glade.XML xml = new Glade.XML(null, "ZipExport.glade", "zipdiag", "f-spot");
            xml.Autoconnect(this);
            zipdiag.Modal        = false;
            zipdiag.TransientFor = null;

            uri_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select export folder"),
                                                    Gtk.FileChooserAction.SelectFolder);
            uri_chooser.LocalOnly = true;
            uri_chooser.SetFilename(System.IO.Path.Combine(FSpot.Global.HomeDirectory, "Desktop"));
            dirchooser_hbox.PackStart(uri_chooser, false, false, 2);
            filename.Text = "f-spot_export.zip";

            zipdiag.Response    += on_dialog_response;
            filename.Changed    += on_filename_change;
            scale_check.Toggled += on_scalecheck_change;
            on_scalecheck_change(null, null);

            zipdiag.ShowAll();
        }
예제 #14
0
        private void Init()
        {
            btnFileChooser = new Gtk.FileChooserButton(
                "Please choose a file!", Gtk.FileChooserAction.Open);

            btnFileChooser.SelectionChanged += HandleSelectionChanged;

            var label = new Gtk.Label();

            label.Text = "Please choose config file:";

            var hbox = new HBox();

            hbox.PackStart(label, false, false, 10);
            hbox.PackStart(btnFileChooser, true, true, 10);

            var vbox = new VBox();

            vbox.PackStart(hbox, true, true, 2);
            this.Add(vbox);
        }
예제 #15
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        SetDefaultSize(200, -1);

        var table     = new Gtk.Table(5, 5, true);
        var separator = new Gtk.HSeparator();

        var label0 = new Gtk.Label("Select file to copy/move");

        _fileCopy  = new Gtk.FileChooserButton("Select A File", Gtk.FileChooserAction.Open);
        _radioCopy = new Gtk.RadioButton("Copy");
        _radioMove = new Gtk.RadioButton(_radioCopy, "Move");
        var copyButton = new Gtk.Button("Copy");

        Add(table);

        table.Attach(label0, 0, 4, 0, 1);
        table.Attach(_fileCopy, 0, 1, 1, 2);
        table.Attach(_radioCopy, 1, 2, 1, 2);
        table.Attach(_radioMove, 2, 3, 1, 2);
        table.Attach(copyButton, 3, 4, 1, 2);
        table.Attach(separator, 0, 4, 2, 3);

        var label1 = new Gtk.Label("Select destination for file(s)");

        _folder = new Gtk.FileChooserButton("Select A File", Gtk.FileChooserAction.SelectFolder);
        var pasteButton = new Gtk.Button("Paste");

        table.Attach(label1, 0, 4, 3, 4);
        table.Attach(_folder, 0, 1, 4, 5);
        table.Attach(pasteButton, 3, 4, 4, 5);

        DeleteEvent         += OnDeleteEvent;
        copyButton.Clicked  += OnCopyButtonClick;
        pasteButton.Clicked += OnPasteButtonClick;

        ShowAll();
    }
예제 #16
0
 public ProfileSetupDialog(Gtk.Window parent)
     : base("Profile Options", parent, DialogFlags.DestroyWithParent, Stock.Cancel, ResponseType.Cancel, Stock.Execute, ResponseType.Accept)
 {
     config = new ProfileConfiguration ();
     HBox box = new HBox (false, 6);
     box.PackStart (new Label ("Application:"), false, false, 0);
     FileChooserButton target_button = new FileChooserButton ("Select Application", FileChooserAction.Open);
     FileFilter filter = new FileFilter ();
     filter.AddPattern ("*.exe");
     filter.AddPattern ("*.aspx");
     target_button.Filter = filter;
     target_button.SelectionChanged += delegate {
         config.TargetPath = target_button.Filename;
         SetResponseSensitive (ResponseType.Accept, !String.IsNullOrEmpty (target_button.Filename));
     };
     box.PackStart (target_button, true, true, 0);
     box.ShowAll ();
     VBox.PackStart (box, false, false, 3);
     Widget editor = new ProfileOptionsEditor (config);
     editor.ShowAll ();
     VBox.PackStart (editor, false, false, 3);
     SetResponseSensitive (ResponseType.Accept, false);
 }
예제 #17
0
		public ProfileSetupDialog (Gtk.Window parent) : base ("Profile Options", parent, DialogFlags.DestroyWithParent, Stock.Cancel, ResponseType.Cancel, Stock.Execute, ResponseType.Accept)
		{
			config = new ProfileConfiguration ();
			HBox box = new HBox (false, 6);
			box.PackStart (new Label ("Assembly:"), false, false, 0);
			FileChooserButton assembly_button = new FileChooserButton ("Select Assembly", FileChooserAction.Open);
			FileFilter filter = new FileFilter ();
			filter.AddPattern ("*.exe");
			assembly_button.Filter = filter;
			assembly_button.SelectionChanged += delegate { 
				config.AssemblyPath = assembly_button.Filename;
				SetResponseSensitive (ResponseType.Accept, !String.IsNullOrEmpty (assembly_button.Filename));
			};
			box.PackStart (assembly_button, true, true, 0);
			box.ShowAll ();
			VBox.PackStart (box, false, false, 3);
			box = new HBox (false, 6);
			box.PackStart (new Label ("Type:"), false, false, 0);
			ComboBox type_combo = ComboBox.NewText ();
			type_combo.AppendText ("Allocations");
			type_combo.AppendText ("Calls/Instrumented");
			type_combo.AppendText ("Statistical");
			type_combo.Active = 2;
			type_combo.Changed += delegate { config.Mode = (ProfileMode) (1 << type_combo.Active); };
			box.PackStart (type_combo, false, false, 0);
			box.ShowAll ();
			VBox.PackStart (box, false, false, 3);
			box = new HBox (false, 6);
			CheckButton start_enabled_chkbtn = new CheckButton ("Enabled at Startup");
			start_enabled_chkbtn.Active = true;
			start_enabled_chkbtn.Toggled += delegate { config.StartEnabled = start_enabled_chkbtn.Active; };
			box.PackStart (start_enabled_chkbtn, false, false, 0);
			box.ShowAll ();
			VBox.PackStart (box, false, false, 3);
			SetResponseSensitive (ResponseType.Accept, false);
		}
		public bool Execute (Tag t)
		{
			this.CreateDialog ("edit_icon_dialog");

			this.Dialog.Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);

			PreviewPixbuf = t.Icon;

			query = new FSpot.PhotoQuery (db.Photos);
			
			if (db.Tags.Hidden != null)
				query.Terms = FSpot.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
			else 
				query.Terms = new FSpot.Literal (t);

			image_view = new FSpot.PhotoImageView (query);
			image_view.SelectionXyRatio = 1.0;
			image_view.SelectionChanged += HandleSelectionChanged;
			image_view.PhotoChanged += HandlePhotoChanged;

                        external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
                                                                 Gtk.FileChooserAction.Open);

			external_photo_chooser.Filter = new FileFilter();
			external_photo_chooser.Filter.AddPixbufFormats();
                        external_photo_chooser.LocalOnly = false;
                        external_photo_chooser_hbox.PackStart (external_photo_chooser);

    			Dialog.ShowAll ();
			external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

			photo_scrolled_window.Add (image_view);

			if (query.Count > 0) {
				photo_spin_button.Wrap = true;
				photo_spin_button.Adjustment.Lower = 1.0;
				photo_spin_button.Adjustment.Upper = (double) query.Count;
				photo_spin_button.Adjustment.StepIncrement = 1.0;
				photo_spin_button.ValueChanged += HandleSpinButtonChanged;
				
				image_view.Item.Index = 0;
			} else {
				from_photo_label.Markup = String.Format (Catalog.GetString (
					"\n<b>From Photo</b>\n" +
					" You can use one of your library photos as an icon for this tag.\n" +
					" However, first you must have at least one photo associated\n" +
					" with this tag. Please tag a photo as '{0}' and return here\n" +
					" to use it as an icon."), t.Name); 
				photo_scrolled_window.Visible = false;
				photo_label.Visible = false;
				photo_spin_button.Visible = false;
			}			

			icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));

			icon_view = new Gtk.IconView (icon_store); 
			icon_view.PixbufColumn = 1;
			icon_view.SelectionMode = SelectionMode.Single;
			icon_view.SelectionChanged += HandleIconSelectionChanged;

			icon_scrolled_window.Add (icon_view);

			icon_view.Show();

			image_view.Show ();

			FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
			fill_delay.Start ();

			ResponseType response = (ResponseType) this.Dialog.Run ();
			bool success = false;

			if (response == ResponseType.Ok) {
				try {
					if (IconName != null) {
						t.ThemeIconName = IconName;
					} else {
						t.ThemeIconName = null;
						t.Icon = PreviewPixbuf_WithoutProfile;
					}
					//db.Tags.Commit (t);
					success = true;
				} catch (Exception ex) {
					// FIXME error dialog.
					Console.WriteLine ("error {0}", ex);
				}
			} else if (response == (ResponseType) (1)) {
				t.Icon = null;
				success = true;
			}
			
			this.Dialog.Destroy ();
			return success;
		}
예제 #19
0
		private void BuildFilterPage()
		{
			TreeViewColumn filterColumn = new TreeViewColumn();
			filterListStore = new ListStore(typeof(RssFilter));
			
			CellRendererText textRenderer = new CellRendererText();
			filterFeedCombobox.PackStart(textRenderer, true);
			filterFeedCombobox.AddAttribute(textRenderer, "text", 0);
			
			filterFeedListStore = new ListStore(typeof(string));
			allIter = filterFeedListStore.AppendValues("All");
		   	
			filterFeedCombobox.Model = filterFeedListStore;
			filterFeedCombobox.SetActiveIter(allIter);
			
			filterColumn.Title = "Filter";
			Gtk.CellRendererText filterCell = new Gtk.CellRendererText ();
			filterColumn.PackStart (filterCell, true);
			filterColumn.SetCellDataFunc (filterCell, new Gtk.TreeCellDataFunc (RenderFilter));
			
			filterTreeView.AppendColumn(filterColumn);
			
			filterTreeView.Model = filterListStore;
			
			savePathChooserButton = new FileChooserButton("Select a Save Path", FileChooserAction.SelectFolder);
			savePathChooserButton.SetCurrentFolder(controller.TorrentController.engine.Settings.SavePath);
			savePathChooserButton.ShowAll();
			
			filterTable.Attach(savePathChooserButton, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); 
			
			foreach(RssFilter filter in controller.Filters){
				filterListStore.AppendValues(filter);
			}
			foreach(string feed in controller.Feeds){
				filterFeedListStore.AppendValues(feed);
			}
			
			filterTreeView.Selection.Changed += OnFilterTreeViewSelectionChanged;
			
		}
예제 #20
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window)
            : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            this.db = db;
            TransientFor = parent_window;
            Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
                preview_image.Pixbuf = preview_pixbuf.Copy ();
                ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile);
            } else
                preview_image.Pixbuf = preview_pixbuf;

            query = new FSpot.PhotoQuery (db.Photos);

            if (db.Tags.Hidden != null)
                query.Terms = FSpot.OrTerm.FromTags (new Tag [] {t});
            else
                query.Terms = new FSpot.Literal (t);

            image_view = new PhotoImageView (query) {CropHelpers = false};
            image_view.SelectionXyRatio = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
                    Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
                        external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart (external_photo_chooser);
            external_photo_chooser.Show ();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add (image_view);

            if (query.Count > 0) {
                photo_spin_button.Wrap = true;
                photo_spin_button.Adjustment.Lower = 1.0;
                photo_spin_button.Adjustment.Upper = (double) query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            } else {
                from_photo_label.Markup = String.Format (Catalog.GetString (
                    "\n<b>From Photo</b>\n" +
                    " You can use one of your library photos as an icon for this tag.\n" +
                    " However, first you must have at least one photo associated\n" +
                    " with this tag. Please tag a photo as '{0}' and return here\n" +
                    " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible = false;
                photo_spin_button.Visible = false;
            }

            icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));

            icon_view = new Gtk.IconView (icon_store);
            icon_view.PixbufColumn = 1;
            icon_view.SelectionMode = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add (icon_view);

            icon_view.Show();

            image_view.Show ();

            FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
            fill_delay.Start ();
        }
예제 #21
0
        public FirstRun()
            : base(WindowType.Toplevel)
        {
            IconName = Stock.Convert;
            Title = "Import OPML file";

            Resizable = false;
            BorderWidth = 6;

            vbox = new VBox(false, 6);
            Add(vbox);

            hbox = new HBox(false, 6);
            vbox.PackStart(hbox);

            image = new Image("dialog-question", IconSize.Dialog);
            hbox.PackStart(image);

            table = new Table(2, 3, false);
            table.RowSpacing = 6;
            hbox.PackStart(table);

            label = new Label("To import feeds, select an OPML file.");
            label.LineWrap = true;
            table.Attach(label, 1, 2, 0, 1);

            fcdialog = new OpmlDialog();
            fcbutton = new FileChooserButton(fcdialog);
            table.Attach(fcbutton, 1, 2, 1, 2);

            bbox = new HButtonBox();
            vbox.PackEnd(bbox);

            cancel_button = new Button(Stock.Cancel);
            cancel_button.Clicked += OnCancel;
            bbox.PackEnd(cancel_button);

            add_button = new Button(Stock.Convert);
            add_button.Clicked += new EventHandler(OnImport);
            bbox.PackEnd(add_button);
        }
        /// <summary>
        /// Creates a Gtk.Widget that's used to configure the service.  This
        /// will be used in the Synchronization Preferences.  Preferences should
        /// not automatically be saved by a GConf Property Editor.  Preferences
        /// should be saved when SaveConfiguration () is called.
        /// </summary>
        public override Gtk.Widget CreatePreferencesControl()
        {
            Gtk.Table table = new Gtk.Table (1, 2, false);
            table.RowSpacing = 5;
            table.ColumnSpacing = 10;

            // Read settings out of gconf
            string syncPath;
            if (GetConfigSettings (out syncPath) == false)
                syncPath = string.Empty;

            Label l = new Label (Catalog.GetString ("_Folder Path:"));
            l.Xalign = 1;
            table.Attach (l, 0, 1, 0, 1,
                          Gtk.AttachOptions.Fill,
                          Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                          0, 0);

            pathButton = new FileChooserButton (Catalog.GetString ("Select Synchronization Folder..."),
                                                FileChooserAction.SelectFolder);
            l.MnemonicWidget = pathButton;
            pathButton.SetFilename (syncPath);

            table.Attach (pathButton, 1, 2, 0, 1,
                          Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                          Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                          0, 0);

            table.ShowAll ();
            return table;
        }
예제 #23
0
        static void start_import(Gtk.FileChooserButton widget)
        {
            string type = widget.Title;
            string path = widget.Filename;

            GLib.IFile   old      = GLib.FileFactory.NewForPath(path);
            GLib.IFile   news     = GLib.FileFactory.NewForPath("./gtml" + old.Basename);
            GLib.KeyFile programs = new GLib.KeyFile();
            if (GLib.FileFactory.NewForPath("./data/programs.gkf").Exists)
            {
                programs.LoadFromFile("./data/programs.gkf", gkfflags);
            }
            if (type.Equals("Full"))
            {
                old.Move(news, fcflags, null, null);
                GLib.FileFactory.NewForPath(news.Path + "/profile").MakeDirectoryWithParents(null);
                create_stacks(news.Basename, news.Path);
            }
            else if (type.Equals("Partial"))
            {
                /*
                 * g_file_copy (old, new,cflags,NULL,NULL,NULL,NULL);
                 * GFileEnumerator *ennew = g_file_enumerate_children (old,"*",G_FILE_QUERY_INFO_NONE,NULL,NULL);
                 * while (TRUE) {
                 *      GFile *out;
                 *      GFileInfo *info;
                 *      if (!g_file_enumerator_iterate(ennew,&info,&out,NULL,NULL)) {
                 *              g_object_unref(ennew);
                 *              break;
                 *      } else {
                 *              if (!info) break;
                 *              gchar *name = g_file_info_get_attribute_as_string (info,G_FILE_ATTRIBUTE_STANDARD_NAME);
                 *              if ((g_strcmp0(name,".") && g_strcmp0(name,"..")) && name[0] != '.')	{
                 *                      gchar *path = g_file_get_path (out);
                 *                      GString *n = g_string_new (name);
                 *                      if (g_file_test(path,G_FILE_TEST_IS_DIR)){
                 *
                 *                              if (!gtk_stack_get_child_by_name (GTK_STACK(stack),n->str)) {
                 *                                      g_print("%s\n",n->str);
                 *                                      //gtk_stack_add_titled (GTK_STACK(stack),create_tabs(),n->str,n->str);
                 *                              }
                 *                                              //gtk_stack_set_visible_child_name (GTK_STACK(stack),n->str);
                 *                      }
                 *              }
                 *      }
                 *      if (!info) break;
                 * }
                 * g_file_make_directory_with_parents (g_file_new_for_path(g_strdup_printf("%s/profile",g_file_get_path(new))),NULL,NULL);
                 */
            }
            else if (type.Equals("Link"))
            {
                programs.SetString("Programs", old.Basename, old.Path);
                GLib.FileFactory.NewForPath(news.Path + "/profile").MakeDirectoryWithParents(null);
                create_stacks(old.Basename, old.Path);
            }

            programs.Save("./data/programs.gkf");

            /*
             * GNotification *inotification = g_notification_new ("Import Complete");
             * g_notification_set_priority (inotification,G_NOTIFICATION_PRIORITY_NORMAL);
             *      ... Data was here ...
             * g_notification_set_body (inotification,g_strdup_printf ("The %s import of the file located at %s is now complete.\nReturn to Mozilla Launcher to secure and launch it.", type,path));
             * g_application_send_notification (G_APPLICATION(app),"import-complete",inotification);
             */
        }
예제 #24
0
		private void buildImportPanel()
		{
			importLocationButton = new FileChooserButton("Import folder to scan", FileChooserAction.SelectFolder);
			importLocationButton.SetCurrentFolder(prefSettings.ImportLocation);
			
			importLocationButton.CurrentFolderChanged += OnImportLocationFolderChanged;
			importDirectoryHbox.Add(importLocationButton);
			if(!importTorrentsCheckBox.Active)
				importLocationButton.Sensitive = false;
			importLocationButton.Show();
		}
예제 #25
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


			this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;


			// Start with an event box to paint the background white
			EventBox eb = new EventBox();
			eb.Show();
			eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			VBox mainVBox = new VBox();
			mainVBox.BorderWidth = 10;
			mainVBox.Spacing = 5;
			mainVBox.Show ();
			eb.Add(mainVBox);
			this.VBox.PackStart(eb);

			Label label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>";
			mainVBox.PackStart(label, true, true, 0);

			// Name Box at the top of the Widget
			HBox nameBox = new HBox();
			nameBox.Show();
			nameEntry = new Entry();
			nameEntry.Show();
			nameBox.PackStart(nameEntry, true, true, 0);
			nameBox.Spacing = 10;
			mainVBox.PackStart(nameBox, false, false, 0);
	
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
			mainVBox.PackStart(label, true, true, 0);
		
			Gtk.Table table = new Table(4, 3, false);
			table.Show();
			// None Entry
			noneButton = new RadioButton((Gtk.RadioButton)null);
			noneButton.Show();
			table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			VBox vbox = new VBox();
			vbox.Show();
			Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("None");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Local Entry
			localButton = new RadioButton(noneButton);
			localButton.Show();
			table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			localImage = new Image(Utilities.GetIcon("stock_person", 48));
			localImage.Show();
			vbox.PackStart(localImage, false, false, 0);
			label = new Label("File");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			photoButton = new Button("Change Photo");
			photoButton.Show();
			table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

			// Web Entry
			webButton = new RadioButton(noneButton);
			webButton.Show();
			table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("web-browser", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Web Link");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 2 ,3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			webEntry = new Entry();
			webEntry.Show();
			table.Attach(webEntry, 2,3,2,3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Gravatar Entry
			gravatarButton = new RadioButton(noneButton);
			gravatarButton.Show();
			table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("gravatar", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Gravatar");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 3 ,4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			gravatarEntry = new Entry();
			gravatarEntry.Show();
			table.Attach(gravatarEntry, 2,3,3,4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);


			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your File Location</span>";
			mainVBox.PackStart(label, true, true, 0);
	
			fileLocationButton = new FileChooserButton("Select storage location",
			    FileChooserAction.SelectFolder);
			fileLocationButton.Show();

			mainVBox.PackStart(fileLocationButton, true, true, 0);

			table = new Table(2, 3, false);
			table.Show();

			// Port number section
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Port Number</span>";
			mainVBox.PackStart(label, true, true, 0);

			// any port Entry
			anyPortButton = new RadioButton((Gtk.RadioButton)null);
			anyPortButton.Show();
			table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			vbox = new VBox();
			vbox.Show();

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Any available port";
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			// fixed port Entry
			fixedPortButton = new RadioButton(anyPortButton);
			fixedPortButton.Show();
			table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Use a fixed port";
			table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			portNumberEntry = new Entry();
			portNumberEntry.Show();
			table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);

			DeleteEvent += WindowDeleted;
		}
예제 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Sharpend.GtkSharp.FileChooserWrapper"/> class.
 /// </summary>
 /// <param name='title'>
 /// Title.
 /// </param>
 /// <param name='chooser'>
 /// Chooser.
 /// </param>
 /// <param name='action'>
 /// Action.
 /// </param>
 public FileChooserButtonWrapper(String title, FileChooserButton chooser,FileChooserAction action)
     : this(title,chooser,null,action)
 {
 }
예제 #27
0
#pragma warning restore 649

        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = Strings.EditIconForTagName(t.Name);

            // FIXME, Icon
            //preview_pixbuf = t.Icon;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out var screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new[] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Strings.SelectPhotoFromFile, Gtk.FileChooserAction.Open)
            {
                Filter = new FileFilter()
            };
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup       = string.Format($"\n<b>{Strings.FromPhoto}</b>\n{Strings.TagFromPhotoLabelMessage}", t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store)
            {
                PixbufColumn  = 1,
                SelectionMode = SelectionMode.Single
            };
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            //var fill_delay = new DelayedOperation (FillIconView);
            //fill_delay.Start ();
        }
예제 #28
0
		private void buildFoldersPanel()
		{
			downloadLocationButton = new FileChooserButton("Download location", FileChooserAction.SelectFolder);
			downloadLocationButton.SetCurrentFolder(userEngineSettings.SavePath);
			
			downloadLocationButton.CurrentFolderChanged += OnDownloadLocationButtonFolderChanged;
			foldersTable.Attach(downloadLocationButton, 1, 2, 0, 1);
			downloadLocationButton.Show();
			
			torrentStorageLocationButton = new FileChooserButton("Torrage storage location", FileChooserAction.SelectFolder);
			
			torrentStorageLocationButton.SetCurrentFolder(prefSettings.TorrentStorageLocation);
			
			torrentStorageLocationButton.CurrentFolderChanged += OnTorrentStorageLocationFolderChanged;
			foldersTable.Attach(torrentStorageLocationButton, 1, 2, 1, 2);
			torrentStorageLocationButton.Show();
		}
예제 #29
0
        public bool Execute(Tag t)
        {
            this.CreateDialog("edit_icon_dialog");

            this.Dialog.Title = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            PreviewPixbuf = t.Icon;

            query = new FSpot.PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = FSpot.OrTerm.FromTags(new Tag [] { t, db.Tags.Hidden });
            }
            else
            {
                query.Terms = new FSpot.Literal(t);
            }

            image_view = new FSpot.PhotoImageView(query);
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);

            Dialog.ShowAll();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            FSpot.Delay fill_delay = new FSpot.Delay(FillIconView);
            fill_delay.Start();

            ResponseType response = (ResponseType)this.Dialog.Run();
            bool         success  = false;

            if (response == ResponseType.Ok)
            {
                try {
                    if (IconName != null)
                    {
                        t.ThemeIconName = IconName;
                    }
                    else
                    {
                        t.ThemeIconName = null;
                        t.Icon          = PreviewPixbuf_WithoutProfile;
                    }
                    //db.Tags.Commit (t);
                    success = true;
                } catch (Exception ex) {
                    // FIXME error dialog.
                    Console.WriteLine("error {0}", ex);
                }
            }
            else if (response == (ResponseType)(1))
            {
                t.Icon  = null;
                success = true;
            }

            this.Dialog.Destroy();
            return(success);
        }
예제 #30
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new [] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            DelayedOperation fill_delay = new DelayedOperation(FillIconView);

            fill_delay.Start();
        }
예제 #31
0
        /// <summary>
        /// Sets the file chooser action and changes title and corresponding radiogroup state
        /// </summary>
        /// <param name='fc'>
        /// File chooser button.
        /// </param>
        /// <param name='action'>
        /// Action to set.
        /// </param>
        protected void SetFileChooserAction(FileChooserButton fc, FileChooserAction action)
        {
            fc.Action = action;

            if (fc.Action == FileChooserAction.Open)
            {
                radioFile.Active = true;
                fc.Title = Catalog.GetString ("Select a file");
            }
            else
            {
                radioFolder.Active = true;
                fc.Title = Catalog.GetString ("Select a folder");
            }
        }
예제 #32
0
        void SetFileEntry(bool isDir)
        {
            if (_choose != null)
            {
              _choose.Hide();
            }

              if (isDir)
            {
              _choose = new FileChooserButton(_("Open..."),
                      FileChooserAction.SelectFolder);
              _choose.SelectionChanged += delegate
            {
              string directory = _choose.Filename;
              if (directory.Length > 0)
              {
            _loader.Value = new DirImageProviderFactory(directory,
                                _recursive.Value);
              }
            };
            }
              else
            {
              _choose = new FileChooserButton(_("Open..."),
                      FileChooserAction.Open);
              _choose.SelectionChanged += delegate
            {
              string fileName = _choose.Filename;
              if (fileName.Length > 0)
              {
            _loader.Value = new FileImageProviderFactory(fileName);
              }
            };
            }

              _choose.Show();
              Table.Attach(_choose, 1, 2, 1, 2, AttachOptions.Shrink,
               AttachOptions.Fill, 0, 0);
        }
예제 #33
0
	public void InitializeGui()
	{
		m_MainPanel = new Fixed();
		m_OutConnectionStatus = new Label("Jaco is not connected.");
		
		m_GeneralPanel = new Fixed();
		m_TxtSerial = new Label("Jaco serial # :");
	    m_TxtModel = new Label("Jaco model :");
	    m_TxtSoftwareVersion = new Label("Software version :");
		m_TxtClientID = new Label("Client ID :");
	    m_TxtClientName = new Label("Client name :");
	    m_TxtClientOrganization = new Label("Client organization :");
		m_OutSerial = new Label("????");
	    m_OutModel = new Label("????");
	    m_OutSoftwareVersion = new Label("????");
		m_InClientID = new Entry("");
	    m_InClientName = new Entry("");
	    m_InClientOrganization = new Entry("");
		m_BTNUpdateGeneral = new Button("Update Jaco");
		m_BTNUpdateGeneral.Clicked += new EventHandler(BTN_UpdateClick);
		m_BTNReadGeneral = new Button("Read from Jaco");
		m_BTNReadGeneral.Clicked += new EventHandler (BTN_ReadClick);
		
		m_ConfigurationPanel = new Fixed();
		m_TxtSensitivity = new Label("Control's sensitivity :");
		m_TxtMaxSpeed = new Label("Permitted max speed :");
		m_TxtDrinkingHeight = new Label("Drinking height :");
		m_TxtDrinkingDistance = new Label("Drinking distance :");
		m_TxtLaterality = new Label("Laterality :");
		m_TxtFingersInverted = new Label("Fingers inverted :");
		m_TxtRetractAngle = new Label("Retracted position angle :");
		m_InSensitivity = new Entry("");
		m_InMaxSpeed = new Entry("");
		m_InDrinkingHeight = new Entry("");
		m_InDrinkingDistance = new Entry("");
		m_RadioRightHanded = new RadioButton("Righthanded");
		m_RadioLeftHanded = new RadioButton("Lefthanded");
		m_RadioLeftHanded.Group = m_RadioRightHanded.Group;
		m_CheckFingersInverted = new CheckButton("Invert fingers");
		m_InRetractAngle = new Entry("");
		m_BTNUpdateConfig = new Button("Update Jaco");
		m_BTNUpdateConfig.Clicked += new EventHandler(BTN_UpdateClick);
		m_BTNReadConfig = new Button("Read from Jaco");
		m_BTNReadConfig.Clicked += new EventHandler(BTN_ReadClick);
		
		m_DiagnosisPanel = new Fixed();
		m_TxtAxis1Version = new Label("Axis 1 version :");
		m_TxtAxis2Version = new Label("Axis 2 version :");
		m_TxtAxis3Version = new Label("Axis 3 version :");
		m_TxtAxis4Version = new Label("Axis 4 version :");
		m_TxtAxis5Version = new Label("Axis 5 version :");
		m_TxtAxis6Version = new Label("Axis 6 version :");
		m_TxtFinger1Version = new Label("Finger 1 version :");
		m_TxtFinger2Version = new Label("Finger 2 version :");
		m_TxtFinger3Version = new Label("Finger 3 version :");
		m_TxtMainCANVersion = new Label("Main CAN version :");
		m_TxtExtCANVersion = new Label("Ext CAN Version :");
		m_OutAxis1Version = new Label("????");
		m_OutAxis2Version = new Label("????");
		m_OutAxis3Version = new Label("????");
		m_OutAxis4Version = new Label("????");
		m_OutAxis5Version = new Label("????");
		m_OutAxis6Version = new Label("????");
		m_OutFinger1Version = new Label("????");
		m_OutFinger2Version = new Label("????");
		m_OutFinger3Version = new Label("????");
		m_OutMainCANVersion = new Label("????");
		m_OutExtCANVersion = new Label("????");
		m_TxtInfo = new Label("");
		m_InFileReprogram = new FileChooserButton("Select a file", FileChooserAction.Open);
		m_InFileReprogram.WidthRequest = 440;
		m_BTNReprogram = new Button("Reprogram Jaco");
		m_BTNReprogram.Clicked += new EventHandler(BTN_ReprogramClick);
		m_BTNReadDiagnosis = new Button("Read from Jaco");
		m_BTNReadDiagnosis.Clicked += new EventHandler(BTN_ReadClick);
		
		m_MainTitle = new Label("Kinova software example");
		Pango.FontDescription fontMaintTile = Pango.FontDescription.FromString("Garamond 30");
		m_MainTitle.ModifyFont(fontMaintTile);
		
		m_TabGeneral = new Label("General");
		m_TabConfiguration = new Label("Configuration");
		m_TabDiagnosis = new Label("Diagnosis");
		
		m_MainTab = new Notebook();
		m_MainTab.WidthRequest = 500;
		m_MainTab.HeightRequest = 500;
		m_MainTab.AppendPage(m_GeneralPanel, m_TabGeneral);
		m_MainTab.AppendPage(m_ConfigurationPanel, m_TabConfiguration);
		m_MainTab.AppendPage(m_DiagnosisPanel, m_TabDiagnosis);
	}