示例#1
0
        private Widget GetWidget(CustomAttributeCollection cac)
        {
            FontDescription fd = FontDescription.FromString("Courier 10 Pitch 10");

            VBox vbox = new VBox(false, 0);

            ScrolledWindow sw = new ScrolledWindow();

            sw.AddWithViewport(vbox);

            if ((cac != null) && (cac.Count > 0))
            {
                foreach (CustomAttribute ca in cac)
                {
                    TextView textview = new TextView();
                    textview.Editable    = false;
                    textview.Buffer.Text = Format(ca);
                    textview.ModifyFont(fd);

                    Expander expander = new Expander(ca.Constructor.DeclaringType.FullName);
                    expander.Add(textview);

                    vbox.Add(expander);
                }
            }

            sw.ShowAll();
            return(sw);
        }
示例#2
0
 protected virtual void OnMapped(object sender, EventArgs e)
 {
     if (!mapped)
     {
         mapped = true;
         ThreadPool.QueueUserWorkItem(state => {
             Widget widget;
             try {
                 widget = provider.ProvideInfo(service);
             } catch (Exception exception) {
                 var vbox = new VBox();
                 vbox.PackStart(new Gtk.Label("Failed to Load " + provider.Name), true, true, 0);
                 var expander = new Expander("Error");
                 expander.Add(new Label(exception.ToString()));
                 vbox.PackStart(expander, true, true, 0);
                 widget = vbox;
             }
             Gtk.Application.Invoke((o, a) => {
                 alignment.Remove(alignment.Child);
                 alignment.Add(widget);
                 ShowAll();
             });
         });
     }
 }
        /// <summary>
        /// Intializes the windows widgets.
        /// </summary>
        private void InitializeWidgets()
        {
            mainWindow.Title = title;

            // We load the icons
            menuLoadImage.Image      = ImageResources.LoadImage("insert-image16");
            toolLoadImage.IconWidget = ImageResources.LoadImage("insert-image22");

            menuOpenDatabaseManager.Image = ImageResources.LoadImage("database16");
            toolDatabase.IconWidget       = ImageResources.LoadImage("database22");

            // The log view is created
            logView = new LogView();
            expLog.Add(logView);

            while (recognizingStepsNB.NPages > 0)
            {
                recognizingStepsNB.RemovePage(0);
            }

            recognizingStepsNB.AppendPage(new InitialStageWidget(this),
                                          new Label(InitialStageWidget.WidgetLabel));

            mainWindow.ShowAll();

            recognizingStepsNB.Page = 0;
        }
示例#4
0
		public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok)
		{
			HBox hbox = new HBox();
			Image icon = new Image(Stock.DialogError,IconSize.Dialog);
			Label label = new Label(message);
			Expander exp = new Expander("Details");
			ScrolledWindow sw = new ScrolledWindow();
			TextView tview = new TextView();
			
			hbox.BorderWidth = 6;
			hbox.Spacing = 6;
			label.SetAlignment(0f, 0.5f);
			exp.BorderWidth = 6;
			tview.Buffer.Text = e.Message;
			tview.Buffer.Text += "\n";
			tview.Buffer.Text += e.StackTrace;
			
			sw.Add(tview);
			exp.Add(sw);
			hbox.PackStart(icon, false, false, 0);
			hbox.PackStart(label, true, true, 0);
			this.VBox.PackStart(hbox, false, false, 0);
			this.VBox.PackStart(exp, true, true, 0);
			this.ShowAll();
			
		}
