Example #1
0
		public MainWindow (): base (Gtk.WindowType.Toplevel)
		{
			// this window
			this.Title= "Supos";
			this.DeleteEvent += OnDeleteEvent;
			// main vbox
			mainBox = new VBox(false, 0);
			this.Add(mainBox);
			// actiongroup and uimanager stuff (menubar)
			actgroup = new ActionGroup ("TestActions");
			SetUpActionGroup();			
			uim = new UIManager ();
			uim.InsertActionGroup (actgroup, 0);
			this.AddAccelGroup(uim.AccelGroup);
			SetUpUiManager();
			Gtk.Widget menubar = uim.GetWidget("/MenuBar");
			mainBox.PackStart(menubar, false, false, 0);
			actgroup.GetAction("disconnect").Sensitive=false;
			// main panned view
			mainPaned = new HPaned();
			mainPaned.Sensitive = false;
			mainPaned.Name = "toucharea";			
			mainBox.PackStart(mainPaned, true, true, 0);
			// order editing view
			orderview = new ViewOrderEdit();
			mainPaned.Pack2(orderview, false, false);
			// categories product paned view
			HPaned hpan2;
			hpan2 = new HPaned();
			mainPaned.Pack1(hpan2, true, false);
			// categories view	
			catview = new ViewNameIcon();
			catview.DataMember="Categories";
			catview.SelectionChanged += this.OnCatSelectionChanged;
			catview.WidthRequest= 200;
			hpan2.Pack1(catview, false, false);
			// products view
			prodview = new ViewNameIcon();
			prodview.DataMember = "Products";
			prodview.RowActivated += this.OnProdRowActivated;			
			prodview.WidthRequest= 400;
			hpan2.Pack2(prodview, true, false);
			// status bar
			Statusbar statusbar;
			statusbar = new Statusbar();
			mainBox.PackStart(statusbar, false, false, 0);
			// clock
			Clock clock;
			clock = new Clock();
			clock.BorderWidth = 6;			
			statusbar.PackStart(clock, false, false, 0);
			// END build interface
			
			this.ApplyViewPreferences(SettingsHandler.Settings.viewSettings);
			
		}
        private void InstallInterfaceActions()
        {
            InterfaceActionService action_service = ServiceManager.Get<InterfaceActionService> ();

            lyrics_action_group = new ActionGroup ("Lyrics");

            lyrics_action_group.Add (new ActionEntry[] {
                new ActionEntry ("LyricsAction", null,
                    AddinManager.CurrentLocalizer.GetString ("L_yrics"), null,
                    AddinManager.CurrentLocalizer.GetString ("Manage Lyrics"), null),
                new ActionEntry ("FetchLyricsAction", null,
                    AddinManager.CurrentLocalizer.GetString ("_Download Lyrics"), null,
                    AddinManager.CurrentLocalizer.GetString ("Download lyrics for all tracks"), OnFetchLyrics)
            });

            lyrics_action_group.Add (new ToggleActionEntry[] {
                new ToggleActionEntry ("ShowLyricsAction", null,
                            AddinManager.CurrentLocalizer.GetString ("Show Lyrics"), "<control>T",
                            AddinManager.CurrentLocalizer.GetString ("Show Lyrics in a separate window"), null, false) });

            lyrics_action_group.GetAction ("ShowLyricsAction").Activated += OnToggleWindow;
            lyrics_action_group.GetAction ("ShowLyricsAction").Sensitive = ServiceManager.PlayerEngine.CurrentTrack != null ? true : false;

            action_service.AddActionGroup (lyrics_action_group);

            ui_manager_id = action_service.UIManager.AddUiFromResource ("LyricsMenu.xml");
        }