示例#1
0
        public FileActions()
        {
            New = new Gtk.Action ("New", Mono.Unix.Catalog.GetString ("New..."), null, "gtk-new");
            Open = new Gtk.Action ("Open", Mono.Unix.Catalog.GetString ("Open..."), null, "gtk-open");
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, "gtk-open",
                                           RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            recentData = new RecentData ();
            recentData.AppName = "Pinta";
            recentData.AppExec = GetExecutablePathname ();
            recentData.MimeType = "image/*";

            Close = new Gtk.Action ("Close", Mono.Unix.Catalog.GetString ("Close"), null, "gtk-close");
            Save = new Gtk.Action ("Save", Mono.Unix.Catalog.GetString ("Save"), null, "gtk-save");
            SaveAs = new Gtk.Action ("SaveAs", Mono.Unix.Catalog.GetString ("Save As..."), null, "gtk-save-as");
            Print = new Gtk.Action ("Print", Mono.Unix.Catalog.GetString ("Print"), null, "gtk-print");
            Exit = new Gtk.Action ("Exit", Mono.Unix.Catalog.GetString ("Quit"), null, "gtk-quit");

            //			OpenRecent.Sensitive = false;
            Close.Sensitive = false;
            Print.Sensitive = false;
        }
示例#2
0
        public FileActions()
        {
            New = new Gtk.Action ("New", Catalog.GetString ("New..."), null, Stock.New);
            Open = new Gtk.Action ("Open", Catalog.GetString ("Open..."), null, Stock.Open);
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, Stock.Open, RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            recentData = new RecentData ();
            recentData.AppName = "Pinta";
            recentData.AppExec = GetExecutablePathname ();
            recentData.MimeType = "image/*";

            lastDialogDir = System.Environment.GetFolderPath (Environment.SpecialFolder.MyPictures);

            Close = new Gtk.Action ("Close", Catalog.GetString ("Close"), null, Stock.Close);
            Save = new Gtk.Action ("Save", Catalog.GetString ("Save"), null, Stock.Save);
            SaveAs = new Gtk.Action ("SaveAs", Catalog.GetString ("Save As..."), null, Stock.SaveAs);
            Print = new Gtk.Action ("Print", Catalog.GetString ("Print"), null, Stock.Print);
            Exit = new Gtk.Action ("Exit", Catalog.GetString ("Quit"), null, Stock.Quit);

            New.ShortLabel = Catalog.GetString ("New");
            Open.ShortLabel = Catalog.GetString ("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
            Print.Sensitive = false;
        }
示例#3
0
        public FileActions()
        {
            New = new Gtk.Action ("New", Catalog.GetString ("New..."), null, Stock.New);
            NewScreenshot = new Gtk.Action ("NewScreenshot", Catalog.GetString ("New Screenshot..."), null, Stock.Fullscreen);
            Open = new Gtk.Action ("Open", Catalog.GetString ("Open..."), null, Stock.Open);
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, Stock.Open, RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            Close = new Gtk.Action ("Close", Catalog.GetString ("Close"), null, Stock.Close);
            Save = new Gtk.Action ("Save", Catalog.GetString ("Save"), null, Stock.Save);
            SaveAs = new Gtk.Action ("SaveAs", Catalog.GetString ("Save As..."), null, Stock.SaveAs);
            Print = new Gtk.Action ("Print", Catalog.GetString ("Print"), null, Stock.Print);
            Exit = new Gtk.Action ("Exit", Catalog.GetString ("Quit"), null, Stock.Quit);

            New.ShortLabel = Catalog.GetString ("New");
            Open.ShortLabel = Catalog.GetString ("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
            Print.Sensitive = false;
        }
示例#4
0
	public MainWindow (): base (MainClass.AppName)
	{
		this.Build();
				
		_views = new IGedcomView[]
		{
			SummaryViewView,
			FamilyViewView,
			IndividualViewView
		};
		_viewActions = new Gtk.Action[]
		{
			SummaryViewAction,
			FamilyViewAction,
			IndividualViewAction,
			SourceViewAction,
			MultimediaViewAction,
			RepositoryViewAction,
			PedigreeViewAction,
			NoteViewAction
		};
		
		foreach (IGedcomView view in _views)
		{
			view.MoreInformation += new EventHandler<IndividualArgs>(OnMoreInformation);
			view.MoreFamilyInformation += new EventHandler<FamilyArgs>(OnMoreFamilyInformation);
		    view.SpouseSelect += new EventHandler<SpouseSelectArgs>(OnSpouseSelect);
		    view.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
			view.SelectNewChild += new EventHandler<IndividualArgs>(OnSelectNewChild);
			view.SelectNewSpouse += new EventHandler<IndividualArgs>(OnSelectNewSpouse);
			view.SelectNewNote += new EventHandler<NoteArgs>(OnSelectNewNote);
			view.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
			view.ShowName += new EventHandler<IndividualArgs>(OnShowName);
			view.DeleteIndividual += new EventHandler<IndividualArgs>(OnDeleteIndividual);
			view.MoreFactInformation += new EventHandler<FactArgs>(OnMoreFactInformation);
		}

		SourceViewView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
		SourceViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		MultimediaViewView.AddFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_AddFile);
		MultimediaViewView.OpenFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_OpenFile);
		MultimediaViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		RepositoryViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		NotesViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		
		// FIXME: not working via property in designer show all kicking in?
		NotesViewView.NoteOnly = true;
		
		ViewNotebook.ShowTabs = false;		
		ViewNotebook.Page = 0;
		_currentView = _views[0];
		
		ViewNotebook.Sensitive = false;
		Merge.Sensitive = false;
		Save.Sensitive = false;
		SaveAs.Sensitive = false;
		PropertiesAction.Sensitive = false;


		_viewGroup = View.ActionGroup;
		_toolsGroup = Tools.ActionGroup;
		_reportsGroup = Reports.ActionGroup;
		_defaultGroup = New.ActionGroup;		
		
		// get all report related actions, make insensitive
		foreach (Gtk.Action action in _reportsGroup.ListActions())
		{
			action.Sensitive = false;
		}
		
		// get all tools related actions, make insensitive
		foreach (Gtk.Action action in _toolsGroup.ListActions())
		{
			action.Sensitive = false;
		}
		
		// get all view related actions, make insensitive
		foreach (Gtk.Action action in _viewGroup.ListActions())
		{
			action.Sensitive = false;
		}
		SummaryViewAction.ActionGroup.Sensitive = true;

		NewIndividual.Sensitive = false;
		NewMedia.Sensitive = false;
		NewRepository.Sensitive = false;
		NewSource.Sensitive = false;
		NewNote.Sensitive = false;	

		// dropdown actions, not supported by stetic
		Gtk.UIManager manager = new Gtk.UIManager();
		GtkDropDownAction newDropDown = new GtkDropDownAction("New", "New", string.Empty, Gtk.Stock.New);
		newDropDown.Activated += OnNew_Activated;
		newDropDown.UIManager = manager;
		newDropDown.MenuPath = "/newpopup";
		manager.InsertActionGroup(_defaultGroup, 0);
		manager.AddUiFromString("<ui><popup name='newpopup'><menuitem action='NewDatabase'/><menuitem action='NewIndividual'/><menuitem action='NewMedia'/><menuitem action='NewRepository'/><menuitem action='NewSource'/><menuitem action='NewNote'/></popup></ui>");
		Gtk.Widget newButton = newDropDown.CreateToolItem();
		newDropDown.ConnectProxy(newButton);
		
		toolbar1.Insert((Gtk.ToolItem)newButton, 0);
		
		// gtk recent actions, not supported by stetic or gtk# 2.10
		_recentManager = Gtk.RecentManager.Default;
		//_recentManager.Limit = 4; // FIXME: don't hardcode max recent file count
		
		Gtk.RecentChooserMenu menu = new RecentChooserMenu(_recentManager);
		menu.LocalOnly = true;
		menu.SortType = RecentSortType.Mru;
		
		Gtk.RecentFilter filter = new RecentFilter();
		filter.Name = "GEDCOM files";
		filter.AddMimeType("application/x-gedcom");
		menu.AddFilter(filter);		
		menu.Filter = filter;
		menu.ItemActivated += RecentMenu_ItemActivated;
		_toolbarRecentMenu = menu;
		
		GtkDropDownAction recentDropDown = new GtkDropDownAction("Open", "Open", "Open File", Gtk.Stock.Open);
		recentDropDown.Menu = menu;
		recentDropDown.Activated += OnOpen_Activated;
		Gtk.Widget openButton = recentDropDown.CreateToolItem();
		recentDropDown.ConnectProxy(openButton);
		
		toolbar1.Insert((Gtk.ToolItem)openButton, 1);
	}