示例#5
0
        public MetadataDisplayWidget()
        {
            main_vbox = new VBox {
                Spacing = 6
            };

            metadata_message = new Label(string.Empty)
            {
                UseMarkup = true,
                LineWrap  = true
            };
            metadata_vbox = new VBox {
                Spacing = 6
            };

            main_vbox.PackStart(metadata_vbox, false, false, 0);
            AddWithViewport(metadata_message);
            ((Viewport)Child).ShadowType = ShadowType.None;
            BorderWidth = 3;

            display      = DisplayState.message;
            ExposeEvent += HandleExposeEvent;

            open_list = new List <string> ();

            // Create Expander and TreeView for
            // extended metadata
            var tree_view = new TreeView {
                HeadersVisible = false,
                RulesHint      = true
            };

            var col = new TreeViewColumn {
                Sizing = TreeViewColumnSizing.Autosize
            };
            CellRenderer colr = new CellRendererText();

            col.PackStart(colr, false);

            col.AddAttribute(colr, "markup", 0);

            tree_view.AppendColumn(col);

            extended_metadata = new ListStore(typeof(string));
            tree_view.Model   = extended_metadata;

            var expander = new Expander($"<span weight=\"bold\"><small>{Strings.ExtendedMetadata}</small></span>")
            {
                UseMarkup = true
            };

            expander.Add(tree_view);
            expander.Expanded = true;

            main_vbox.PackStart(expander, false, false, 6);
            expander.ShowAll();

            Task.Run(Update);
        }
        private void BuildContents()
        {
            VBox box = new VBox();

            box.BorderWidth = 8;
            box.Spacing     = 10;
            box.Show();

            header_label.Xalign = 0.0f;

            header_label.Show();
            description_label.Show();
            normal_controls_table.Show();
            advanced_controls_table.Show();

            advanced_expander.Add(advanced_controls_table);
            advanced_expander.Show();

            box.PackStart(header_label, false, false, 0);
            box.PackStart(description_label, false, false, 0);
            box.PackStart(normal_controls_table, false, false, 5);
            box.PackStart(advanced_expander, false, false, 0);

            if (sexpr_results != null)
            {
                ScrolledWindow scroll = new Gtk.ScrolledWindow();
                scroll.HscrollbarPolicy = PolicyType.Automatic;
                scroll.VscrollbarPolicy = PolicyType.Automatic;
                scroll.ShadowType       = ShadowType.In;
                sexpr_results.WrapMode  = WrapMode.Word;
                sexpr_results.SetSizeRequest(-1, 100);
                scroll.Add(sexpr_results);
                scroll.ShowAll();

                VSeparator sep = new VSeparator();
                sep.Show();

                Label label = new Label();
                label.Markup = "<b>S-Expr Results</b>";
                label.Xalign = 0.0f;
                label.Show();

                box.PackStart(sep, false, false, 0);
                box.PackStart(label, false, false, 0);
                box.PackStart(scroll, false, false, 0);
            }

            VBox.PackStart(box, false, false, 0);

            SetSizeRequest(350, -1);

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
示例#7
0
        public FaceSidebarWidget()
        {
            instance = this;

            mainVBox = new VBox();
            //mainVBox.Spacing = 6;
            //faceVBox = new VBox();
            faceVPane = new VPaned();

            pleaseSelectPictureLabel = new Label ();
            pleaseSelectPictureLabel.Markup = SelectImageMarkup;
            //headerLabel =  new Label (Catalog.GetString ("Not Implemented Yet"));
            mainVBox.PackStart(pleaseSelectPictureLabel,false,false,0);

            knownFaceExpander = new Expander("In this photo:");

            //faceVBox.PackStart(knownFaceExpander,true,true,0);
            //faceVPane.Add(knownFaceExpander);
            knownFaceScrolledWindow = new ScrolledWindow();
            knownFaceExpander.Add(knownFaceScrolledWindow);
            faceVPane.Pack1(knownFaceExpander,true,true);
            //knownFaceExpander.HeightRequest = 30;
            //			faceHandleBox = new HandleBox();
            //			faceHandleBox.HandlePosition = PositionType.Top;
            //			faceVBox.PackStart(faceHandleBox,false,false,0);

            unknownFaceExpander = new Expander("Who's also in this photo");
            //faceVBox.PackStart(unknownFaceExpander,true,true,0);
            //faceVPane.Add(unknownFaceExpander);

            unknownFaceScrolledWindow = new ScrolledWindow();
            unknownFaceExpander.Add(unknownFaceScrolledWindow);
            faceVPane.Pack2(unknownFaceExpander,true,true);
            //unknownFaceExpander.HeightRequest = 30;
            mainVBox.PackStart(faceVPane,true,true,0);

            detectFaceButton = new Button(Catalog.GetString("Re-Detect Face From This Picture"));
            mainVBox.PackEnd(detectFaceButton,false,false,0);
            detectFaceButton.Clicked += DetectFaceButtonClicked;

            addFaceButton = new Button(manualAddFaceString);
            mainVBox.PackEnd(addFaceButton,false,false,0);
            addFaceButton.Clicked += AddFaceButtonClicked;

            knownFaceScrolledWindow.Visible = false;
            unknownFaceScrolledWindow.Visible = false;

            knownFaceExpander.ResizeMode = ResizeMode.Parent;
            unknownFaceExpander.ResizeMode = ResizeMode.Parent;
            Log.Debug("HeightR");

            ShadowType = ShadowType.None;
            BorderWidth = 0;
            //AddWithViewport(pleaseSelectPictureLabel);
            AddWithViewport (mainVBox);
            //mainVBox.Visible = false;
            ShowAll();
        }
示例#8
0
        protected virtual void OnInvokeClicked(object sender, System.EventArgs e)
        {
            foreach (var child in outputsBox.Children)
            {
                outputsBox.Remove(child);
            }

            var arguments = new Dictionary <string, string> ();
            var children  = table.Children;

            for (var i = children.Length - 1; i > 0; i -= 2)
            {
                string value;
                var    child = children[i - 1];
                var    entry = child as Entry;
                if (entry != null)
                {
                    value = entry.Text;
                }
                else
                {
                    value = ((ComboBox)child).ActiveText;
                }
                arguments[((Label)children[i]).Text] = value;
            }

            inputsBox.Sensitive = false;
            invoke.Sensitive    = false;

            ThreadPool.QueueUserWorkItem(state => {
                try  {
                    var results = action.Invoke(arguments);
                    if (results == null)
                    {
                        return;
                    }
                    Application.Invoke((o, a) => {
                        foreach (var result in results)
                        {
                            var expander = new Expander(result.Key);
                            expander.Add(new Label(result.Value)
                            {
                                LineWrap = true, Selectable = true
                            });
                            outputsBox.PackStart(expander, false, false, 0);
                        }
                        outputsBox.ShowAll();
                        inputsBox.Sensitive = true;
                        invoke.Sensitive    = true;
                    });
                } catch (UpnpControlException exception) {
                    // TODO report error to the UI
                    Console.WriteLine("Upnp error: " + exception.UpnpError);
                }
            });
        }
示例#9
0
        public Dialog(VariableSet variables)
            : base(_("UpdateCheck"), variables)
        {
            var vbox = new VBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(vbox, true, true, 0);

              var table = new GimpTable(4, 3)
            {ColumnSpacing = 6, RowSpacing = 6};
              vbox.PackStart(table, true, true, 0);

              table.Attach(new GimpCheckButton(_("Check _GIMP"),
                       GetVariable<bool>("check_gimp")),
               0, 1, 0, 1);

              table.Attach(new GimpCheckButton(_("Check G_IMP#"),
                       GetVariable<bool>("check_gimp_sharp")),
               0, 1, 1, 2);

              table.Attach(new GimpCheckButton(_("Check _Unstable Releases"),
                       GetVariable<bool>("check_unstable")),
               0, 1, 2, 3);

              var enableProxy = GetVariable<bool>("enable_proxy");
              var httpProxy = GetVariable<string>("http_proxy");
              var port = GetVariable<string>("port");

              string tmp = Gimp.RcQuery("update-enable-proxy");
              enableProxy.Value = (tmp != null || tmp == "true");
              httpProxy.Value =  Gimp.RcQuery("update-http-proxy") ?? "";
              port.Value = Gimp.RcQuery("update-port") ?? "";

              var expander = new Expander(_("Proxy settings"));
              var proxyBox = new VBox(false, 12);

              proxyBox.Add(new GimpCheckButton(_("Manual proxy configuration"),
                       enableProxy));

              var hbox = new HBox(false, 12) {Sensitive = enableProxy.Value};
              proxyBox.Add(hbox);

              hbox.Add(new Label(_("HTTP Proxy:")));
              hbox.Add(new GimpEntry(httpProxy));

              hbox.Add(new Label(_("Port:")));
              hbox.Add(new GimpEntry(port) {WidthChars = 4});

              enableProxy.ValueChanged += delegate
            {
              hbox.Sensitive = enableProxy.Value;
            };

              expander.Add(proxyBox);
              table.Attach(expander, 0, 1, 3, 4);
        }
示例#10
0
        public ErrorListDialog() : base(Catalog.GetString("Error"))
        {
            var table = new Table(3, 2, false)
            {
                RowSpacing    = 12,
                ColumnSpacing = 16
            };

            table.Attach(icon_image = new Image()
            {
                IconName = "dialog-error",
                IconSize = (int)IconSize.Dialog,
                Yalign   = 0.0f
            }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach(header_label = new Label()
            {
                Xalign = 0.0f
            }, 1, 2, 0, 1,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Shrink, 0, 0);

            table.Attach(message_label = new Hyena.Widgets.WrapLabel(), 1, 2, 1, 2,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow()
            {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType       = ShadowType.In
            };

            list_view = new TreeView()
            {
                HeightRequest = 120,
                WidthRequest  = 200
            };
            scrolled_window.Add(list_view);

            table.Attach(details_expander = new Expander(Catalog.GetString("Details")),
                         1, 2, 2, 3,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Fill | AttachOptions.Expand,
                         0, 0);
            details_expander.Add(scrolled_window);

            VBox.PackStart(table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll();

            details_expander.Activated += OnConfigureGeometry;
            Realized += OnConfigureGeometry;
        }
示例#11
0
        public DirPropertyWidget(FilePropertisData fpd)
        {
            project = fpd.Project;
            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null){
                fiOld =new FileItem(fpd.Filename,false);
                fiOld.IsDirectory = true;
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
                fiOld.ConditionValues = new System.Collections.Generic.List<ConditionRule>();

            Table mainTable = new Table(2,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN =GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); // new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));

            Entry entr = new Entry(fiOld.SystemFilePath);
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(MainClass.Workspace.GetFullPath(fiOld.SystemFilePath));
            entrFullPath.IsEditable = false;

            Label lblPrj = GetLabel(project.ProjectName); //new Label(project.ProjectName);

            AddControl(ref propertyTable,0,lblFN,"Name ");
            AddControl(ref propertyTable,1,entr,"Relative Path ");
            AddControl(ref propertyTable,2,entrFullPath,"Full Path ");
            AddControl(ref propertyTable,3,lblPrj,"Project ");

            int rowCount = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }
            Expander exp1 = new Expander("General");
            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");
            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            mainTable.Attach(exp2,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
示例#12
0
        public MetadataDisplayWidget()
        {
            main_vbox         = new VBox();
            main_vbox.Spacing = 6;

            metadata_message           = new Label(string.Empty);
            metadata_message.UseMarkup = true;
            metadata_message.LineWrap  = true;
            metadata_vbox         = new VBox();
            metadata_vbox.Spacing = 6;

            main_vbox.PackStart(metadata_vbox, false, false, 0);
            AddWithViewport(metadata_message);
            ((Viewport)Child).ShadowType = ShadowType.None;
            BorderWidth = 3;

            display      = DisplayState.message;
            ExposeEvent += HandleExposeEvent;

            open_list = new List <string> ();

            // Create Expander and TreeView for
            // extended metadata
            var tree_view = new TreeView();

            tree_view.HeadersVisible = false;
            tree_view.RulesHint      = true;

            var col = new TreeViewColumn();

            col.Sizing = TreeViewColumnSizing.Autosize;
            CellRenderer colr = new CellRendererText();

            col.PackStart(colr, false);

            col.AddAttribute(colr, "markup", 0);

            tree_view.AppendColumn(col);

            extended_metadata = new ListStore(typeof(string));
            tree_view.Model   = extended_metadata;

            var expander = new Expander(string.Format("<span weight=\"bold\"><small>{0}</small></span>", Catalog.GetString("Extended Metadata")));

            expander.UseMarkup = true;
            expander.Add(tree_view);
            expander.Expanded = true;

            main_vbox.PackStart(expander, false, false, 6);
            expander.ShowAll();

            update_delay = new DelayedOperation(Update);
            update_delay.Start();
        }
示例#13
0
        [FactIfSupported(requiresWindowsBasedOperatingSystem: true)] /* No AppData folder on Unix */
        public void CreateDirectoryOnSystemMountWhereAllowed()
        {
            // testing with a stricter behavior
            Configuration.Sandbox.EnforceAccessPoliciesOnDirectoryCreation = true;

            string appDataRoamingPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);

            Test.BuildXL.TestUtilities.Xunit.XAssert.IsFalse(string.IsNullOrEmpty(appDataRoamingPath));

            var appData = AbsolutePath.Create(Context.PathTable, appDataRoamingPath);

            Expander.Add(
                Context.PathTable,
                new SemanticPathInfo(
                    rootName: PathAtom.Create(Context.PathTable.StringTable, "AppDataRoaming"),
                    root: appData,
                    allowHashing: true,
                    readable: true,
                    writable: false,
                    system: true,
                    allowCreateDirectory: true));

            string cookiesPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Cookies);

            if (!string.IsNullOrEmpty(cookiesPath))
            {
                AbsolutePath cookies = AbsolutePath.Create(Context.PathTable, cookiesPath);

                Expander.Add(
                    Context.PathTable,
                    new SemanticPathInfo(
                        rootName: PathAtom.Create(Context.PathTable.StringTable, "INetCookies"),
                        root: cookies,
                        allowHashing: true,
                        readable: true,
                        writable: false,
                        system: true,
                        allowCreateDirectory: true));
            }

            var builderA = CreatePipBuilder(new Operation[]
            {
                Operation.WriteFile(CreateOutputFileArtifact()),
                Operation.CreateDir(DirectoryArtifact.CreateWithZeroPartialSealId(appData), doNotInfer: true),
            });

            SchedulePipBuilder(builderA);

            ScheduleRunResult result = RunScheduler();

            result.AssertSuccess();
        }
示例#14
0
 public TempDirectoryTests(ITestOutputHelper output) : base(output)
 {
     // Create a temp root
     TempRoot = Path.Combine(ObjectRoot, "temp");
     Directory.CreateDirectory(TempRoot);
     TempRootPath = AbsolutePath.Create(Context.PathTable, TempRoot);
     Expander.Add(Context.PathTable, new SemanticPathInfo(
                      rootName: PathAtom.Create(Context.PathTable.StringTable, "TempRoot"),
                      root: TempRootPath,
                      allowHashing: true,
                      readable: true,
                      writable: true));
 }
示例#15
0
 private Widget CreateMoreOptionsExpander(string defaultDomainID)
 {
     optionsExpander = new Expander(Util.GS("More options"));
        optionsExpander.Activated += new EventHandler(OnOptionsExpanded);
        Table optionsTable = new Table(2, 3, false);
        optionsExpander.Add(optionsTable);
        optionsTable.ColumnSpacing = 10;
        optionsTable.RowSpacing = 10;
        optionsTable.SetColSpacing(0, 30);
        Label l = new Label(Util.GS("iFolder Account:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,0,1,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        domainComboBox = ComboBox.NewText();
        optionsTable.Attach(domainComboBox, 2,3,0,1,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        int defaultDomain = 0;
        for (int x = 0; x < domains.Length; x++)
        {
     domainComboBox.AppendText(domains[x].Name);
     if (defaultDomainID != null)
     {
      if (defaultDomainID == domains[x].ID)
       defaultDomain = x;
     }
     else
      defaultDomain = x;
        }
        domainComboBox.Active = defaultDomain;
        l = new Label(Util.GS("Description:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,1,2,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        descriptionTextView = new TextView();
        descriptionTextView.LeftMargin = 4;
        descriptionTextView.RightMargin = 4;
        descriptionTextView.Editable = true;
        descriptionTextView.CursorVisible = true;
        descriptionTextView.AcceptsTab = false;
        descriptionTextView.WrapMode = WrapMode.WordChar;
        ScrolledWindow sw = new ScrolledWindow();
        sw.ShadowType = ShadowType.EtchedIn;
        sw.Add(descriptionTextView);
        optionsTable.Attach(sw, 2,3,1,2,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        optionsTable.ShowAll();
        return optionsExpander;
 }
示例#16
0
        private void Build()
        {
            var hbox = new HBox();

            hbox.Spacing     = 6;
            hbox.BorderWidth = 12;

            var error_icon = new Image();

            error_icon.Pixbuf = PintaCore.Resources.GetIcon(Stock.DialogError, 32);
            error_icon.Yalign = 0;
            hbox.PackStart(error_icon, false, false, 0);

            var vbox = new VBox();

            vbox.Spacing = 6;

            description_label        = new Label();
            description_label.Wrap   = true;
            description_label.Xalign = 0;
            vbox.PackStart(description_label, false, false, 0);

            expander     = new Expander(Catalog.GetString("Details"));
            details_text = new TextView();
            var scroll = new ScrolledWindow();

            scroll.Add(details_text);
            scroll.HeightRequest = 250;
            expander.Add(scroll);
            vbox.Add(expander);

            hbox.Add(vbox);
            this.VBox.Add(hbox);

            bug_report_button          = new Button(Catalog.GetString("Report Bug...."));
            bug_report_button.CanFocus = false;
            ActionArea.Add(bug_report_button);

            var ok_button = new Button(Gtk.Stock.Ok);

            ok_button.CanDefault = true;
            AddActionWidget(ok_button, ResponseType.Ok);

            DefaultWidth  = 600;
            DefaultHeight = 142;

            ShowAll();
        }
示例#17
0
        public ErrorListDialog () : base (Catalog.GetString ("Error"))
        {
            var table = new Table (3, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 16
            };

            table.Attach (icon_image = new Image () {
                    IconName = "dialog-error",
                    IconSize = (int)IconSize.Dialog,
                    Yalign = 0.0f
                }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach (header_label = new Label () { Xalign = 0.0f }, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            table.Attach (message_label = new Hyena.Widgets.WrapLabel (), 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };

            list_view = new TreeView () {
                HeightRequest = 120,
                WidthRequest = 200
            };
            scrolled_window.Add (list_view);

            table.Attach (details_expander = new Expander (Catalog.GetString ("Details")),
                1, 2, 2, 3,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand,
                0, 0);
            details_expander.Add (scrolled_window);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            details_expander.Activated += OnConfigureGeometry;
            Realized += OnConfigureGeometry;
        }
示例#18
0
        /// <summary>
        /// Show the specified editor.
        /// </summary>
        /// <param name="editor">The editor to show</param>
        public void ShowEditorPanel(object editorObj, string expanderLabel)
        {
            Widget editor = editorObj as Widget;

            if (editor != null)
            {
                expander1.Foreach(delegate(Widget widget) { if (widget != label2)
                                                            {
                                                                expander1.Remove(widget);
                                                            }
                                  });
                expander1.Add(editor);
                expander1.Visible  = true;
                expander1.Expanded = true;
                label2.Text        = expanderLabel;
            }
        }
示例#19
0
        ListStore AddExpander(string name, int pos)
        {
            var tree_view = new TreeView {
                HeadersVisible = false,
                RulesHint      = true
            };

            var col = new TreeViewColumn {
                Sizing = TreeViewColumnSizing.Autosize
            };
            CellRenderer colr = new CellRendererText();

            col.PackStart(colr, false);

            col.AddAttribute(colr, "markup", 0);

            tree_view.AppendColumn(col);

            var model = new ListStore(typeof(string));

            tree_view.Model = model;

            var expander = new Expander($"<span weight=\"bold\"><small>{name}</small></span>")
            {
                UseMarkup = true
            };

            expander.Add(tree_view);
            expander.Expanded = true;

            metadata_vbox.PackStart(expander, false, false, 6);
            metadata_vbox.ReorderChild(expander, pos);

            if (open_list.Contains(name))
            {
                expander.Expanded = true;
            }

            expander.Activated += HandleExpanderActivated;

            expander.ShowAll();

            return(model);
        }
 public DeviceDescriptionInfo (Device device)
 {
     this.Build ();
     
     deviceType.Text = device.Type.ToString ();
     udn.Text = device.Udn;
     friendlyName.Text = device.FriendlyName;
     manufacturer.Text = device.Manufacturer;
     manufacturerUrl.Text = device.ManufacturerUrl != null ? device.ManufacturerUrl.ToString () : null;
     modelName.Text = device.ModelName;
     modelNumber.Text = device.ModelNumber;
     modelUrl.Text = device.ModelUrl != null ? device.ModelUrl.ToString () : null;
     serialNumber.Text = device.SerialNumber;
     upc.Text = device.Upc;
     foreach (var icon in device.Icons) {
         var expander = new Expander (string.Format ("{0}, {1}x{2}x{3}", icon.MimeType, icon.Width, icon.Height, icon.Depth));
         expander.Add (new LazyIcon (icon));
         iconBox.PackStart (expander, true, true, 0);
     }
 }
        /// <summary>
        /// Inicializa los controles de la ventana.
        /// </summary>
        private void Initialize()
        {
            mainWindow.Title = title;

            imageAreaOriginal           = new ImageArea();
            imageAreaOriginal.ImageMode = ImageAreaMode.Zoom;
            frameOriginal.Add(imageAreaOriginal);

            imageAreaProcessed           = new ImageArea();
            imageAreaProcessed.ImageMode = ImageAreaMode.Zoom;
            frameProcessed.Add(imageAreaProcessed);

            logView = new LogView();
            expanderLog.Add(logView);

            // La imagen reducida en la primera columna
            imagesIV.PixbufColumn      = 0;
            imagesIV.SelectionChanged +=
                new EventHandler(OnImagesIVSelectionChanged);

            imagesStore = new ListStore(typeof(Gdk.Pixbuf),
                                        typeof(Gdk.Pixbuf));

            imagesIV.Model = imagesStore;

            imagesStore.RowInserted += OnImagesStoreRowInserted;
            imagesStore.RowDeleted  += OnImagesStoreRowDeleted;

            toolNewDatabase.IconWidget =
                ImageResources.LoadImage("database-new22");

            menuDatabase.Image = ImageResources.LoadImage("database-new16");

            symbolLabelEditor = new SymbolLabelEditorWidget();

            symbolEditorPlaceholder.Add(symbolLabelEditor);

            labelTooltips = new Tooltips();

            mainWindow.ShowAll();
        }
示例#22
0
        private ListStore AddExpander(string name, int pos)
        {
            TreeView tree_view = new TreeView();

            tree_view.HeadersVisible = false;
            tree_view.RulesHint      = true;

            TreeViewColumn col = new TreeViewColumn();

            col.Sizing = TreeViewColumnSizing.Autosize;
            CellRenderer colr = new CellRendererText();

            col.PackStart(colr, false);

            col.AddAttribute(colr, "markup", 0);

            tree_view.AppendColumn(col);

            ListStore model = new ListStore(typeof(string));

            tree_view.Model = model;

            Expander expander = new Expander(String.Format("<span weight=\"bold\"><small>{0}</small></span>", name));

            expander.UseMarkup = true;
            expander.Add(tree_view);

            exif_vbox.PackStart(expander, false, false, 6);
            exif_vbox.ReorderChild(expander, pos);

            if (open_list.Contains(name))
            {
                expander.Expanded = true;
            }

            expander.Activated += HandleExpanderActivated;

            expander.ShowAll();

            return(model);
        }
示例#23
0
		public DemoExpander () : base ("Demo Expander", null, DialogFlags.DestroyWithParent)
		{
			Resizable = false;

			VBox vbox = new VBox (false, 5);
			this.ContentArea.PackStart (vbox, true, true, 0);
			vbox.BorderWidth = 5;

			vbox.PackStart (new Label ("Expander demo. Click on the triangle for details."), false, false, 0);

			// Create the expander
			Expander expander = new Expander ("Details");
			expander.Add (new Label ("Details can be shown or hidden."));
			vbox.PackStart (expander, false, false, 0);

			AddButton (Stock.Close, ResponseType.Close);

			ShowAll ();
			Run ();
			Destroy ();
		}
示例#24
0
        public ExpressionField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(0, 0, 1, 1)
        {
            this.property = property;
            this.obj      = obj;
            exp           = (Expression)property.GetValue(obj);
            this.context  = context;
            title         = attribute.overrideLabel ?? UIFactory.ToReadable(property.Name);

            Label label = new Label();

            label.UseMarkup = true;
            label.Justify   = Justification.Right;
            label.SetAlignment(0, 0);

            //Multi-line expressions are put in an expander with the label text being the formattedResult of the expression.
            if (exp.text.Contains("\n"))
            {
                Expander expander = new Expander(title + ": " + exp.formattedResult);
                expander.Activated += (o, a) => ReloadLabel();
                label.Markup        = exp.ToString();
                expander.Add(new Gtk.Alignment(0, 0, 1, 1)
                {
                    Child = label, LeftPadding = 10, BottomPadding = 5
                });
                Add(expander);
            }
            else
            {
                label.Markup = title + ": " + exp;
                Add(label);
            }

            if (attribute.tooltipText != "")
            {
                HasTooltip    = true;
                TooltipMarkup = attribute.tooltipText;
            }
        }
示例#25
0
        public DemoExpander() : base("Demo Expander", null, DialogFlags.DestroyWithParent)
        {
            Resizable = false;

            VBox vbox = new VBox(false, 5);

            this.ContentArea.PackStart(vbox, true, true, 0);
            vbox.BorderWidth = 5;

            vbox.PackStart(new Label("Expander demo. Click on the triangle for details."), false, false, 0);

            // Create the expander
            Expander expander = new Expander("Details");

            expander.Add(new Label("Details can be shown or hidden."));
            vbox.PackStart(expander, false, false, 0);

            AddButton(Stock.Close, ResponseType.Close);

            ShowAll();
            Run();
            Destroy();
        }
示例#26
0
        private Expander CreateScrollableExpander(Widget view)
        {
            ScrolledWindow window = null;

            if (ApplicationContext.CommandLine.Contains("smooth-scroll"))
            {
                window = new SmoothScrolledWindow();
            }
            else
            {
                window = new ScrolledWindow();
            }

            window.Add(view);
            window.HscrollbarPolicy = PolicyType.Automatic;
            window.VscrollbarPolicy = PolicyType.Automatic;

            Expander expander = new Expander(AddinManager.CurrentLocalizer.GetString("Track list"));

            expander.Add(window);

            return(expander);
        }
        public DeviceDescriptionInfo(Device device)
        {
            this.Build();

            deviceType.Text      = device.Type.ToString();
            udn.Text             = device.Udn;
            friendlyName.Text    = device.FriendlyName;
            manufacturer.Text    = device.Manufacturer;
            manufacturerUrl.Text = device.ManufacturerUrl != null?device.ManufacturerUrl.ToString() : null;

            modelName.Text   = device.ModelName;
            modelNumber.Text = device.ModelNumber;
            modelUrl.Text    = device.ModelUrl != null?device.ModelUrl.ToString() : null;

            serialNumber.Text = device.SerialNumber;
            upc.Text          = device.Upc;
            foreach (var icon in device.Icons)
            {
                var expander = new Expander(string.Format("{0}, {1}x{2}x{3}", icon.MimeType, icon.Width, icon.Height, icon.Depth));
                expander.Add(new LazyIcon(icon));
                iconBox.PackStart(expander, true, true, 0);
            }
        }
示例#28
0
 protected virtual void OnMapped (object sender, System.EventArgs e)
 {
     if (!mapped) {
         mapped = true;
         ThreadPool.QueueUserWorkItem (state => {
             Gtk.Widget widget;
             try {
                 widget = provider.ProvideInfo (device);
             } catch (Exception exception) {
                 var box = new VBox ();
                 box.PackStart (new Gtk.Label ("Failed to Load " + provider.Name), true, true, 0);
                 var expander = new Expander ("Error");
                 expander.Add (new Label (exception.ToString ()));
                 box.PackStart (expander, true, true, 0);
                 widget = box;
             }
             Gtk.Application.Invoke ((o, a) => {
                 alignment.Remove (alignment.Child);
                 alignment.Add (widget);
                 ShowAll ();
             });
         });
     }
 }
示例#29
0
 public void Reload()
 {
     if (Child != null)
     {
         Child.Destroy();
     }
     if (context.vertical)
     {
         Expander expander = new Expander(title + ": " + obj.name)
         {
             Expanded = true
         };
         expander.Add(UIFactory.GenerateVertical(obj));
         Add(expander);
     }
     else
     {
         HBox headerBox = new HBox(false, 0);
         headerBox.PackStart(new Label(title + ": "), false, false, 0);
         headerBox.PackStart(obj.GetHeader(context.butCompact), false, false, 0);
         Add(headerBox);
     }
     ShowAll();
 }
        private void BuildWindow()
        {
            this.Resizable = false;

            BorderWidth = 6;
            VBox.Spacing = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();
            box.BorderWidth = 6;
            box.Spacing = 12;

            Image image = new Image (PodcastPixbufs.PodcastIcon48);
            image.Yalign = 0.0f;

            box.PackStart(image, false, true, 0);

            VBox content_box = new VBox();
            content_box.Spacing = 12;

            Label header = new Label();
            header.Markup = "<big><b>" + GLib.Markup.EscapeText (Catalog.GetString (
                                "Subscribe to New Podcast Feed")) + "</b></big>";
            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.0f);

            Label message = new Label (Catalog.GetString (
                                           "Please enter the URL of the podcast you wish to subscribe to"));
            message.Wrap = true;
            message.Justify = Justification.Left;
            message.SetAlignment (0.0f, 0.0f);

            Expander advanced_expander = new Expander ("Advanced");

            VBox expander_children = new VBox();
            expander_children.BorderWidth = 6;
            expander_children.Spacing = 6;

            Label sync_text = new Label (Catalog.GetString (
                                             "When new episodes are available:  "));
            sync_text.SetAlignment (0.0f, 0.0f);
            sync_text.Justify = Justification.Left;

            sync_combo = new SyncPreferenceComboBox ();

            expander_children.PackStart (sync_text);
            expander_children.PackStart (sync_combo);

            advanced_expander.Add (expander_children);

            url_entry = new Entry ();
            url_entry.ActivatesDefault = true;

            Table table = new Table (1, 2, false);
            table.RowSpacing = 6;
            table.ColumnSpacing = 12;

            table.Attach(new Label (Catalog.GetString ("URL:")), 0, 1, 0, 1,
                         AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            table.Attach (url_entry, 1, 2, 0, 1,
                          AttachOptions.Expand | AttachOptions.Fill,
                          AttachOptions.Shrink, 0, 0);

            table.Attach (advanced_expander, 0, 2, 1, 2,
                          AttachOptions.Expand | AttachOptions.Fill,
                          AttachOptions.Shrink, 0, 0);

            content_box.PackStart (header, false, true, 0);
            content_box.PackStart (message, false, true, 0);

            content_box.PackStart (table, false, true, 0);

            box.PackStart (content_box, false, true, 0);

            AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
            AddButton (Catalog.GetString ("Subscribe"), ResponseType.Ok, true);

            box.ShowAll ();
            VBox.Add (box);
        }
示例#31
0
文件: Editor.cs 项目: knocte/banshee
        private void Initialize()
        {
            Title = Catalog.GetString ("New Smart Playlist");
            VBox.Spacing = 8;

            AddStockButton (Stock.Cancel, ResponseType.Cancel);
            ok_button = AddStockButton (Stock.Save, ResponseType.Ok, true);

            var builder_box = new VBox () {
                BorderWidth = 5,
                Spacing = 10
            };

            var name_box = new HBox () {
                Spacing = 2
            };

            name_box.PackStart (new Label () {
                    Text = Catalog.GetString ("Playlist _Name:"),
                    UseUnderline = true
                }, false, false, 0);

            name_box.PackStart (name_entry = new Entry (), true, true, 0);
            name_entry.Changed += HandleNameChanged;
            builder_box.PackStart (name_box, false, false, 0);

            builder_box.PackStart (builder = new BansheeQueryBox (), true, true, 0);
            builder.Show ();
            builder.Spacing = 4;

            var expander = new Expander (Catalog.GetString ("Predefined Smart Playlists"));
            var hbox = new HBox () { Spacing = 8 };
            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };
            var button_box = new VButtonBox () {
                Spacing = 2,
                LayoutStyle = ButtonBoxStyle.Start
            };
            button_box.PackStart (adv_use_button = new Button (Catalog.GetString ("Open in editor")), false, false, 0);
            button_box.PackStart (adv_add_button = new Button (Catalog.GetString ("Create and save")), false, false, 0);

            scrolled_window.Add (adv_tree_view = new TreeView () {
                HeightRequest = 150,
                HeadersVisible = false
            });
            hbox.PackStart (scrolled_window, true, true, 0);
            hbox.PackStart (button_box, false, false, 0);

            expander.Add (hbox);

            VBox.PackStart (builder_box, true, true, 0);
            VBox.PackStart (expander, false, false, 0);

            // Model is Name, SmartPlaylistDefinition
            ListStore list_model = new ListStore (typeof(string), typeof(SmartPlaylistDefinition));

            bool have_any_predefined = false;
            foreach (SmartPlaylistDefinition def in primary_source.PredefinedSmartPlaylists) {
                list_model.AppendValues (
                    String.Format ("<b>{0}</b>\n<small>{1}</small>", def.Name, def.Description), def
                );
                have_any_predefined = true;
            }

            adv_tree_view.Selection.Mode = SelectionMode.Multiple;
            adv_tree_view.Model = list_model;
            CellRendererText renderer = new CellRendererText ();
            renderer.Ellipsize = Pango.EllipsizeMode.End;
            adv_tree_view.AppendColumn ("title", renderer, "markup", 0);
            adv_tree_view.Selection.Changed += HandleAdvSelectionChanged;

            UpdateAdvButtons (0);

            adv_add_button.Clicked += HandleAdvAdd;
            adv_use_button.Clicked += HandleAdvUse;

            if (!have_any_predefined) {
                expander.NoShowAll = true;
                expander.Hide ();
            }

            Update ();

            name_entry.GrabFocus ();

            ShowAll ();
        }
示例#32
0
        public DeviceWidget(DevicePropertyData dpd,Gtk.Window parent)
        {
            parentWindow = parent;
            this.dpd = dpd;
            this.Build();

            skinThemeControl = new SkinThemeControl();
            //table2.Attach(skinThemeControl,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Expand,0,0);
            /*this.WidthRequest = 650;
            this.HeightRequest = 500;*/
            hbox1.PackStart(skinThemeControl,true,true,0);
            //table2.Attach(skinThemeControl,0,2,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Expand,0,0);

            if(dpd.Device.Devicetype == DeviceType.iOS_5_0)
                GetIdentify();

            skinThemeControl.SetLabelWidth(115);
            skinThemeControl.SetDevice(dpd.Device);

            this.dpd.Project.GenerateDevices();

            switch (dpd.Device.Devicetype) {
            //switch ((DeviceType)dpd.Device.TargetPlatformId) {
            case DeviceType.Android_1_6:{

                table2.NRows = table2.NRows+5;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //GenerateFileEntry

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //
                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_BUNDLEIDENTIFIER);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_BUNDLEIDENTIFIER));
                GenerateBundleEntry(ref table2,Project.KEY_BUNDLEIDENTIFIER,MainClass.Languages.Translate("bundleIdentifier"),pp.PublishValue,3);

                Gtk.Expander expanderAndr16 = new Expander("Android signing");

                Table tblAndr16 = new Table(4,2,false);
                tblAndr16.RowSpacing = 3;

                expanderAndr16.Add(tblAndr16);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_KEYSTORE);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_KEYSTORE));
                GenerateFileMaskEntry(ref tblAndr16,Project.KEY_KEYSTORE,MainClass.Languages.Translate("keystore")+" ",pp.PublishValue,0);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_STOREPASSWORD);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_STOREPASSWORD));
                GenerateEntry(ref tblAndr16,Project.KEY_STOREPASSWORD,MainClass.Languages.Translate("storepassword")+" ",pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ALIAS);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_ALIAS));
                GenerateEntry(ref tblAndr16,Project.KEY_ALIAS,MainClass.Languages.Translate("alias")+" ",pp.PublishValue,2);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_KEYPASSWORD);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_KEYPASSWORD));
                GenerateEntry(ref tblAndr16,Project.KEY_KEYPASSWORD,MainClass.Languages.Translate("keypassword")+" ",pp.PublishValue,3);
                //
                table2.Attach(expanderAndr16,0,2,6,7,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderAndr16.ShowAll();

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SUPPORTEDDEVICES);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_SUPPORTEDDEVICES));
                GenerateComboBox(ref table2,Project.KEY_SUPPORTEDDEVICES,MainClass.Languages.Translate("supportedDevices"),pp.PublishValue,5,MainClass.Settings.AndroidSupportedDevices,true);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_PERMISSION);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_PERMISSION));
                GeneratePermissionEditor(ref table2,Project.KEY_PERMISSION,MainClass.Languages.Translate("permisions"),pp.PublishValue,6);

                break;
                }
            case DeviceType.Android_2_2:{

                if ((MainClass.Settings.InstallLocations == null) || ((MainClass.Settings.InstallLocations.Count <1 )) ){
                    MainClass.Settings.GenerateInstallLocation();
                }

                table2.NRows = table2.NRows+6;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //GenerateFileEntry

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //
                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_BUNDLEIDENTIFIER);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_BUNDLEIDENTIFIER));
                GenerateBundleEntry(ref table2,Project.KEY_BUNDLEIDENTIFIER,MainClass.Languages.Translate("bundleIdentifier"),pp.PublishValue,3);

                Gtk.Expander expanderAndr22 = new Expander("Android signing");

                Table tblAndr22 = new Table(4,2,false);
                tblAndr22.RowSpacing = 3;

                expanderAndr22.Add(tblAndr22);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_KEYSTORE);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_KEYSTORE));
                GenerateFileMaskEntry(ref tblAndr22,Project.KEY_KEYSTORE,MainClass.Languages.Translate("keystore")+" ",pp.PublishValue,0);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_STOREPASSWORD);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_STOREPASSWORD));
                GenerateEntry(ref tblAndr22,Project.KEY_STOREPASSWORD,MainClass.Languages.Translate("storepassword")+" ",pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ALIAS);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_ALIAS));
                GenerateEntry(ref tblAndr22,Project.KEY_ALIAS,MainClass.Languages.Translate("alias")+" ",pp.PublishValue,2);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_KEYPASSWORD);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_KEYPASSWORD));
                GenerateEntry(ref tblAndr22,Project.KEY_KEYPASSWORD,MainClass.Languages.Translate("keypassword")+" ",pp.PublishValue,3);

                table2.Attach(expanderAndr22,0,2,6,7,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderAndr22.ShowAll();

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SUPPORTEDDEVICES);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_SUPPORTEDDEVICES));
                GenerateComboBox(ref table2,Project.KEY_SUPPORTEDDEVICES,MainClass.Languages.Translate("supportedDevices"),pp.PublishValue,5,MainClass.Settings.AndroidSupportedDevices,true);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_INSTALLOCATION);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_INSTALLOCATION));
                GenerateComboBox(ref table2,Project.KEY_INSTALLOCATION,MainClass.Languages.Translate("installLocation"),pp.PublishValue,6,MainClass.Settings.InstallLocations,false);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_PERMISSION);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_PERMISSION));
                GeneratePermissionEditor(ref table2,Project.KEY_PERMISSION,MainClass.Languages.Translate("permisions"),pp.PublishValue,7);

                break;
                }

            case DeviceType.Bada_1_0:
            case DeviceType.Bada_1_1:
            case DeviceType.Bada_1_2:
            case DeviceType.Bada_2_0:{

                table2.NRows = table2.NRows+5;

                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);

                /*PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON_BADA1);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON_BADA1));
                GenerateFileMaskEntry(ref table1,Project.KEY_ICON_BADA1,MainClass.Languages.Translate("icon_f1", "100x96"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH_BADA1);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH_BADA1));
                GenerateFileMaskEntry(ref table1,Project.KEY_SPLASH_BADA1,MainClass.Languages.Translate("splash_f1","480x800"),pp.PublishValue,2);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON_BADA2);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON_BADA2));
                GenerateFileMaskEntry(ref table1,Project.KEY_ICON_BADA2,MainClass.Languages.Translate("icon_f1","50x47"),pp.PublishValue,3);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH_BADA2);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH_BADA2));
                GenerateFileMaskEntry(ref table1,Project.KEY_SPLASH_BADA2,MainClass.Languages.Translate("splash_f1","240x400"),pp.PublishValue,4);

                 pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON_BADA3);
                 if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON_BADA3));
                GenerateFileMaskEntry(ref table1,Project.KEY_ICON_BADA3,MainClass.Languages.Translate("icon_f1","50x50"),pp.PublishValue,xx);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH_BADA3);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH_BADA3));
                GenerateFileMaskEntry(ref table1,Project.KEY_SPLASH_BADA3,MainClass.Languages.Translate("splash_f1","320x480"),pp.PublishValue,xx);
                 */
                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_MANIFEST);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_MANIFEST));
                GenerateFileMaskEntry(ref table2,Project.KEY_MANIFEST,MainClass.Languages.Translate("manifest"),pp.PublishValue,3);
                //

                break;}
            case DeviceType.Symbian_9_4:{

                table2.NRows = table2.NRows+7;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_APPLICATIONID);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_APPLICATIONID));
                GenerateEntryWithMenu(ref table2,Project.KEY_APPLICATIONID,MainClass.Languages.Translate("application_id"),pp.PublishValue,3);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_CERTIFICATE);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_CERTIFICATE));
                GenerateFileMaskEntry(ref table2,Project.KEY_CERTIFICATE,MainClass.Languages.Translate("certificate"),pp.PublishValue,4);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_KEY);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_KEY));
                GenerateFileMaskEntry(ref table2,Project.KEY_KEY,MainClass.Languages.Translate("key"),pp.PublishValue,5);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_PASSWORD);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_PASSWORD));
                GenerateEntry(ref table2,Project.KEY_PASSWORD,MainClass.Languages.Translate("password_f1"),pp.PublishValue,6);
                //
                break;}
            case DeviceType.iOS_5_0:{

                table2.NRows = table2.NRows+10;
            //
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_BUNDLEIDENTIFIER);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_BUNDLEIDENTIFIER));
                GenerateBundleEntry(ref table2,Project.KEY_BUNDLEIDENTIFIER,MainClass.Languages.Translate("bundleIdentifier"),pp.PublishValue,1);

                 pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_CODESIGNINGIDENTITY);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_CODESIGNINGIDENTITY));
                GenerateComboBoxSigning(ref table2,Project.KEY_CODESIGNINGIDENTITY,MainClass.Languages.Translate("codeSigningIdentity"),pp.PublishValue,2,securityIOs);
                //GenerateComboBox(ref table1,Project.KEY_CODESIGNINGIDENTITY,MainClass.Languages.Translate("codeSigningIdentity"),pp.PublishValue,2,securityIOs);

                //GenerateEntry(ref table1,Project.KEY_CODESIGNINGIDENTITY,MainClass.Languages.Translate("codeSigningIdentity"),pp.PublishValue,1);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SUPPORTEDDEVICES);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp = new PublishProperty(Project.KEY_SUPPORTEDDEVICES));
                GenerateComboBox(ref table2,Project.KEY_SUPPORTEDDEVICES,MainClass.Languages.Translate("supportedDevices"),pp.PublishValue,3,MainClass.Settings.OSSupportedDevices,false);

                // iPhone4
                Gtk.Expander expanderiPh4 = new Expander("iPhone 4(S)");
                Table tbliPh4 = new Table(2,2,false);
                tbliPh4.RowSpacing = 3;
                expanderiPh4.Add(tbliPh4);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IP4ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IP4ICON));
                GenerateFileMaskEntry(ref tbliPh4,Project.KEY_IP4ICON,"Icon : ",pp.PublishValue,0,true,MainClass.Languages.Translate("property_ios_icon",114,114));

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IP4SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IP4SPLASH));
                GenerateFileMaskEntry(ref tbliPh4,Project.KEY_IP4SPLASH,"Splash : ",pp.PublishValue,1,MainClass.Languages.Translate("property_ios_splash",640,960));

                table2.Attach(expanderiPh4,0,2,6,7,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderiPh4.ShowAll();

                // iPhone5
                Gtk.Expander expanderiPh5 = new Expander("iPhone 5");
                Table tbliPh5 = new Table(4,2,false);
                tbliPh5.RowSpacing = 3;
                expanderiPh5.Add(tbliPh5);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IP5ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IP5ICON));

                GenerateFileMaskEntry(ref tbliPh5,Project.KEY_IP5ICON,"Icon : ",MainClass.Languages.Translate("property_ios_icon_4s"),0,false,MainClass.Languages.Translate("property_ios_icon",114,114));

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IP5SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IP5SPLASH));
                GenerateFileMaskEntry(ref tbliPh5,Project.KEY_IP5SPLASH,"Splash : ",pp.PublishValue,1,MainClass.Languages.Translate("property_ios_splash",640,1136));

                table2.Attach(expanderiPh5,0,2,7,8,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderiPh5.ShowAll();

                // iPad2
                Gtk.Expander expanderiPd2 = new Expander("iPad 2");
                Table tbliPd2 = new Table(4,2,false);
                tbliPd2.RowSpacing = 3;
                expanderiPd2.Add(tbliPd2);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IPADICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IPADICON));
                GenerateFileMaskEntry(ref tbliPd2,Project.KEY_IPADICON,"Icon : ",pp.PublishValue,0,MainClass.Languages.Translate("property_ios_icon",72,72));

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_IPADSPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_IPADSPLASH));
                GenerateFileMaskEntry(ref tbliPd2,Project.KEY_IPADSPLASH,"Splash : ",pp.PublishValue,1,MainClass.Languages.Translate("property_ios_splash",768,1004));

                table2.Attach(expanderiPd2,0,2,8,9,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderiPh5.ShowAll();

                // new iPad
                Gtk.Expander expanderNewiPd = new Expander("the new iPad");
                Table tbliNewPd = new Table(4,2,false);
                tbliNewPd.RowSpacing = 3;
                expanderNewiPd.Add(tbliNewPd);

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_INEWPADICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_INEWPADICON));
                GenerateFileMaskEntry(ref tbliNewPd,Project.KEY_INEWPADICON,"Icon : ",pp.PublishValue,0,MainClass.Languages.Translate("property_ios_icon",144,144));

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_INEWPADSPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_INEWPADSPLASH));
                GenerateFileMaskEntry(ref tbliNewPd,Project.KEY_INEWPADSPLASH,"Splash : ",pp.PublishValue,1,MainClass.Languages.Translate("property_ios_splash",1536,2008));

                table2.Attach(expanderNewiPd,0,2,9,10,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Shrink,0,0);
                expanderiPh5.ShowAll();

                break;
            }
            case DeviceType.PocketPC_2003SE:
            case DeviceType.WindowsMobile_5:
            case DeviceType.WindowsMobile_6:{

                table2.NRows = table2.NRows+3;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //
                break;
            }
            case DeviceType.Windows:{

                table2.NRows = table2.NRows+3;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //
                break;
            }
            case DeviceType.MacOs:{

                table2.NRows = table2.NRows+3;
                PublishProperty pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_ICON);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_ICON));
                GenerateFileMaskEntry(ref table2,Project.KEY_ICON,MainClass.Languages.Translate("icon"),pp.PublishValue,1);
                //

                pp = FindPublishProperty(dpd.Device.PublishPropertisMask, Project.KEY_SPLASH);
                if (pp == null)
                    dpd.Device.PublishPropertisMask.Add(pp =new PublishProperty(Project.KEY_SPLASH));
                GenerateFileMaskEntry(ref table2,Project.KEY_SPLASH,MainClass.Languages.Translate("splash"),pp.PublishValue,2);
                //
                break;
            }

            default:{
                break;
            }

            }
            nvFonts.Model = fontListStore;

            CellRendererToggle crt = new CellRendererToggle();
            crt.Activatable = true;
            crt.Toggled += delegate(object o, ToggledArgs args) {
                    TreeIter iter;
                    if (fontListStore.GetIter (out iter, new TreePath(args.Path))) {
                        bool old = (bool) fontListStore.GetValue(iter,2);
                     	string font = (string) fontListStore.GetValue(iter,4);
                        //CombinePublish cp =(CombinePublish) fontListStore.GetValue(iter,2);
                        //cp.IsSelected = !old;
                        if(old)
                            fonts.Remove(font);
                        else fonts.Add(font);

                        fontListStore.SetValue(iter,2,!old);
                }
            };

            nvFonts.AppendColumn("", crt , "active", 2);
            nvFonts.AppendColumn(MainClass.Languages.Translate("name"), new Gtk.CellRendererText(), "text", 0);
            //nvFonts.AppendColumn(MainClass.Languages.Translate("path"), new Gtk.CellRendererText(), "text", 1);
            nvFonts.AppendColumn(MainClass.Languages.Translate("location"), new Gtk.CellRendererText(), "text", 3);

            //nvFonts.Columns [1].Visible = false;

            string[] listFont = Directory.GetFiles(MainClass.Workspace.RootDirectory, "*.ttf");
            // fonty z projektoveho adresara
            string[] listFontProject = Directory.GetFiles(dpd.Project.AbsolutProjectDir, "*.ttf");

            if(MainClass.Platform.IsMac){ // for Mac UpperCase
                string[]  listFont2 = Directory.GetFiles(MainClass.Workspace.RootDirectory, "*.TTF");

                var list = new List<string>();
                list.AddRange(listFont);
                list.AddRange(listFont2);
                listFont = list.ToArray();

                string[] listFontProject2 = Directory.GetFiles(dpd.Project.AbsolutProjectDir, "*.TTF");

                list = new List<string>();
                list.AddRange(listFontProject);
                list.AddRange(listFontProject2);
                listFontProject = list.ToArray();
            }

            if(dpd.Device != null && (dpd.Device.Includes!= null) && (dpd.Device.Includes.Fonts != null)){
                fonts = new List<string>(dpd.Device.Includes.Fonts);

                // odobratie neplatnich fontov - ak je nastaveny a nieje vo workspace - alebo v projektovom adresary
                List<string> fontsTmp = new List<string>(listFont);

                List<string> fontsTmpPrj = new List<string>(listFontProject);

                foreach (string fi in dpd.Device.Includes.Fonts) {

                    int strFontWorks = fontsTmp.FindIndex(x=>System.IO.Path.GetFileName(x) == fi);

                    string tmp =fi;
                    tmp = tmp.Replace('/',System.IO.Path.DirectorySeparatorChar);
                    tmp = tmp.Replace('\\',System.IO.Path.DirectorySeparatorChar);

                    int strFontPrj =fontsTmpPrj.FindIndex(x=>
                        System.IO.Path.Combine(dpd.Project.ProjectName,System.IO.Path.GetFileName(x)) == tmp);

                    if (strFontWorks<0 && strFontPrj<0) fonts.Remove(fi);

                }
            } else fonts = new List<string>();

            Gtk.TreeIter firstSelectedTI = new Gtk.TreeIter();
            bool scrollToIter = false;
            foreach (string fi in listFont) {

                string fontname = System.IO.Path.GetFileName(fi);

                // ak obsahuje font v nazve medzeru nepouzije sa
                if(fontname.Contains(" ") ){
                    MainClass.MainWindow.OutputConsole.WriteError("IGNORE FONT : '"+fontname+"' Invalid name contains a spacenvalid name contains a space \n");
                    continue;
                }

                bool isSelect = false;

                int strNumber = fonts.FindIndex(x=>x == fontname);
                if (strNumber>-1) isSelect = true;
                if(isSelect && !scrollToIter){
                    scrollToIter = true;
                    firstSelectedTI =fontListStore.AppendValues(System.IO.Path.GetFileName(fi), fi,isSelect,MainClass.Languages.Translate("location_workspace"),System.IO.Path.GetFileName(fi));
                } else {
                    fontListStore.AppendValues(System.IO.Path.GetFileName(fi), fi,isSelect,MainClass.Languages.Translate("location_workspace"),System.IO.Path.GetFileName(fi));
                }
            }

            foreach (string fi in listFontProject) {

                string fontname = System.IO.Path.GetFileName(fi);

                // ak obsahuje font v nazve medzeru nepouzije sa
                if(fontname.Contains(" ") ){
                    MainClass.MainWindow.OutputConsole.WriteError("IGNORE FONT : '"+fontname+"' Invalid name contains a spacenvalid name contains a space");
                    continue;
                }

                bool isSelect = false;
                string fontPath = System.IO.Path.Combine(dpd.Project.ProjectName,System.IO.Path.GetFileName(fi));
                //string fontPath = System.IO.Path.GetFileName(fi);
                string tmp =fi;
                tmp = tmp.Replace('/',System.IO.Path.DirectorySeparatorChar);
                tmp = tmp.Replace('\\',System.IO.Path.DirectorySeparatorChar);

                int strNumber = fonts.FindIndex(x=>
                    x.Replace('/',System.IO.Path.DirectorySeparatorChar).Replace('\\',System.IO.Path.DirectorySeparatorChar)
                    == fontPath);
                if (strNumber>-1) isSelect = true;

                if(isSelect && !scrollToIter){
                    scrollToIter = true;
                    firstSelectedTI =fontListStore.AppendValues(System.IO.Path.GetFileName(fi), fi,isSelect,MainClass.Languages.Translate("location_application"),fontPath);
                } else{
                    fontListStore.AppendValues(System.IO.Path.GetFileName(fi), fi,isSelect,MainClass.Languages.Translate("location_application"),fontPath);
                }
            }

            if(scrollToIter){
                TreePath path = fontListStore.GetPath(firstSelectedTI);
                nvFonts.ScrollToCell(path,null, false, 0, 0);
            }

            skinThemeControl.ShowAll();
            //ShowWidget();
            /*
            Gtk.CellRendererText textRenderer2 = new Gtk.CellRendererText();
            cbTheme.PackStart(textRenderer2, true);
            //cbTheme.AddAttribute(textRenderer2, "text", 0);
            cbTheme.Model = themeListStore;

            Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();
            cbSkin.PackStart(textRenderer, true);
            //cbSkin.AddAttribute(textRenderer, "text", 0);
            cbSkin.Model = skinListStore;

            cbSkin.Changed += new EventHandler(OnComboSkinChanged);

            if(dpd.Project.NewSkin){
                string skinDir = System.IO.Path.Combine(MainClass.Workspace.RootDirectory,  MainClass.Settings.SkinDir);
                //cbSkin.Changed += new EventHandler(OnComboSkinChangedNew);
                FillSkinComboNew(skinDir);

            }*/
        }
示例#33
0
        public FilePropertyWidget(FilePropertisData fpd)
        {
            Project project = fpd.Project;

            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null)
            {
                fiOld = new FileItem(fpd.Filename, false);
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
            {
                fiOld.ConditionValues = new System.Collections.Generic.List <ConditionRule>();
            }

            string fullPath = MainClass.Workspace.GetFullPath(fiOld.FilePath);

            string   size = "0";
            FileInfo fi   = new FileInfo(fullPath);

            if (fi.Exists)
            {
                size = ((int)(fi.Length / 1024)).ToString() + " KB";
            }

            Table mainTable     = new Table(4, 1, false);
            Table propertyTable = new Table(5, 2, false);

            Label lblFN = GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); //new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));
            Label lblSZ = GetLabel(System.IO.Path.GetFileName(size));                 // new Label(System.IO.Path.GetFileName(size));

            Entry entr = new Entry(fiOld.SystemFilePath);

            entr.IsEditable = false;

            Entry entrFullPath = new Entry(fullPath);

            entrFullPath.IsEditable = false;

            Label lblPrj = GetLabel(project.ProjectName);           // new Label(project.ProjectName);


            CheckButton chbExclude = new CheckButton("");

            chbExclude.Active = fiOld.IsExcluded;

            chbExclude.Clicked += delegate(object sender, EventArgs e)
            {
                fiOld.IsExcluded = chbExclude.Active;
            };

            AddControl(ref propertyTable, 0, lblFN, "Name ");
            AddControl(ref propertyTable, 1, lblSZ, "Size ");
            AddControl(ref propertyTable, 2, entr, "Relative Path ");
            AddControl(ref propertyTable, 3, entrFullPath, "Full Path ");
            AddControl(ref propertyTable, 4, lblPrj, "Project ");
            AddControl(ref propertyTable, 5, chbExclude, "Exclude ");

            int   rowCount        = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3), (uint)2, false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform, false);           //tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2, MainClass.Settings.Resolution, true);        //project.Resolution);//tableSystem
            int i = 3;

            foreach (Condition cd in project.ConditoinsDefine)
            {
                GenerateContent(ref conditionsTable, cd.Name, i, cd, false);
                i++;
            }

            Expander exp1 = new Expander("General");

            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");

            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            mainTable.Attach(exp2, 0, 1, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            string extension = System.IO.Path.GetExtension(fpd.Filename);

            switch (extension)
            {
            case ".png":
            case ".jpg":
            case ".jpeg":
            case ".bmp":
            case ".gif":
            case ".tif":
            case ".svg": {
                Table ImageTable = GenerateImageControl();
                if (ImageTable != null)
                {
                    Expander expImage = new Expander("Image");
                    expImage.Expanded = true;
                    expImage.Add(ImageTable);
                    mainTable.Attach(expImage, 0, 1, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);
                }
                break;
            }

            case ".db":
                //
                break;

            default:
                //
                break;
            }


            this.PackStart(mainTable, true, true, 0);
            this.ShowAll();
        }
示例#34
0
 private Widget CreateMoreOptionsExpander(string defaultDomainID)
 {
     optionsExpander = new Expander(Util.GS("More options"));
        optionsExpander.Activated += new EventHandler(OnOptionsExpanded);
        optionsExpander.Activate();
        Table optionsTable = new Table(2, 3, false);
        optionsExpander.Add(optionsTable);
        optionsTable.ColumnSpacing = 10;
        optionsTable.RowSpacing = 10;
        optionsTable.SetColSpacing(0, 30);
        Label l = new Label(Util.GS("iFolder account"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,0,1,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        Encryption = new RadioButton(Util.GS("Passphrase Encryption"));
        optionsTable.Attach(Encryption, 2,3,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        Regular = new RadioButton(Encryption, Util.GS("Regular"));
        optionsTable.Attach(Regular, 3,4,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        SecureSync = new CheckButton(Util.GS("Secure Sync"));
                 optionsTable.Attach(SecureSync, 4,5,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        l = new Label(Util.GS("Security"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,1,2,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        domainComboBox = ComboBox.NewText();
        optionsTable.Attach(domainComboBox, 2,3,0,1,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        int defaultDomain = 0;
        for (int x = 0; x < domains.Length; x++)
        {
     domainComboBox.AppendText(string.Format(domains[x].Name + " - " + domains[x].Host));
     if (defaultDomainID != null)
     {
      if (defaultDomainID == domains[x].ID)
       defaultDomain = x;
     }
     else
      defaultDomain = x;
        }
        domainComboBox.Active = defaultDomain;
        int SecurityPolicy = ifws.GetSecurityPolicy(this.DomainID);
        ChangeStatus(SecurityPolicy);
        optionsTable.ShowAll();
        return optionsExpander;
 }
示例#35
0
        void SetupWidgets()
        {
            histogram_expander            = new Expander(Strings.Histogram);
            histogram_expander.Activated += (s, e) =>
            {
                ContextSwitchStrategy.SetHistogramVisible(Context, histogram_expander.Expanded);
                UpdateHistogram();
            };

            histogram_expander.StyleSet += (s, a) =>
            {
                Gdk.Color c = Toplevel.Style.Backgrounds[(int)Gtk.StateType.Active];
                histogram.RedColorHint        = (byte)(c.Red / 0xff);
                histogram.GreenColorHint      = (byte)(c.Green / 0xff);
                histogram.BlueColorHint       = (byte)(c.Blue / 0xff);
                histogram.BackgroundColorHint = 0xff;
                UpdateHistogram();
            };

            histogram_image = new Image();
            histogram       = new Histogram();
            histogram_expander.Add(histogram_image);

            Add(histogram_expander);

            info_expander            = new Expander(Strings.ImageInformation);
            info_expander.Activated += (s, e) =>
            {
                ContextSwitchStrategy.SetInfoBoxVisible(Context, info_expander.Expanded);
            };

            info_table = new Table(head_rows, 2, false)
            {
                BorderWidth = 0
            };

            AddLabelEntry(null, null, null, null, photos => { return(Strings.NumberPhotos(photos.Length)); });

            AddLabelEntry(null, Strings.Name, null,
                          (photo, file) => { return(photo.Name ?? string.Empty); }, null);

            version_list  = new ListStore(typeof(IPhotoVersion), typeof(string), typeof(bool));
            version_combo = new ComboBox();
            var version_name_cell = new CellRendererText
            {
                Ellipsize = Pango.EllipsizeMode.End
            };

            version_combo.PackStart(version_name_cell, true);
            version_combo.SetCellDataFunc(version_name_cell, new CellLayoutDataFunc(VersionNameCellFunc));
            version_combo.Model    = version_list;
            version_combo.Changed += OnVersionComboChanged;

            AddEntry(null, Strings.Version, null, version_combo, 0.5f,
                     (widget, photo, file) =>
            {
                version_list.Clear();
                version_combo.Changed -= OnVersionComboChanged;

                int count = 0;
                foreach (var version in photo.Versions)
                {
                    version_list.AppendValues(version, version.Name, true);
                    if (version == photo.DefaultVersion)
                    {
                        version_combo.Active = count;
                    }
                    count++;
                }

                if (count <= 1)
                {
                    version_combo.Sensitive   = false;
                    version_combo.TooltipText = Strings.ParenNoEditsParen;
                }
                else
                {
                    version_combo.Sensitive   = true;
                    version_combo.TooltipText =
                        Catalog.GetPluralString(Strings.ParenOneEditParen, Strings.ParenXEditsParen(count - 1), count - 1);
                }
                version_combo.Changed += OnVersionComboChanged;
            }, null);

            AddLabelEntry("date", Strings.Date, Strings.ShowDate,
                          (photo, file) =>
            {
                return($"{photo.Time.ToShortDateString()}{Environment.NewLine}{photo.Time.ToShortTimeString()}");
            },
                          photos =>
            {
                var first   = photos[photos.Length - 1];
                IPhoto last = photos[0];
                if (first.Time.Date == last.Time.Date)
                {
                    return(Strings.OnDateBetweenTimeAndTime(first.Time.ToShortDateString(),
                                                            first.Time.ToShortTimeString(),
                                                            last.Time.ToShortTimeString()));
                }
                else
                {
                    return(Strings.BetweenTimeAndTime(first.Time.ToShortDateString(), last.Time.ToShortDateString()));
                }
            });

            AddLabelEntry("size", Strings.Size, Strings.ShowSize,
                          (photo, metadata) =>
            {
                int width  = 0;
                int height = 0;
                if (null != metadata.Properties)
                {
                    width  = metadata.Properties.PhotoWidth;
                    height = metadata.Properties.PhotoHeight;
                }

                if (width != 0 && height != 0)
                {
                    return($"{width}x{height}");
                }

                return(Strings.ParenUnknownParen);
            }, null);

            AddLabelEntry("exposure", Strings.Exposure, Strings.ShowExposure,
                          (photo, metadata) =>
            {
                var fnumber       = metadata.ImageTag.FNumber;
                var exposure_time = metadata.ImageTag.ExposureTime;
                var iso_speed     = metadata.ImageTag.ISOSpeedRatings;

                string info = string.Empty;

                if (fnumber.HasValue && fnumber.Value != 0.0)
                {
                    info += $"f/{fnumber.Value:.0} ";
                }

                if (exposure_time.HasValue)
                {
                    if (Math.Abs(exposure_time.Value) >= 1.0)
                    {
                        info += $"{exposure_time.Value} sec ";
                    }
                    else
                    {
                        info += $"1/{(int)(1 / exposure_time.Value)} sec ";
                    }
                }

                if (iso_speed.HasValue)
                {
                    info += $"{Environment.NewLine}ISO {iso_speed.Value}";
                }

                var exif = metadata.ImageTag.Exif;
                if (exif != null)
                {
                    var flash = exif.ExifIFD.GetLongValue(0, (ushort)TagLib.IFD.Tags.ExifEntryTag.Flash);

                    if (flash.HasValue)
                    {
                        if ((flash.Value & 0x01) == 0x01)
                        {
                            info += $", {Strings.FlashFired}";
                        }
                        else
                        {
                            info += $", {Strings.FlashDidntFire}";
                        }
                    }
                }

                if (info == string.Empty)
                {
                    return(Strings.ParenNoneParen);
                }

                return(info);
            }, null);

            AddLabelEntry("focal_length", Strings.FocalLength, Strings.ShowFocalLength,
                          false, (photo, metadata) =>
            {
                var focal_length = metadata.ImageTag.FocalLength;

                if (focal_length == null)
                {
                    return(Strings.ParenUnknownParen);
                }

                return($"{focal_length.Value} mm");
            }, null);

            AddLabelEntry("camera", Strings.Camera, Strings.ShowCamera, false,
                          (photo, metadata) => { return(metadata.ImageTag.Model ?? Strings.ParenUnknownParen); },
                          null);

            AddLabelEntry("creator", Strings.Creator, Strings.ShowCreator,
                          (photo, metadata) => { return(metadata.ImageTag.Creator ?? Strings.ParenUnknownParen); },
                          null);

            AddLabelEntry("file_size", Strings.FileSize, Strings.ShowFileSize, false,
                          (photo, metadata) =>
            {
                try
                {
                    var fileSize = new System.IO.FileInfo(photo.DefaultVersion.Uri.AbsolutePath).Length;
                    return(Format.SizeForDisplay(fileSize));
                }
                catch (Exception e)
                {
                    Hyena.Log.DebugException(e);
                    return(Strings.ParenFileReadErrorParen);
                }
            }, null);

            var rating_entry = new RatingEntry {
                HasFrame = false, AlwaysShowEmptyStars = true
            };

            rating_entry.Changed += HandleRatingChanged;
            var rating_align = new Gtk.Alignment(0, 0, 0, 0);

            rating_align.Add(rating_entry);
            AddEntry("rating", Strings.Rating, Strings.ShowRating, rating_align, false,
                     (widget, photo, metadata) => { ((widget as Alignment).Child as RatingEntry).Value = (int)photo.Rating; },
                     null);

            AddEntry("tag", null, Strings.ShowTags, new TagView(), false,
                     (widget, photo, metadata) => { (widget as TagView).Current = photo; }, null);

            UpdateTable();

            var eb = new EventBox();

            eb.Add(info_table);
            info_expander.Add(eb);
            eb.ButtonPressEvent += HandleButtonPressEvent;

            Add(info_expander);
        }
示例#36
0
        private void BuildUI()
        {
            // The BorderWidth situation here is a bit nuts b/c the
            // ActionArea's is set to 5.  So we work everything else out
            // so it all totals to 12.
            //
            // WIDGET           BorderWidth
            // Dialog           5
            //   VBox           2
            //     inner_vbox   5 => total = 12
            //     ActionArea   5 => total = 12
            BorderWidth = 5;
            base.VBox.BorderWidth = 0;

            // This spacing is 2 b/c the inner_vbox and ActionArea should be
            // 12 apart, and they already have BorderWidth 5 each
            base.VBox.Spacing = 2;

            inner_vbox = new VBox () { Spacing = 12, BorderWidth = 5, Visible = true };
            base.VBox.PackStart (inner_vbox, true, true, 0);

            Visible = false;
            HasSeparator = false;

            var table = new Table (3, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 16
            };

            table.Attach (new Image () {
                    IconName = "dialog-error",
                    IconSize = (int)IconSize.Dialog,
                    Yalign = 0.0f
                }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach (header_label = new Label () { Xalign = 0.0f }, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            table.Attach (message_label = new Hyena.Widgets.WrapLabel (), 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };

            list_view = new TreeView () {
                HeightRequest = 120,
                WidthRequest = 200
            };
            scrolled_window.Add (list_view);

            table.Attach (details_expander = new Expander (Catalog.GetString ("Details")),
                1, 2, 2, 3,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand,
                0, 0);
            details_expander.Add (scrolled_window);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.UseStock = true;
            button.Show ();
            button.Clicked += (o, a) => {
                Destroy ();
            };

            AddActionWidget (button, ResponseType.Close);

            DefaultResponse = ResponseType.Close;
            button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);
        }
示例#37
0
		public GtkErrorDialog (Window parent, string title, string message, AlertButton[] buttons)
		{
			if (string.IsNullOrEmpty (title))
				throw new ArgumentException ();
			if (buttons == null)
				throw new ArgumentException ();
			
			Title = BrandingService.ApplicationName;
			TransientFor = parent;
			Modal = true;
			WindowPosition = Gtk.WindowPosition.CenterOnParent;
			DefaultWidth = 624;
			DefaultHeight = 142;
			
			this.VBox.BorderWidth = 2;
			
			var hbox = new HBox () {
				Spacing = 6,
				BorderWidth = 12,
			};
			
			var errorImage = new Image (Gtk.Stock.DialogError, IconSize.Dialog) {
				Yalign = 0F,
			};
			hbox.PackStart (errorImage, false, false, 0);
			this.VBox.Add (hbox);
			
			var vbox = new VBox () {
				Spacing = 6,
			};
			hbox.PackEnd (vbox, true, true, 0);
			
			var titleLabel = new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (title) + "</b>",
				Xalign = 0F,
			};
			vbox.PackStart (titleLabel, false, false, 0);
			
			if (!string.IsNullOrWhiteSpace (message)) {
				message = message.Trim ();
				var descriptionLabel = new Label (message) {
					Xalign = 0F,
					Selectable = true,
				};
				descriptionLabel.LineWrap = true;
				descriptionLabel.WidthRequest = 500;
				descriptionLabel.ModifyBg (StateType.Normal, new Gdk.Color (255,0,0));
				vbox.PackStart (descriptionLabel, false, false, 0);
			}
			
			expander = new Expander (GettextCatalog.GetString ("Details")) {
				CanFocus = true,
				Visible = false,
			};
			vbox.PackEnd (expander, true, true, 0);
			
			var sw = new ScrolledWindow () {
				HeightRequest = 180,
				ShadowType = ShadowType.Out,
			};
			expander.Add (sw);
			
			detailsTextView = new TextView () {
				CanFocus = true,
			};
			detailsTextView.KeyPressEvent += TextViewKeyPressed;
			sw.Add (detailsTextView);
			
			var aa = this.ActionArea;
			aa.Spacing = 10;
			aa.LayoutStyle = ButtonBoxStyle.End;
			aa.BorderWidth = 5;
			aa.Homogeneous = true;
			
			expander.Activated += delegate {
				this.AllowGrow = expander.Expanded;
				GLib.Timeout.Add (100, delegate {
					Resize (DefaultWidth, 1);
					return false;
				});
			};
			
			tagNoWrap = new TextTag ("nowrap");
			tagNoWrap.WrapMode = WrapMode.None;
			detailsTextView.Buffer.TagTable.Add (tagNoWrap);
			
			tagWrap = new TextTag ("wrap");
			tagWrap.WrapMode = WrapMode.Word;
			detailsTextView.Buffer.TagTable.Add (tagWrap);
			
			this.Buttons = buttons;
			for (int i = 0; i < Buttons.Length; i++) {
				Gtk.Button button;
				button = new Gtk.Button (Buttons[i].Label);
				button.ShowAll ();
				AddActionWidget (button, i);
			}
			
			Child.ShowAll ();
			Hide ();
		}
示例#38
0
        public MetadataDisplayWidget()
        {
            main_vbox = new VBox ();
            main_vbox.Spacing = 6;

            metadata_message = new Label (String.Empty);
            metadata_message.UseMarkup = true;
            metadata_message.LineWrap = true;
            metadata_vbox = new VBox ();
            metadata_vbox.Spacing = 6;

            main_vbox.PackStart (metadata_vbox, false, false, 0);
            AddWithViewport (metadata_message);
            ((Viewport)Child).ShadowType = ShadowType.None;
            BorderWidth = 3;

            display = State.message;
            ExposeEvent += HandleExposeEvent;

            open_list = new List<string> ();

            // Create Expander and TreeView for
            // extended metadata
            var tree_view = new TreeView ();
            tree_view.HeadersVisible = false;
            tree_view.RulesHint = true;

            var col = new TreeViewColumn ();
            col.Sizing = TreeViewColumnSizing.Autosize;
            CellRenderer colr = new CellRendererText ();
            col.PackStart (colr, false);

            col.AddAttribute (colr, "markup", 0);

            tree_view.AppendColumn (col);

            extended_metadata = new ListStore (typeof(string));
            tree_view.Model = extended_metadata;

            var expander = new Expander (String.Format ("<span weight=\"bold\"><small>{0}</small></span>", Catalog.GetString ("Extended Metadata")));
            expander.UseMarkup = true;
            expander.Add (tree_view);
            expander.Expanded = true;

            main_vbox.PackStart (expander, false, false, 6);
            expander.ShowAll ();

            update_delay = new DelayedOperation (Update);
            update_delay.Start ();
        }
示例#39
0
        ListStore AddExpander(string name, int pos)
        {
            TreeView tree_view = new TreeView ();
            tree_view.HeadersVisible = false;
            tree_view.RulesHint = true;

            TreeViewColumn col = new TreeViewColumn ();
            col.Sizing = TreeViewColumnSizing.Autosize;
            CellRenderer colr = new CellRendererText ();
            col.PackStart (colr, false);

            col.AddAttribute (colr, "markup", 0);

            tree_view.AppendColumn (col);

            ListStore model = new ListStore (typeof(string));
            tree_view.Model = model;

            Expander expander = new Expander (String.Format ("<span weight=\"bold\"><small>{0}</small></span>", name));
            expander.UseMarkup = true;
            expander.Add (tree_view);
            expander.Expanded = true;

            metadata_vbox.PackStart (expander, false, false, 6);
            metadata_vbox.ReorderChild (expander, pos);

            if (open_list.Contains (name))
                expander.Expanded = true;

            expander.Activated += HandleExpanderActivated;

            expander.ShowAll ();

            return model;
        }
        private Expander CreateScrollableExpander(Widget view)
        {
            ScrolledWindow window = null;

            if (ApplicationContext.CommandLine.Contains ("smooth-scroll")) {
                window = new SmoothScrolledWindow ();
            } else {
                window = new ScrolledWindow ();
            }

            window.Add (view);
            window.HscrollbarPolicy = PolicyType.Automatic;
            window.VscrollbarPolicy = PolicyType.Automatic;

            Expander expander = new Expander(AddinManager.CurrentLocalizer.GetString ("Track list"));
            expander.Add(window);

            return expander;
        }
示例#41
0
        public NoteRenameDialog(IList <Note> notes, string oldTitle, Note renamedNote) :
            base(Catalog.GetString("Rename Note Links?"), renamedNote.Window, DialogFlags.NoSeparator)
        {
            this.DefaultResponse = ResponseType.Cancel;
            this.BorderWidth     = 10;

            var renameButton = (Button)
                               AddButton(Catalog.GetString("_Rename Links"),
                                         ResponseType.Yes);
            var dontRenameButton = (Button)
                                   AddButton(Catalog.GetString("_Don't Rename Links"),
                                             ResponseType.No);

            this.notes = notes;
            notesModel = new Gtk.TreeStore(typeof(bool), typeof(string), typeof(Note));
            foreach (var note in notes)
            {
                notesModel.AppendValues(true, note.Title, note);
            }

            var labelText = Catalog.GetString("Rename links in other notes from \"<span underline=\"single\">{0}</span>\" " +
                                              "to \"<span underline=\"single\">{1}</span>\"?\n\n" +
                                              "If you do not rename the links, " +
                                              "they will no longer link to anything.");
            var label = new Label();

            label.UseMarkup = true;
            label.Markup    = String.Format(labelText,
                                            GLib.Markup.EscapeText(oldTitle),
                                            GLib.Markup.EscapeText(renamedNote.Title));
            label.LineWrap = true;
            VBox.PackStart(label, false, true, 5);

            var notesView = new TreeView(notesModel);

            notesView.SetSizeRequest(-1, 200);
            var toggleCell = new CellRendererToggle();

            toggleCell.Activatable = true;
            var column = new TreeViewColumn(Catalog.GetString("Rename Links"),
                                            toggleCell, "active", 0);

            column.SortColumnId = 0;
            column.Resizable    = true;
            notesView.AppendColumn(column);
            toggleCell.Toggled += (o, args) => {
                TreeIter iter;
                if (!notesModel.GetIterFromString(out iter, args.Path))
                {
                    return;
                }
                bool val = (bool)notesModel.GetValue(iter, 0);
                notesModel.SetValue(iter, 0, !val);
            };
            column = new TreeViewColumn(Catalog.GetString("Note Title"),
                                        new CellRendererText(), "text", 1);
            column.SortColumnId = 1;
            column.Resizable    = true;
            notesView.AppendColumn(column);

            notesView.RowActivated += (o, args) => {
                TreeIter iter;
                if (!notesModel.GetIter(out iter, args.Path))
                {
                    return;
                }
                Note note = (Note)notesModel.GetValue(iter, 2);
                if (note != null)
                {
                    note.Window.Present();
                    NoteFindBar find = note.Window.Find;
                    find.ShowAll();
                    find.Visible    = true;
                    find.SearchText = "\"" + oldTitle + "\"";
                }
            };

            var notesBox        = new VBox(false, 5);
            var selectAllButton = new Button();

            // Translators: This button causes all notes in the list to be selected
            selectAllButton.Label    = Catalog.GetString("Select All");
            selectAllButton.Clicked += (o, e) => {
                notesModel.Foreach((model, path, iter) => {
                    notesModel.SetValue(iter, 0, true);
                    return(false);
                });
            };
            var selectNoneButton = new Button();

            // Translators: This button causes all notes in the list to be unselected
            selectNoneButton.Label    = Catalog.GetString("Select None");
            selectNoneButton.Clicked += (o, e) => {
                notesModel.Foreach((model, path, iter) => {
                    notesModel.SetValue(iter, 0, false);
                    return(false);
                });
            };
            var notesButtonBox = new HButtonBox();

            notesButtonBox.Add(selectNoneButton);
            notesButtonBox.Add(selectAllButton);
            notesButtonBox.Spacing     = 5;
            notesButtonBox.LayoutStyle = ButtonBoxStyle.End;
            var notesScroll = new ScrolledWindow();

            notesScroll.Add(notesView);
            notesBox.PackStart(notesScroll);
            notesBox.PackStart(notesButtonBox, false, true, 0);

            var advancedExpander = new Expander(Catalog.GetString("Ad_vanced"));
            var expandBox        = new VBox();

            expandBox.PackStart(notesBox);
            alwaysShowDlgRadio          = new RadioButton(Catalog.GetString("Always show this _window"));
            alwaysShowDlgRadio.Clicked += (o, e) => {
                selectAllButton.Click();
                notesBox.Sensitive         = true;
                renameButton.Sensitive     = true;
                dontRenameButton.Sensitive = true;
            };
            neverRenameRadio = new RadioButton(alwaysShowDlgRadio,
                                               Catalog.GetString("Never rename _links"));
            neverRenameRadio.Clicked += (o, e) => {
                selectNoneButton.Click();
                notesBox.Sensitive         = false;
                renameButton.Sensitive     = false;
                dontRenameButton.Sensitive = true;
            };
            alwaysRenameRadio = new RadioButton(alwaysShowDlgRadio,
                                                Catalog.GetString("Alwa_ys rename links"));
            alwaysRenameRadio.Clicked += (o, e) => {
                selectAllButton.Click();
                notesBox.Sensitive         = false;
                renameButton.Sensitive     = true;
                dontRenameButton.Sensitive = false;
            };
            expandBox.PackStart(alwaysShowDlgRadio, false, true, 0);
            expandBox.PackStart(neverRenameRadio, false, true, 0);
            expandBox.PackStart(alwaysRenameRadio, false, true, 0);
            advancedExpander.Add(expandBox);
            VBox.PackStart(advancedExpander, true, true, 5);

            advancedExpander.Activated += (o, e) =>
                                          this.Resizable = advancedExpander.Expanded;

            this.Focus = dontRenameButton;
            VBox.ShowAll();
        }
示例#42
0
        private void Initialize()
        {
            Title        = Catalog.GetString("New Smart Playlist");
            VBox.Spacing = 8;

            AddStockButton(Stock.Cancel, ResponseType.Cancel);
            ok_button = AddStockButton(Stock.Save, ResponseType.Ok, true);

            var builder_box = new VBox()
            {
                BorderWidth = 5,
                Spacing     = 10
            };

            var name_box = new HBox()
            {
                Spacing = 2
            };

            name_box.PackStart(new Label()
            {
                Text         = Catalog.GetString("Playlist _Name:"),
                UseUnderline = true
            }, false, false, 0);

            name_box.PackStart(name_entry = new Entry(), true, true, 0);
            name_entry.Changed           += HandleNameChanged;
            builder_box.PackStart(name_box, false, false, 0);

            builder_box.PackStart(builder = new BansheeQueryBox(), true, true, 0);
            builder.Show();
            builder.Spacing = 4;

            var expander = new Expander(Catalog.GetString("Predefined Smart Playlists"));
            var hbox     = new HBox()
            {
                Spacing = 8
            };
            var scrolled_window = new ScrolledWindow()
            {
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType       = ShadowType.In
            };
            var button_box = new VButtonBox()
            {
                Spacing     = 2,
                LayoutStyle = ButtonBoxStyle.Start
            };

            button_box.PackStart(adv_use_button = new Button(Catalog.GetString("Open in editor")), false, false, 0);
            button_box.PackStart(adv_add_button = new Button(Catalog.GetString("Create and save")), false, false, 0);

            scrolled_window.Add(adv_tree_view = new TreeView()
            {
                HeightRequest  = 150,
                HeadersVisible = false
            });
            hbox.PackStart(scrolled_window, true, true, 0);
            hbox.PackStart(button_box, false, false, 0);

            expander.Add(hbox);

            VBox.PackStart(builder_box, true, true, 0);
            VBox.PackStart(expander, false, false, 0);

            // Model is Name, SmartPlaylistDefinition
            ListStore list_model = new ListStore(typeof(string), typeof(SmartPlaylistDefinition));

            bool have_any_predefined = false;

            foreach (SmartPlaylistDefinition def in primary_source.PredefinedSmartPlaylists)
            {
                list_model.AppendValues(
                    String.Format("<b>{0}</b>\n<small>{1}</small>", def.Name, def.Description), def
                    );
                have_any_predefined = true;
            }

            adv_tree_view.Selection.Mode = SelectionMode.Multiple;
            adv_tree_view.Model          = list_model;
            CellRendererText renderer = new CellRendererText();

            renderer.Ellipsize = Pango.EllipsizeMode.End;
            adv_tree_view.AppendColumn("title", renderer, "markup", 0);
            adv_tree_view.Selection.Changed += HandleAdvSelectionChanged;

            UpdateAdvButtons(0);

            adv_add_button.Clicked += HandleAdvAdd;
            adv_use_button.Clicked += HandleAdvUse;

            if (!have_any_predefined)
            {
                expander.NoShowAll = true;
                expander.Hide();
            }

            Update();

            name_entry.GrabFocus();

            ShowAll();
        }
示例#43
0
        /*protected void AddCommentToGui(CommentData comment)
        {
            // create the expander which will contain this
            Expander container = new Gtk.Expander(comment.Author);

            // Create a HBox which will contain the comment entry and buttons
            VBox entryContainer = new VBox();

            // Create a VBox for the subject and comment body
            VBox commentVBox = new VBox();
            Label subjectLabel = new Label("Subject: " + comment.Title);
         TextView commentView = new TextView();
            commentView.Buffer.Text = comment.Content;

            // Make sure that the comment view content is sufficiently large
            commentView.SetSizeRequest(1,100);
            HBox hbox_1 = new HBox();

            Button quoteButton = new Button("Quote");
            Button replyButton = new Button("Reply");

            // Subject | Quote | Reply
            hbox_1.PackStart(subjectLabel, true, false, 0);
            hbox_1.PackStart(quoteButton, true, false, 0);
            hbox_1.PackStart(replyButton, true, false, 0);

            // pack the subject and comment into it
            commentVBox.PackStart(hbox_1, false, true, 0);
            commentVBox.PackStart(commentView, true, true, 0);

            // Pack both the boxes togetherin the entryContainer
            entryContainer.PackStart(commentVBox, true, false, 0);

            // Add the entry container to the main expander widget
            container.Add(entryContainer);

            // Add the main expander to the comment vbox
            // commentVBox.PackStart(container, false, false, 0); //WTF?
            // hook into the Expand event so that we can resize the widget
            container.Activated += ContainerActivated;
        }*/
        protected void AddCommentToGui(CommentData comment)
        {
            // Create a new HBox to hold the subject line and the reply buttons, content, etc
            Label subjectLabel = new Label (comment.Title);
            Button quoteButton = new Button ("Quote");
            Button replyButton = new Button ("Reply");

            // Push the comment with little ">"s to the reply window
            quoteButton.Clicked += delegate(object sender, EventArgs e) { this.AddCommentQuote (comment); };

            replyButton.Clicked += delegate(object sender, EventArgs e) {
                this.AddCommentQuote (comment);
                // set the reply title as "Re:"
                subjectEntry.Text = "Re: " + comment.Title;
            };

            HBox subjectHBox = new HBox ();
            subjectHBox.PackStart (subjectLabel, true, true, 0);
            subjectHBox.PackStart (quoteButton, false, false, 0);
            subjectHBox.PackStart (replyButton, false, false, 0);

            // Create the entry and the VBox to hold the comment together
            TextView iterCommentView = new TextView ();
            iterCommentView.Buffer.Text = comment.Content;
            iterCommentView.HeightRequest = 100;
            iterCommentView.WrapMode = WrapMode.Word;
            iterCommentView.Editable = false;

            VBox iterVBox = new VBox ();
            iterVBox.PackStart (subjectHBox, false, false, 0);
            iterVBox.PackStart (iterCommentView, true, true, 0);

            // Create an expander
            Expander iterContainer = new Expander (comment.Author);

            iterContainer.Add (iterVBox);
            iterContainer.Activated += ContainerActivated;

            iterContainer.ShowAll ();

            commentVBox.PackStart (iterContainer, true, true, 0);
        }
示例#44
0
		public NoteRenameDialog (IList<Note> notes, string oldTitle, Note renamedNote) :
			base (Catalog.GetString ("Rename Note Links?"), renamedNote.Window, 0)
		{
			this.DefaultResponse = ResponseType.Cancel;
			this.BorderWidth = 10;

			var renameButton = (Button)
				AddButton (Catalog.GetString ("_Rename Links"),
				           ResponseType.Yes);
			var dontRenameButton = (Button)
				AddButton (Catalog.GetString ("_Don't Rename Links"),
				           ResponseType.No);

			this.notes = notes;
			notesModel = new Gtk.TreeStore (typeof (bool), typeof (string), typeof (Note));
			foreach (var note in notes)
				notesModel.AppendValues (true, note.Title, note);

			var labelText = Catalog.GetString ("Rename links in other notes from \"<span underline=\"single\">{0}</span>\" " +
			                                   "to \"<span underline=\"single\">{1}</span>\"?\n\n" +
			                                   "If you do not rename the links, " +
			                                   "they will no longer link to anything.");
			var label = new Label ();
			label.UseMarkup = true;
			label.Markup = String.Format (labelText,
			                              GLib.Markup.EscapeText (oldTitle),
			                              GLib.Markup.EscapeText (renamedNote.Title));
			label.LineWrap = true;
			ContentArea.PackStart (label, false, true, 5);

			var notesView = new TreeView (notesModel);
			notesView.SetSizeRequest (-1, 200);
			var toggleCell = new CellRendererToggle ();
			toggleCell.Activatable = true;
			var column = new TreeViewColumn (Catalog.GetString ("Rename Links"),
			                                 toggleCell, "active", 0);
			column.SortColumnId = 0;
			column.Resizable = true;
			notesView.AppendColumn (column);
			toggleCell.Toggled += (o, args) => {
				TreeIter iter;
				if (!notesModel.GetIterFromString (out iter, args.Path))
					return;
				bool val = (bool) notesModel.GetValue (iter, 0);
				notesModel.SetValue (iter, 0, !val);
			};
			column = new TreeViewColumn (Catalog.GetString ("Note Title"),
			                             new CellRendererText (), "text", 1);
			column.SortColumnId = 1;
			column.Resizable = true;
			notesView.AppendColumn (column);

			notesView.RowActivated += (o, args) => {
				TreeIter iter;
				if (!notesModel.GetIter (out iter, args.Path))
					return;
				Note note = (Note) notesModel.GetValue (iter, 2);
				if (note != null) {
					note.Window.Present ();
					NoteFindBar find = note.Window.Find;
					find.ShowAll ();
					find.Visible = true;
					find.SearchText = "\"" + oldTitle + "\"";
				}
			};

			var notesBox = new VBox (false, 5);
			var selectAllButton = new Button ();
			// Translators: This button causes all notes in the list to be selected
			selectAllButton.Label = Catalog.GetString ("Select All");
			selectAllButton.Clicked += (o, e) => {
				notesModel.Foreach ((model, path, iter) => {
					notesModel.SetValue (iter, 0, true);
					return false;
				});
			};
			var selectNoneButton = new Button ();
			// Translators: This button causes all notes in the list to be unselected
			selectNoneButton.Label = Catalog.GetString ("Select None");
			selectNoneButton.Clicked += (o, e) => {
				notesModel.Foreach ((model, path, iter) => {
					notesModel.SetValue (iter, 0, false);
					return false;
				});
			};
			var notesButtonBox = new HButtonBox ();
			notesButtonBox.Add (selectNoneButton);
			notesButtonBox.Add (selectAllButton);
			notesButtonBox.Spacing = 5;
			notesButtonBox.LayoutStyle = ButtonBoxStyle.End;
			var notesScroll = new ScrolledWindow ();
			notesScroll.Add (notesView);
			notesBox.PackStart (notesScroll, true, true, 0);
			notesBox.PackStart (notesButtonBox, false, true, 0);

			var advancedExpander = new Expander (Catalog.GetString ("Ad_vanced"));
			var expandBox = new VBox ();
			expandBox.PackStart (notesBox, true, true, 0);
			alwaysShowDlgRadio = new RadioButton (Catalog.GetString ("Always show this _window"));
			alwaysShowDlgRadio.Clicked += (o, e) => {
				selectAllButton.Click ();
				notesBox.Sensitive = true;
				renameButton.Sensitive = true;
				dontRenameButton.Sensitive = true;
			};
			neverRenameRadio = new RadioButton (alwaysShowDlgRadio,
			                                    Catalog.GetString ("Never rename _links"));
			neverRenameRadio.Clicked += (o, e) => {
				selectNoneButton.Click ();
				notesBox.Sensitive = false;
				renameButton.Sensitive = false;
				dontRenameButton.Sensitive = true;
			};
			alwaysRenameRadio = new RadioButton (alwaysShowDlgRadio,
			                                     Catalog.GetString ("Alwa_ys rename links"));
			alwaysRenameRadio.Clicked += (o, e) => {
				selectAllButton.Click ();
				notesBox.Sensitive = false;
				renameButton.Sensitive = true;
				dontRenameButton.Sensitive = false;
			};
			expandBox.PackStart (alwaysShowDlgRadio, false, true, 0);
			expandBox.PackStart (neverRenameRadio, false, true, 0);
			expandBox.PackStart (alwaysRenameRadio, false, true, 0);
			advancedExpander.Add (expandBox);
			ContentArea.PackStart (advancedExpander, true, true, 5);

			advancedExpander.Activated += (o, e) =>
				this.Resizable = advancedExpander.Expanded;

			this.Focus = dontRenameButton;
			ContentArea.ShowAll ();
		}
示例#45
0
        public FilePropertyWidget(FilePropertisData fpd)
        {
            Project project = fpd.Project;
            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null){
                fiOld =new FileItem(fpd.Filename,false);
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
                fiOld.ConditionValues = new System.Collections.Generic.List<ConditionRule>();

            string fullPath = MainClass.Workspace.GetFullPath(fiOld.FilePath);

            string size = "0";
            FileInfo fi = new FileInfo(fullPath);
            if(fi.Exists){
                size =((int)(fi.Length/1024)).ToString() + " KB";
            }

            Table mainTable = new Table(4,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN =GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); //new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));
            Label lblSZ =GetLabel(System.IO.Path.GetFileName(size));// new Label(System.IO.Path.GetFileName(size));

            Entry entr = new Entry(fiOld.SystemFilePath);
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(fullPath);
            entrFullPath.IsEditable = false;

            Label lblPrj =GetLabel(project.ProjectName);// new Label(project.ProjectName);

            CheckButton chbExclude = new CheckButton("");
            chbExclude.Active = fiOld.IsExcluded;

            chbExclude.Clicked+=  delegate(object sender, EventArgs e)
            {
                fiOld.IsExcluded = chbExclude.Active;
            };

            AddControl(ref propertyTable,0,lblFN,"Name ");
            AddControl(ref propertyTable,1,lblSZ,"Size ");
            AddControl(ref propertyTable,2,entr,"Relative Path ");
            AddControl(ref propertyTable,3,entrFullPath,"Full Path ");
            AddControl(ref propertyTable,4,lblPrj,"Project ");
            AddControl(ref propertyTable,5,chbExclude,"Exclude ");

            int rowCount = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }

            Expander exp1 = new Expander("General");
            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");
            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            mainTable.Attach(exp2,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            string extension = System.IO.Path.GetExtension(fpd.Filename);
            switch (extension) {
            case ".png":
            case ".jpg":
            case ".jpeg":
            case ".bmp":
            case ".gif":
            case ".tif":
            case ".svg":{
                Table ImageTable =GenerateImageControl();
                if(ImageTable!= null){
                    Expander expImage = new Expander("Image");
                    expImage.Expanded = true;
                    expImage.Add(ImageTable);
                    mainTable.Attach(expImage,0,1,2,3,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
                }
                break;
            }
            case ".db":
                //
                break;
            default:
                //
                break;
            }

            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
		private Widget GetWidget (CustomAttributeCollection cac)
		{
			FontDescription fd = FontDescription.FromString ("Courier 10 Pitch 10");

			VBox vbox = new VBox (false, 0);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.AddWithViewport (vbox);
			
			if ((cac != null) && (cac.Count > 0)) {
				foreach (CustomAttribute ca in cac) {
 					TextView textview = new TextView ();
					textview.Editable = false;
					textview.Buffer.Text = Format (ca);
					textview.ModifyFont (fd);
					
					Expander expander = new Expander (ca.Constructor.DeclaringType.FullName);
					expander.Add (textview);
					
					vbox.Add (expander);
				}
			}
			
			sw.ShowAll ();
			return sw;
 		}
        private void SetupWidgets()
        {
            histogram_expander = new Expander (Catalog.GetString ("Histogram"));
            histogram_expander.Activated += delegate(object sender, EventArgs e) {
                ContextSwitchStrategy.SetHistogramVisible (Context, histogram_expander.Expanded);
                UpdateHistogram ();
            };
            histogram_expander.StyleSet += delegate(object sender, StyleSetArgs args) {
                Gdk.Color c = this.Toplevel.Style.Backgrounds[(int)Gtk.StateType.Active];
                histogram.RedColorHint = (byte)(c.Red / 0xff);
                histogram.GreenColorHint = (byte)(c.Green / 0xff);
                histogram.BlueColorHint = (byte)(c.Blue / 0xff);
                histogram.BackgroundColorHint = 0xff;
                UpdateHistogram ();
            };
            histogram_image = new Gtk.Image ();
            histogram = new Histogram ();
            histogram_expander.Add (histogram_image);

            Add (histogram_expander);

            info_expander = new Expander (Catalog.GetString ("Image Information"));
            info_expander.Activated += (sender, e) => {
                ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
            };

            info_table = new Table (head_rows, 2, false) { BorderWidth = 0 };

            AddLabelEntry (null, null, null, null,
                           photos => { return String.Format (Catalog.GetString ("{0} Photos"), photos.Length); });

            AddLabelEntry (null, Catalog.GetString ("Name"), null,
                           (photo, file) => { return photo.Name ?? String.Empty; }, null);

            version_list = new ListStore (typeof(IPhotoVersion), typeof(string), typeof(bool));
            version_combo = new ComboBox ();
            CellRendererText version_name_cell = new CellRendererText ();
            version_name_cell.Ellipsize = Pango.EllipsizeMode.End;
            version_combo.PackStart (version_name_cell, true);
            version_combo.SetCellDataFunc (version_name_cell, new CellLayoutDataFunc (VersionNameCellFunc));
            version_combo.Model = version_list;
            version_combo.Changed += OnVersionComboChanged;

            AddEntry (null, Catalog.GetString ("Version"), null, version_combo, 0.5f,
                      (widget, photo, file) => {
                            version_list.Clear ();
                            version_combo.Changed -= OnVersionComboChanged;

                            int count = 0;
                            foreach (IPhotoVersion version in photo.Versions) {
                                version_list.AppendValues (version, version.Name, true);
                                if (version == photo.DefaultVersion)
                                    version_combo.Active = count;
                                count++;
                            }

                            if (count <= 1) {
                                version_combo.Sensitive = false;
                                version_combo.TooltipText = Catalog.GetString ("(No Edits)");
                            } else {
                                version_combo.Sensitive = true;
                                version_combo.TooltipText =
                                    String.Format (Catalog.GetPluralString ("(One Edit)", "({0} Edits)", count - 1),
                                                   count - 1);
                            }
                            version_combo.Changed += OnVersionComboChanged;
                       }, null);

            AddLabelEntry ("date", Catalog.GetString ("Date"), Catalog.GetString ("Show Date"),
                           (photo, file) => {
                               return String.Format ("{0}{2}{1}",
                                                     photo.Time.ToShortDateString (),
                                                     photo.Time.ToShortTimeString (),
                                                     Environment.NewLine); },
                           photos => {
                                IPhoto first = photos[photos.Length - 1];
                                IPhoto last = photos[0];
                                if (first.Time.Date == last.Time.Date) {
                                    //Note for translators: {0} is a date, {1} and {2} are times.
                                    return String.Format (Catalog.GetString ("On {0} between \n{1} and {2}"),
                                                          first.Time.ToShortDateString (),
                                                          first.Time.ToShortTimeString (),
                                                          last.Time.ToShortTimeString ());
                                } else {
                                    return String.Format (Catalog.GetString ("Between {0} \nand {1}"),
                                                          first.Time.ToShortDateString (),
                                                          last.Time.ToShortDateString ());
                                }
                           });

            AddLabelEntry ("size", Catalog.GetString ("Size"), Catalog.GetString ("Show Size"),
                           (photo, metadata) => {
                                int width = metadata.Properties.PhotoWidth;
                                int height = metadata.Properties.PhotoHeight;

                                if (width != 0 && height != 0)
                                    return String.Format ("{0}x{1}", width, height);
                                else
                                    return Catalog.GetString ("(Unknown)");
                           }, null);

            AddLabelEntry ("exposure", Catalog.GetString ("Exposure"), Catalog.GetString ("Show Exposure"),
                           (photo, metadata) => {
                                var fnumber = metadata.ImageTag.FNumber;
                                var exposure_time = metadata.ImageTag.ExposureTime;
                                var iso_speed = metadata.ImageTag.ISOSpeedRatings;

                                string info = String.Empty;

                                if (fnumber.HasValue && fnumber.Value != 0.0) {
                                    info += String.Format ("f/{0:.0} ", fnumber.Value);
                                }

                                if (exposure_time.HasValue) {
                                    if (Math.Abs (exposure_time.Value) >= 1.0) {
                                        info += String.Format ("{0} sec ", exposure_time.Value);
                                    } else {
                                        info += String.Format ("1/{0} sec ", (int)(1 / exposure_time.Value));
                                    }
                                }

                                if (iso_speed.HasValue) {
                                    info += String.Format ("{0}ISO {1}", Environment.NewLine, iso_speed.Value);
                                }

                                var exif = metadata.ImageTag.Exif;
                                if (exif != null) {
                                    var flash = exif.ExifIFD.GetLongValue (0, (ushort)TagLib.IFD.Tags.ExifEntryTag.Flash);

                                    if (flash.HasValue) {
                                        if ((flash.Value & 0x01) == 0x01)
                                            info += String.Format (", {0}", Catalog.GetString ("flash fired"));
                                        else
                                            info += String.Format (", {0}", Catalog.GetString ("flash didn't fire"));
                                    }
                                }

                                if (info == String.Empty)
                                    return Catalog.GetString ("(None)");

                                return info;
                           }, null);

            AddLabelEntry ("focal_length", Catalog.GetString ("Focal Length"), Catalog.GetString ("Show Focal Length"),
                           false, (photo, metadata) => {
                                var focal_length = metadata.ImageTag.FocalLength;

                                if (focal_length == null)
                                    return Catalog.GetString ("(Unknown)");
                                else
                                    return String.Format ("{0} mm", focal_length.Value);
                            }, null);

            AddLabelEntry ("camera", Catalog.GetString ("Camera"), Catalog.GetString ("Show Camera"), false,
                           (photo, metadata) => { return metadata.ImageTag.Model ?? Catalog.GetString ("(Unknown)"); },
                           null);

            AddLabelEntry ("creator", Catalog.GetString ("Creator"), Catalog.GetString ("Show Creator"),
                           (photo, metadata) => { return metadata.ImageTag.Creator ?? Catalog.GetString ("(Unknown)"); },
                           null);

            AddLabelEntry ("file_size", Catalog.GetString ("File Size"), Catalog.GetString ("Show File Size"), false,
                           (photo, metadata) => {
                                try {
                                    GFile file = FileFactory.NewForUri (photo.DefaultVersion.Uri);
                                    GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
                                    return Format.SizeForDisplay (file_info.Size);
                                } catch (GLib.GException e) {
                                    Hyena.Log.DebugException (e);
                                    return Catalog.GetString ("(File read error)");
                                }
                            }, null);

            var rating_entry = new RatingEntry { HasFrame = false, AlwaysShowEmptyStars = true };
            rating_entry.Changed += HandleRatingChanged;
            var rating_align = new Gtk.Alignment (0, 0, 0, 0);
            rating_align.Add (rating_entry);
            AddEntry ("rating", Catalog.GetString ("Rating"), Catalog.GetString ("Show Rating"), rating_align, false,
                      (widget, photo, metadata) => { ((widget as Alignment).Child as RatingEntry).Value = (int) photo.Rating; },
                      null);

            AddEntry ("tag", null, Catalog.GetString ("Show Tags"), new TagView (), false,
                      (widget, photo, metadata) => { (widget as TagView).Current = photo; }, null);

            UpdateTable ();

            EventBox eb = new EventBox ();
            eb.Add (info_table);
            info_expander.Add (eb);
            eb.ButtonPressEvent += HandleButtonPressEvent;

            Add (info_expander);
        }
示例#48
0
        /// <summary>
        /// Create More options
        /// </summary>
        /// <param name="filteredDomainID">Domain ID</param>
        /// <returns>Widget</returns>
        private Widget CreateMoreOptionsExpander(string filteredDomainID)
        {
            Expander moreOptionsExpander = new Expander(Util.GS("More options"));

            Table optionsTable = new Table(4, 3, false);

            moreOptionsExpander.Add(optionsTable);

            optionsTable.ColumnSpacing = 10;
            optionsTable.RowSpacing    = 10;
            optionsTable.SetColSpacing(0, 30);

            Label l = new Label(Util.GS("iFolder account") + ":");

            l.Xalign = 0;
            ///Syntax:  Table.Attach(widget, column_start, column_end, row_start, row_end, AttachOptions,.....
            optionsTable.Attach(l, 1, 2, 0, 1,
                                AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0);

            Encryption = new RadioButton(Util.GS("Passphrase Encryption"));
            optionsTable.Attach(Encryption, 2, 3, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0);

            Regular = new RadioButton(Encryption, Util.GS("Regular"));
            optionsTable.Attach(Regular, 3, 4, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0);

            SecureSync = new CheckButton(Util.GS("Secure Sync"));
            optionsTable.Attach(SecureSync, 4, 5, 1, 2,
                                AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);


            l        = new Label(Util.GS("Type") + ":");
            l.Xalign = 0;
            optionsTable.Attach(l, 1, 2, 1, 2,
                                AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0);

            // Set up Domains
            domainComboBox = ComboBox.NewText();
            optionsTable.Attach(domainComboBox, 2, 4, 0, 1,
                                AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);

            int defaultDomain = 0;

            for (int x = 0; x < domains.Length; x++)
            {
                domainComboBox.AppendText(String.Format(domains[x].Name + " - " + domains[x].Host));
                if (filteredDomainID != null)
                {
                    if (filteredDomainID == domains[x].ID)
                    {
                        defaultDomain = x;
                    }
                }
                else
                {
                    defaultDomain = x;
                }
            }

            domainComboBox.Active = defaultDomain;
            int encr_status = ifws.GetSecurityPolicy(domains[defaultDomain].ID);

            ChangeStatus(encr_status);

/*
 *                      l = new Label(Util.GS("Description:"));
 *                      l.Xalign = 0;
 *                      optionsTable.Attach(l, 1,2,1,2,
 *                                                              AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
 *
 *                      descriptionTextView = new TextView();
 *                      descriptionTextView.LeftMargin = 4;
 *                      descriptionTextView.RightMargin = 4;
 *                      descriptionTextView.Editable = true;
 *                      descriptionTextView.CursorVisible = true;
 *                      descriptionTextView.AcceptsTab = false;
 *                      descriptionTextView.WrapMode = WrapMode.WordChar;
 *
 *                      ScrolledWindow sw = new ScrolledWindow();
 *                      sw.ShadowType = ShadowType.EtchedIn;
 *                      sw.Add(descriptionTextView);
 *                      optionsTable.Attach(sw, 2,3,1,2,
 *                                                              AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
 */
            moreOptionsExpander.Expanded = true;
            optionsTable.ShowAll();

            return(moreOptionsExpander);
        }
示例#49
0
        public DapPropertiesDialog(DapSource source) : base(
                // Translators: {0} is the name assigned to a Digital Audio Player by its owner
                String.Format(Catalog.GetString("{0} Properties"), source.Name),
                null,
                DialogFlags.Modal,
                Stock.Close,
                ResponseType.Close)
        {
            this.source = source;

            HBox iconbox = new HBox();

            iconbox.Spacing = 10;
            //Image icon = new Image (source.Properties.Get<string> ("Icon.Names")[0], IconSize.Dialog);
            //icon.Yalign = 0.0f;
            //icon.Pixbuf = device.GetIcon(48);
            //iconbox.PackStart(icon, false, false, 0);

            VBox box = new VBox();

            box.Spacing = 10;

            PropertyTable table = new PropertyTable();

            table.ColumnSpacing = 10;
            table.RowSpacing    = 5;

            if (!source.IsReadOnly && source.CanRename)
            {
                nameEntry          = table.AddEntry(Catalog.GetString("Device name"), source.Name);
                nameEntry.Changed += OnEntryChanged;
            }
            else
            {
                table.AddLabel(Catalog.GetString("Device name"), source.Name);
            }

            /*if(device.ShowOwner) {
             *  if(!device.IsReadOnly && device.CanSetOwner) {
             *      ownerEntry = table.AddEntry(Catalog.GetString("Owner name"), device.Owner);
             *      ownerEntry.Changed += OnEntryChanged;
             *  } else {
             *      table.AddLabel(Catalog.GetString("Owner name"), device.Owner);
             *  }
             * }*/

            if (!source.IsReadOnly)
            {
                try {
                    VBox profile_description_box            = new VBox();
                    ProfileComboBoxConfigurable profile_box = new ProfileComboBoxConfigurable(ServiceManager.MediaProfileManager,
                                                                                              source.UniqueId, profile_description_box);
                    profile_box.Combo.MimeTypeFilter = source.AcceptableMimeTypes;
                    table.AddWidget(Catalog.GetString("Encode to"), profile_box);
                    table.AddWidget(null, profile_description_box);
                    profile_description_box.Show();

                    table.AddSeparator();
                } catch (Exception e) {
                    Console.WriteLine(e);
                }
            }

            table.AddWidget(Catalog.GetString("Capacity used"), UsedProgressBar);

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

            PropertyTable extTable = new PropertyTable();

            extTable.ColumnSpacing = 10;
            extTable.RowSpacing    = 5;

            foreach (DapSource.DapProperty property in source.DapProperties)
            {
                extTable.AddLabel(property.Name, property.Value);
            }

            Expander expander = new Expander(Catalog.GetString("Advanced details"));

            expander.Add(extTable);
            box.PackStart(expander, false, false, 0);

            BorderWidth = 10;
            Resizable   = false;
            iconbox.PackStart(box, true, true, 0);
            iconbox.ShowAll();
            ContentArea.Add(iconbox);
        }
        public ExceptionDialog(Exception e) : base()
        {
            debugInfo = BuildExceptionMessage(e);
           
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = false;
            Title = Catalog.GetString("F-Spot Encountered a Fatal Error");
            
            VBox.Spacing = 12;
            ActionArea.Layout = ButtonBoxStyle.End;

            accel_group = new AccelGroup();
		    AddAccelGroup(accel_group);
        
            HBox hbox = new HBox(false, 12);
            hbox.BorderWidth = 5;
            VBox.PackStart(hbox, false, false, 0);
        
            Image image = new Image(Stock.DialogError, IconSize.Dialog);
            image.Yalign = 0.0f;
            hbox.PackStart(image, true, true, 0);

            VBox label_vbox = new VBox(false, 0);
            label_vbox.Spacing = 12;
            hbox.PackStart(label_vbox, false, false, 0);

            Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title)));
            label.UseMarkup = true;
            label.Justify = Justification.Left;
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            label = new Label(e.Message);
                
            label.UseMarkup = true;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            Label details_label = new Label(String.Format("<b>{0}</b>", 
                GLib.Markup.EscapeText(Catalog.GetString("Error Details"))));
            details_label.UseMarkup = true;
            Expander details_expander = new Expander("Details");
            details_expander.LabelWidget = details_label;
            label_vbox.PackStart(details_expander, true, true, 0);

            ScrolledWindow scroll = new ScrolledWindow();
            TextView view = new TextView();
            
            scroll.HscrollbarPolicy = PolicyType.Automatic;
            scroll.VscrollbarPolicy = PolicyType.Automatic;
            scroll.AddWithViewport(view);
            
            scroll.SetSizeRequest(450, 250);
			
			view.Editable = false;
			view.Buffer.Text = debugInfo;
			
			details_expander.Add(scroll);
			
            hbox.ShowAll();

			AddButton(Stock.Close, ResponseType.Close, true);
        }
示例#51
0
		private void Build ()
		{
			var hbox = new HBox ();
			hbox.Spacing = 6;
			hbox.BorderWidth = 12;

			var error_icon = new Image ();
			error_icon.Pixbuf = PintaCore.Resources.GetIcon (Stock.DialogError, 32);
			error_icon.Yalign = 0;
			hbox.PackStart (error_icon, false, false, 0);

			var vbox = new VBox ();
			vbox.Spacing = 6;

			description_label = new Label ();
			description_label.Wrap = true;
			description_label.Xalign = 0;
			vbox.PackStart (description_label, false, false, 0);

			expander = new Expander (Catalog.GetString ("Details"));
			details_text = new TextView ();
			var scroll = new ScrolledWindow ();
			scroll.Add (details_text);
			scroll.HeightRequest = 250;
			expander.Add (scroll);
			vbox.Add (expander);

			hbox.Add (vbox);
			this.VBox.Add (hbox);
			
			bug_report_button = new Button (Catalog.GetString ("Report Bug...."));
			bug_report_button.CanFocus = false;
			ActionArea.Add (bug_report_button);

			var ok_button = new Button (Gtk.Stock.Ok);
			ok_button.CanDefault = true;
			AddActionWidget (ok_button, ResponseType.Ok);

			DefaultWidth = 600;
			DefaultHeight = 142;

			ShowAll ();
		}
        private void BuildWindow()
        {
            this.Resizable = false;

            BorderWidth       = 6;
            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();

            box.BorderWidth = 6;
            box.Spacing     = 12;

            Image image = new Image(PodcastPixbufs.PodcastIcon48);

            image.Yalign = 0.0f;

            box.PackStart(image, false, true, 0);

            VBox content_box = new VBox();

            content_box.Spacing = 12;

            Label header = new Label();

            header.Markup = "<big><b>" + GLib.Markup.EscapeText(Catalog.GetString(
                                                                    "Subscribe to New Podcast Feed")) + "</b></big>";
            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.0f);

            Label message = new Label(Catalog.GetString(
                                          "Please enter the URL of the podcast you wish to subscribe to"));

            message.Wrap    = true;
            message.Justify = Justification.Left;
            message.SetAlignment(0.0f, 0.0f);

            Expander advanced_expander = new Expander("Advanced");

            VBox expander_children = new VBox();

            expander_children.BorderWidth = 6;
            expander_children.Spacing     = 6;

            Label sync_text = new Label(Catalog.GetString(
                                            "When new episodes are available:  "));

            sync_text.SetAlignment(0.0f, 0.0f);
            sync_text.Justify = Justification.Left;

            sync_combo = new SyncPreferenceComboBox();

            expander_children.PackStart(sync_text);
            expander_children.PackStart(sync_combo);

            advanced_expander.Add(expander_children);

            url_entry = new Entry();
            url_entry.ActivatesDefault = true;

            Table table = new Table(1, 2, false);

            table.RowSpacing    = 6;
            table.ColumnSpacing = 12;

            table.Attach(new Label(Catalog.GetString("URL:")), 0, 1, 0, 1,
                         AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            table.Attach(url_entry, 1, 2, 0, 1,
                         AttachOptions.Expand | AttachOptions.Fill,
                         AttachOptions.Shrink, 0, 0);

            table.Attach(advanced_expander, 0, 2, 1, 2,
                         AttachOptions.Expand | AttachOptions.Fill,
                         AttachOptions.Shrink, 0, 0);

            content_box.PackStart(header, false, true, 0);
            content_box.PackStart(message, false, true, 0);

            content_box.PackStart(table, false, true, 0);

            box.PackStart(content_box, false, true, 0);

            AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
            AddButton(Catalog.GetString("Subscribe"), ResponseType.Ok, true);

            box.ShowAll();
            VBox.Add(box);
        }
 protected virtual void OnInvokeClicked (object sender, System.EventArgs e)
 {
     foreach (var child in outputsBox.Children) {
         outputsBox.Remove (child);
     }
     
     var arguments = new Dictionary<string, string> ();
     var children = table.Children;
     for (var i = children.Length - 1; i > 0; i -= 2) {
         string value;
         var child = children[i - 1];
         var entry = child as Entry;
         if (entry != null) {
             value = entry.Text;
         } else {
             value = ((ComboBox)child).ActiveText;
         }
         arguments[((Label)children[i]).Text] = value;
     }
     
     inputsBox.Sensitive = false;
     invoke.Sensitive = false;
     
     ThreadPool.QueueUserWorkItem (state => {
         try  {
             var results = action.Invoke (arguments);
             if (results == null) {
                 return;
             }
             Application.Invoke ((o, a) => {
                 foreach (var result in results) {
                     var expander = new Expander (result.Key);
                     expander.Add (new Label (result.Value) { LineWrap = true, Selectable = true });
                     outputsBox.PackStart (expander, false, false, 0);
                 }
                 outputsBox.ShowAll ();
                 inputsBox.Sensitive = true;
                 invoke.Sensitive = true;
             });
         } catch (UpnpControlException exception) {
             // TODO report error to the UI
             Console.WriteLine ("Upnp error: " + exception.UpnpError);
         }
     });
 }
示例#54
0
        public DapPropertiesDialog(DapSource source)
            : base(// Translators: {0} is the name assigned to a Digital Audio Player by its owner
            String.Format(Catalog.GetString("{0} Properties"), source.Name),
            null,
            DialogFlags.Modal,
            Stock.Close,
            ResponseType.Close)
        {
            this.source = source;

            HBox iconbox = new HBox();
            iconbox.Spacing = 10;
            //Image icon = new Image (source.Properties.Get<string> ("Icon.Names")[0], IconSize.Dialog);
            //icon.Yalign = 0.0f;
            //icon.Pixbuf = device.GetIcon(48);
            //iconbox.PackStart(icon, false, false, 0);

            VBox box = new VBox();
            box.Spacing = 10;

            PropertyTable table = new PropertyTable();
            table.ColumnSpacing = 10;
            table.RowSpacing = 5;

            if(!source.IsReadOnly && source.CanRename) {
                nameEntry = table.AddEntry(Catalog.GetString("Device name"), source.Name);
                nameEntry.Changed += OnEntryChanged;
            } else {
                table.AddLabel(Catalog.GetString("Device name"), source.Name);
            }

            /*if(device.ShowOwner) {
                if(!device.IsReadOnly && device.CanSetOwner) {
                    ownerEntry = table.AddEntry(Catalog.GetString("Owner name"), device.Owner);
                    ownerEntry.Changed += OnEntryChanged;
                } else {
                    table.AddLabel(Catalog.GetString("Owner name"), device.Owner);
                }
            }*/

            if(!source.IsReadOnly) {
                try {
                    VBox profile_description_box = new VBox();
                    ProfileComboBoxConfigurable profile_box = new ProfileComboBoxConfigurable(ServiceManager.MediaProfileManager,
                        source.UniqueId, profile_description_box);
                    profile_box.Combo.MimeTypeFilter = source.AcceptableMimeTypes;
                    table.AddWidget(Catalog.GetString("Encode to"), profile_box);
                    table.AddWidget(null, profile_description_box);
                    profile_description_box.Show();

                    table.AddSeparator();
                } catch(Exception e) {
                    Console.WriteLine(e);
                }
            }

            table.AddWidget(Catalog.GetString("Capacity used"), UsedProgressBar);

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

            PropertyTable extTable = new PropertyTable();
            extTable.ColumnSpacing = 10;
            extTable.RowSpacing = 5;

            foreach(DapSource.DapProperty property in source.DapProperties) {
                extTable.AddLabel(property.Name, property.Value);
            }

            Expander expander = new Expander(Catalog.GetString("Advanced details"));
            expander.Add(extTable);
            box.PackStart(expander, false, false, 0);

            BorderWidth = 10;
            Resizable = false;
            iconbox.PackStart(box, true, true, 0);
            iconbox.ShowAll();
            ContentArea.Add(iconbox);
        }
        public ExceptionDialog(Exception e) : base()
        {
            debugInfo = BuildExceptionMessage(e);

            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = Catalog.GetString("F-Spot Encountered a Fatal Error");

            VBox.Spacing      = 12;
            ActionArea.Layout = ButtonBoxStyle.End;

            accel_group = new AccelGroup();
            AddAccelGroup(accel_group);

            HBox hbox = new HBox(false, 12);

            hbox.BorderWidth = 5;
            VBox.PackStart(hbox, false, false, 0);

            Image image = new Image(Stock.DialogError, IconSize.Dialog);

            image.Yalign = 0.0f;
            hbox.PackStart(image, true, true, 0);

            VBox label_vbox = new VBox(false, 0);

            label_vbox.Spacing = 12;
            hbox.PackStart(label_vbox, false, false, 0);

            Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title)));

            label.UseMarkup = true;
            label.Justify   = Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            label = new Label(e.Message);

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            Label details_label = new Label(String.Format("<b>{0}</b>",
                                                          GLib.Markup.EscapeText(Catalog.GetString("Error Details"))));

            details_label.UseMarkup = true;
            Expander details_expander = new Expander("Details");

            details_expander.LabelWidget = details_label;
            label_vbox.PackStart(details_expander, true, true, 0);

            ScrolledWindow scroll = new ScrolledWindow();
            TextView       view   = new TextView();

            scroll.HscrollbarPolicy = PolicyType.Automatic;
            scroll.VscrollbarPolicy = PolicyType.Automatic;
            scroll.AddWithViewport(view);

            scroll.SetSizeRequest(450, 250);

            view.Editable    = false;
            view.Buffer.Text = debugInfo;

            details_expander.Add(scroll);

            hbox.ShowAll();

            AddButton(Stock.Close, ResponseType.Close, true);
        }
示例#56
0
 internal void Init(Gtk.Window parent,
 DialogType type,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement,
 string details)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       HBox h = new HBox();
       h.BorderWidth = 10;
       h.Spacing = 10;
       dialogImage = new Image();
       switch(type)
       {
        case DialogType.Error:
     dialogImage.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog);
     break;
        case DialogType.Question:
     dialogImage.SetFromStock(Gtk.Stock.DialogQuestion, IconSize.Dialog);
     break;
        case DialogType.Warning:
     dialogImage.SetFromStock(Gtk.Stock.DialogWarning, IconSize.Dialog);
     break;
        default:
        case DialogType.Info:
     dialogImage.SetFromStock(Gtk.Stock.DialogInfo, IconSize.Dialog);
     break;
       }
       dialogImage.SetAlignment(0.5F, 0);
       h.PackStart(dialogImage, false, false, 0);
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       if (details != null)
       {
        detailsExpander = new Expander(Util.GS("_Details"));
        v.PackStart(detailsExpander, false, false, 0);
        TextView textView = new TextView();
        textView.Editable = false;
        textView.WrapMode = WrapMode.Char;
        TextBuffer textBuffer = textView.Buffer;
        textBuffer.Text = details;
        showDetailsScrolledWindow = new ScrolledWindow();
        detailsExpander.Add(showDetailsScrolledWindow);
        showDetailsScrolledWindow.AddWithViewport(textView);
        showDetailsScrolledWindow.Visible = false;
       }
       extraWidgetVBox = new VBox(false, 0);
       v.PackStart(extraWidgetVBox, false, false, 0);
       extraWidgetVBox.NoShowAll = true;
       extraWidget = null;
       h.PackEnd(v);
       h.ShowAll();
       this.VBox.Add(h);
       Widget defaultButton;
       switch(buttonSet)
       {
        default:
        case ButtonSet.Ok:
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.OkCancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.YesNo:
     this.AddButton(Stock.No, ResponseType.No);
     defaultButton = this.AddButton(Stock.Yes, ResponseType.Yes);
     break;
       }
       defaultButton.CanDefault = true;
       defaultButton.GrabFocus();
 }
示例#57
0
        private void SetupWidgets()
        {
            histogram_expander            = new Expander(Catalog.GetString("Histogram"));
            histogram_expander.Activated += delegate(object sender, EventArgs e) {
                ContextSwitchStrategy.SetHistogramVisible(Context, histogram_expander.Expanded);
                UpdateHistogram();
            };
            histogram_image = new Gtk.Image();
            histogram       = new Histogram();
            histogram_expander.Add(histogram_image);

            Window window = MainWindow.Toplevel.Window;

            Gdk.Color c = window.Style.Backgrounds [(int)Gtk.StateType.Active];
            histogram.RedColorHint        = (byte)(c.Red / 0xff);
            histogram.GreenColorHint      = (byte)(c.Green / 0xff);
            histogram.BlueColorHint       = (byte)(c.Blue / 0xff);
            histogram.BackgroundColorHint = 0xff;

            Add(histogram_expander);

            info_expander            = new Expander(Catalog.GetString("Image Information"));
            info_expander.Activated += delegate(object sender, EventArgs e) {
                ContextSwitchStrategy.SetInfoBoxVisible(Context, info_expander.Expanded);
            };

            Table info_table = new Table(7, 2, false);

            info_table.BorderWidth = 0;

            string name_pre  = "<b>";
            string name_post = "</b>";

            name_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Name") + name_post);
            info_table.Attach(name_label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            version_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Version") + name_post);
            info_table.Attach(version_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            date_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Date") + name_post + Environment.NewLine);
            info_table.Attach(date_label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            size_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Size") + name_post);
            info_table.Attach(size_label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            default_exposure_string = name_pre + Catalog.GetString("Exposure") + name_post;
            exposure_label          = CreateRightAlignedLabel(default_exposure_string);
            info_table.Attach(exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            rating_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Rating") + name_post);
            info_table.Attach(rating_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
            rating_label.Visible = false;

            name_value_label            = new Label();
            name_value_label.Ellipsize  = Pango.EllipsizeMode.Middle;
            name_value_label.Justify    = Gtk.Justification.Left;
            name_value_label.Selectable = true;
            name_value_label.Xalign     = 0;
            info_table.Attach(name_value_label, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 3, 0);

            date_value_label     = AttachLabel(info_table, 2, name_value_label);
            size_value_label     = AttachLabel(info_table, 3, name_value_label);
            exposure_value_label = AttachLabel(info_table, 4, name_value_label);

            version_option_menu = new OptionMenu();
            info_table.Attach(version_option_menu, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            date_value_label.Text     = Environment.NewLine;
            exposure_value_label.Text = Environment.NewLine;

            Gtk.Alignment rating_align = new Gtk.Alignment(0, 0, 0, 0);
            info_table.Attach(rating_align, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            rating_view          = new RatingSmall();
            rating_view.Visible  = false;
            rating_view.Changed += HandleRatingChanged;
            rating_align.Add(rating_view);

            tag_view = new TagView(MainWindow.ToolTips);
            info_table.Attach(tag_view, 0, 2, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
            tag_view.Show();

            info_table.ShowAll();

            info_expander.Add(info_table);
            Add(info_expander);
            rating_label.Visible = show_rating;
            rating_view.Visible  = show_rating;
        }
示例#58
0
		private void SetupWidgets ()
		{

			histogram_expander = new Expander (Catalog.GetString ("Histogram"));
			histogram_expander.Activated += delegate (object sender, EventArgs e) { 
				ContextSwitchStrategy.SetHistogramVisible (Context, histogram_expander.Expanded);
				UpdateHistogram ();
			};
			histogram_image = new Gtk.Image ();
			histogram = new Histogram ();
			histogram_expander.Add (histogram_image);

			Window window = MainWindow.Toplevel.Window;
			Gdk.Color c = window.Style.Backgrounds [(int)Gtk.StateType.Active];
			histogram.RedColorHint = (byte) (c.Red / 0xff);
			histogram.GreenColorHint = (byte) (c.Green / 0xff);
			histogram.BlueColorHint = (byte) (c.Blue / 0xff);
			histogram.BackgroundColorHint = 0xff;

			Add (histogram_expander);

			info_expander = new Expander (Catalog.GetString ("Image Information"));
			info_expander.Activated += delegate (object sender, EventArgs e) {
				ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
			};

			Table info_table = new Table (7, 2, false);
			info_table.BorderWidth = 0;
	
			string name_pre = "<b>";
			string name_post = "</b>";

			name_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Name") + name_post);
			info_table.Attach (name_label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

			version_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Version") + name_post); 
			info_table.Attach (version_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

			date_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Date") + name_post + Environment.NewLine);
			info_table.Attach (date_label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

			size_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Size") + name_post);
			info_table.Attach (size_label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

			default_exposure_string = name_pre + Catalog.GetString ("Exposure") + name_post;
			exposure_label = CreateRightAlignedLabel (default_exposure_string);
			info_table.Attach (exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
			
			rating_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Rating") + name_post);
			info_table.Attach (rating_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
			rating_label.Visible = false;

			name_value_label = new Label ();
			name_value_label.Ellipsize = Pango.EllipsizeMode.Middle;
			name_value_label.Justify = Gtk.Justification.Left;
			name_value_label.Selectable = true;
			name_value_label.Xalign = 0;
			info_table.Attach (name_value_label, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 3, 0);
			
			date_value_label = AttachLabel (info_table, 2, name_value_label);
			size_value_label = AttachLabel (info_table, 3, name_value_label);
			exposure_value_label = AttachLabel (info_table, 4, name_value_label);
	
			version_option_menu = new OptionMenu ();
			info_table.Attach (version_option_menu, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
	
			date_value_label.Text = Environment.NewLine;
			exposure_value_label.Text = Environment.NewLine;

			Gtk.Alignment rating_align = new Gtk.Alignment( 0, 0, 0, 0);
			info_table.Attach (rating_align, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
			
			rating_view = new RatingSmall ();
			rating_view.Visible = false;
			rating_view.Changed += HandleRatingChanged;
			rating_align.Add (rating_view);

			tag_view = new TagView (MainWindow.ToolTips);
			info_table.Attach (tag_view, 0, 2, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
			tag_view.Show ();

			info_table.ShowAll ();
	
			info_expander.Add (info_table);
			Add (info_expander);
			rating_label.Visible = show_rating;
			rating_view.Visible = show_rating;
		}
示例#59
0
        public Dialog(VariableSet variables) : base(_("UpdateCheck"), variables)
        {
            var vbox = new VBox(false, 12)
            {
                BorderWidth = 12
            };

            VBox.PackStart(vbox, true, true, 0);

            var table = new GimpTable(4, 3)
            {
                ColumnSpacing = 6, RowSpacing = 6
            };

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

            table.Attach(new GimpCheckButton(_("Check _GIMP"),
                                             GetVariable <bool>("check_gimp")),
                         0, 1, 0, 1);

            table.Attach(new GimpCheckButton(_("Check G_IMP#"),
                                             GetVariable <bool>("check_gimp_sharp")),
                         0, 1, 1, 2);

            table.Attach(new GimpCheckButton(_("Check _Unstable Releases"),
                                             GetVariable <bool>("check_unstable")),
                         0, 1, 2, 3);

            var enableProxy = GetVariable <bool>("enable_proxy");
            var httpProxy   = GetVariable <string>("http_proxy");
            var port        = GetVariable <string>("port");

            string tmp = Gimp.RcQuery("update-enable-proxy");

            enableProxy.Value = (tmp != null || tmp == "true");
            httpProxy.Value   = Gimp.RcQuery("update-http-proxy") ?? "";
            port.Value        = Gimp.RcQuery("update-port") ?? "";

            var expander = new Expander(_("Proxy settings"));
            var proxyBox = new VBox(false, 12);

            proxyBox.Add(new GimpCheckButton(_("Manual proxy configuration"),
                                             enableProxy));

            var hbox = new HBox(false, 12)
            {
                Sensitive = enableProxy.Value
            };

            proxyBox.Add(hbox);

            hbox.Add(new Label(_("HTTP Proxy:")));
            hbox.Add(new GimpEntry(httpProxy));

            hbox.Add(new Label(_("Port:")));
            hbox.Add(new GimpEntry(port)
            {
                WidthChars = 4
            });

            enableProxy.ValueChanged += delegate
            {
                hbox.Sensitive = enableProxy.Value;
            };

            expander.Add(proxyBox);
            table.Attach(expander, 0, 1, 3, 4);
        }
示例#60
0
        private void SetupWidgets()
        {
            histogram_expander = new Expander (Catalog.GetString ("Histogram"));
            histogram_expander.Activated += delegate (object sender, EventArgs e) {
                ContextSwitchStrategy.SetHistogramVisible (Context, histogram_expander.Expanded);
                UpdateHistogram ();
            };
            histogram_expander.StyleSet += delegate (object sender, StyleSetArgs args) {
                Gdk.Color c = this.Toplevel.Style.Backgrounds [(int)Gtk.StateType.Active];
                histogram.RedColorHint = (byte) (c.Red / 0xff);
                histogram.GreenColorHint = (byte) (c.Green / 0xff);
                histogram.BlueColorHint = (byte) (c.Blue / 0xff);
                histogram.BackgroundColorHint = 0xff;
                UpdateHistogram ();
            };
            histogram_image = new Gtk.Image ();
            histogram = new Histogram ();
            histogram_expander.Add (histogram_image);

            Add (histogram_expander);

            info_expander = new Expander (Catalog.GetString ("Image Information"));
            info_expander.Activated += delegate (object sender, EventArgs e) {
                ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
            };

            Table info_table = new Table (10, 2, false);
            info_table.BorderWidth = 0;

            string name_pre = "<b>";
            string name_post = "</b>";

            name_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Name") + name_post);
            info_table.Attach (name_label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            version_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Version") + name_post);
            info_table.Attach (version_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            date_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Date") + name_post + Environment.NewLine);
            info_table.Attach (date_label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            size_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Size") + name_post);
            info_table.Attach (size_label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            default_exposure_string = name_pre + Catalog.GetString ("Exposure") + name_post;
            exposure_label = CreateRightAlignedLabel (default_exposure_string);
            info_table.Attach (exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            focal_length_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Focal Length") + name_post);
            info_table.Attach (focal_length_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            camera_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Camera") + name_post);
            info_table.Attach (camera_label, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            file_size_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("File Size") + name_post);
            info_table.Attach (file_size_label, 0, 1, 7, 8, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            rating_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Rating") + name_post);
            info_table.Attach (rating_label, 0, 1, 8, 9, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
            rating_label.Visible = false;

            name_value_label = new Label ();
            name_value_label.Ellipsize = Pango.EllipsizeMode.Middle;
            name_value_label.Justify = Gtk.Justification.Left;
            name_value_label.Selectable = true;
            name_value_label.Xalign = 0;
            name_value_label.PopulatePopup += HandlePopulatePopup;

            info_table.Attach (name_value_label, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 3, 0);

            date_value_label = AttachLabel (info_table, 2, name_value_label);
            size_value_label = AttachLabel (info_table, 3, name_value_label);
            exposure_value_label = AttachLabel (info_table, 4, name_value_label);

            version_list = new ListStore (typeof (uint), typeof (string), typeof (bool));
            version_combo = new ComboBox ();
            CellRendererText version_name_cell = new CellRendererText ();
            version_name_cell.Ellipsize = Pango.EllipsizeMode.End;
            version_combo.PackStart (version_name_cell, true);
            version_combo.SetCellDataFunc (version_name_cell, new CellLayoutDataFunc (VersionNameCellFunc));
            version_combo.Model = version_list;
            version_combo.Changed += OnVersionComboChanged;
            info_table.Attach (version_combo, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            date_value_label.Text = Environment.NewLine;
            exposure_value_label.Text = Environment.NewLine;
            focal_length_value_label = AttachLabel (info_table, 5, name_value_label);
            camera_value_label = AttachLabel (info_table, 6, name_value_label);
            file_size_value_label = AttachLabel (info_table, 7, name_value_label);

            Gtk.Alignment rating_align = new Gtk.Alignment( 0, 0, 0, 0);
            info_table.Attach (rating_align, 1, 2, 8, 9, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            rating_view = new RatingSmall ();
            rating_view.Visible = false;
            rating_view.Changed += HandleRatingChanged;
            rating_align.Add (rating_view);

            tag_view = new TagView (MainWindow.ToolTips);
            info_table.Attach (tag_view, 0, 2, 9, 10, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);

            info_table.ShowAll ();

            EventBox eb = new EventBox ();
            eb.Add (info_table);
            info_expander.Add (eb);
            eb.ButtonPressEvent += HandleButtonPressEvent;

            Add (info_expander);
            rating_label.Visible = show_rating;
            rating_view.Visible = show_rating;
        }