Exemplo n.º 1
0
        private void _InitEngineList()
        {
            string[] engines        = (string[])Frontend.FrontendConfig["Engines/Engines"];
            string   default_engine = (string)Frontend.FrontendConfig["Engines/Default"];
            int      item           = 0;

            _ListStore.Clear();
            _ListStore.AppendValues("<" + _("Local Engine") + ">");
            item++;
            foreach (string engine in engines)
            {
                _ListStore.AppendValues(engine);
                if (engine == default_engine)
                {
                    _ComboBox.Active = item;
                }
                item++;
            }
        }
Exemplo n.º 2
0
        public void InitNetworks(IList <string> networks)
        {
            Trace.Call(networks);

            if (networks == null)
            {
                throw new ArgumentNullException("networks");
            }

            f_NetworkComboBoxEntry.Visible = true;

            // fill protocols in ListStore
            f_NetworkListStore.Clear();
            foreach (string network in networks)
            {
                f_NetworkListStore.AppendValues(network);
            }
            f_NetworkListStore.SetSortColumnId(0, Gtk.SortType.Ascending);
            f_NetworkComboBoxEntry.Model      = f_NetworkListStore;
            f_NetworkComboBoxEntry.TextColumn = 0;
        }
        void FillConfigurations()
        {
            loading = true;
            configListStore.Clear();

            if (allowMixedConfigurations)
            {
                AppendComboConfig(GettextCatalog.GetString("All Configurations"));
            }

            HashSet <string> configs = new HashSet <string> ();

            foreach (ItemConfiguration config in FilterConfigurations(dialog.ConfigurationData.Configurations))
            {
                if (configs.Add(config.Name))
                {
                    AppendComboConfig(config.Name);
                }
            }

            loading = false;
        }
Exemplo n.º 4
0
        void UpdateIconStore()
        {
            // Read ~/.config/tomboy/BugzillaIcons/"

            if (!Directory.Exists(BugzillaNoteAddin.ImageDirectory))
            {
                return;
            }

            icon_store.Clear();              // clear out the old entries

            string [] icon_files = Directory.GetFiles(BugzillaNoteAddin.ImageDirectory);
            foreach (string icon_file in icon_files)
            {
                FileInfo file_info = new FileInfo(icon_file);

                Gdk.Pixbuf pixbuf = null;
                try {
                    pixbuf = new Gdk.Pixbuf(icon_file);
                } catch (Exception e) {
                    Logger.Warn("Error loading Bugzilla Icon {0}: {1}", icon_file, e.Message);
                }

                if (pixbuf == null)
                {
                    continue;
                }

                string host = ParseHost(file_info);
                if (host != null)
                {
                    Gtk.TreeIter iter = icon_store.Append();
                    icon_store.SetValue(iter, 0, pixbuf);
                    icon_store.SetValue(iter, 1, host);
                    icon_store.SetValue(iter, 2, icon_file);
                }
            }
        }
Exemplo n.º 5
0
        void FillList()
        {
            state.Save();
            tree.Model = null;
            store.Clear();
            string filter            = entryFilter.Text;
            bool   anyPidSet         = false;
            bool   anyDescriptionSet = false;

            foreach (ProcessInfo pi in procs)
            {
                if (pi.Id != 0)
                {
                    anyPidSet = true;
                }
                if (pi.Description != null)
                {
                    anyDescriptionSet = true;
                }
                if (filter.Length == 0 || (pi.Id != 0 && pi.Id.ToString().Contains(filter)) || pi.Name.Contains(filter) || (pi.Description?.Contains(filter) ?? false))
                {
                    store.AppendValues(pi, pi.Id.ToString(), pi.Name, pi.Description);
                }
            }
            tree.Columns [0].Visible = anyPidSet;
            tree.Columns [2].Visible = anyDescriptionSet;
            tree.Model = store;
            state.Load();
            tree.ColumnsAutosize();
            if (tree.Selection.CountSelectedRows() == 0)
            {
                Gtk.TreeIter it;
                if (store.GetIterFirst(out it))
                {
                    tree.Selection.SelectIter(it);
                }
            }
        }
Exemplo n.º 6
0
        public void Load(DCompilerConfiguration config)
        {
            configuration = config;
            //for now, using Executable target compiler command for all targets source compiling
            LinkTargetConfiguration targetConfig;

            targetConfig     = config.GetTargetConfiguration(DCompileTarget.Executable);
            txtCompiler.Text = targetConfig.Compiler;

            //linker targets
            targetConfig             = config.GetTargetConfiguration(DCompileTarget.Executable);
            txtConsoleAppLinker.Text = targetConfig.Linker;

            targetConfig         = config.GetTargetConfiguration(DCompileTarget.ConsolelessExecutable);
            txtGUIAppLinker.Text = targetConfig.Linker;

            targetConfig            = config.GetTargetConfiguration(DCompileTarget.SharedLibrary);
            txtSharedLibLinker.Text = targetConfig.Linker;

            targetConfig            = config.GetTargetConfiguration(DCompileTarget.StaticLibrary);
            txtStaticLibLinker.Text = targetConfig.Linker;

            releaseArgumentsDialog.Load(config, false);
            debugArgumentsDialog.Load(config, true);

            defaultLibStore.Clear();
            foreach (string lib in config.DefaultLibraries)
            {
                defaultLibStore.AppendValues(lib);
            }

            includePathStore.Clear();
            foreach (var p in config.GlobalParseCache.DirectoryPaths)
            {
                includePathStore.AppendValues(p);
            }
        }
Exemplo n.º 7
0
        public override void Populate()
        {
            Trace.Call();

            // sync persons
            var persons = SyncedPersons;

            if (_PersonTreeView != null && persons != null)
            {
                // HACK: out of scope
                string status = String.Format(
                    _("Retrieving user list for {0}..."),
                    SyncedName);
                Frontend.MainWindow.Status = status;

                Gtk.ListStore ls = (Gtk.ListStore)_PersonTreeView.Model;
                // cleanup, be sure the list is empty
                ls.Clear();
                Participants = new List <PersonModel>();
                foreach (var person in persons.Values.OrderBy(x => x))
                {
                    ls.AppendValues(person);
                    Participants.Add(person);
                }

                OnParticipantsChanged(EventArgs.Empty);

                // TRANSLATOR: this string will be appended to the one above
                status += String.Format(" {0}", _("done."));
                Frontend.MainWindow.Status = status;
            }
            SyncedPersons = null;

            Topic = SyncedTopic;

            base.Populate();
        }
Exemplo n.º 8
0
        protected void OnBtnActualizarClicked(object sender, EventArgs e)
        {
            int    _id       = int.Parse(entryID.Text);
            string _nombre   = entryNombre.Text;
            string _marca    = entryMarca.Text;
            string _modelo   = entryModelo.Text;
            string _compania = entryCompania.Text;

            lsDataTel.Clear();
            _id = IndexEnLista(_id);
            op_Telefono o = telefonos[_id];

            o.nombre   = _nombre;
            o.marca    = _marca;
            o.modelo   = _modelo;
            o.compania = _compania;
            RevisarLista();
            Telefono.EliminarDatos();

            foreach (op_Telefono i in telefonos)
            {
                i.InsertarDatos();
            }
        }
Exemplo n.º 9
0
 public override void Destroy()
 {
     store.Clear();
     base.Destroy();
 }
Exemplo n.º 10
0
        protected virtual void OnFindButtonClicked(object sender, System.EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                string nameFilter = f_NameEntry.Text.Trim();
                if (!(Frontend.EngineVersion >= new Version("0.8.1")) &&
                    String.IsNullOrEmpty(nameFilter))
                {
                    Gtk.MessageDialog md = new Gtk.MessageDialog(
                        this,
                        Gtk.DialogFlags.Modal,
                        Gtk.MessageType.Warning,
                        Gtk.ButtonsType.YesNo,
                        _("Searching for group chats without a filter is not " +
                          "recommended.  This may take a while, or may not " +
                          "work at all.\n" +
                          "Do you wish to continue?")
                        );
                    int result = md.Run();
                    md.Destroy();
                    if (result != (int)Gtk.ResponseType.Yes)
                    {
                        return;
                    }
                }

                f_ListStore.Clear();
                CancelFindThread();

                GroupChatModel filter = new GroupChatModel(null, nameFilter, null);
                f_FindThread = new Thread(new ThreadStart(delegate {
                    try {
                        Gtk.Application.Invoke(delegate {
                            GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.Watch);
                        });

                        IList <GroupChatModel> chats = f_ProtocolManager.FindGroupChats(filter);

                        Gtk.Application.Invoke(delegate {
                            Gdk.Color bgColor = f_TreeView.Style.Background(Gtk.StateType.Normal);
                            foreach (GroupChatModel chat in chats)
                            {
                                f_ListStore.AppendValues(
                                    chat,
                                    chat.PersonCount,
                                    chat.Name,
                                    PangoTools.ToMarkup(chat.Topic, bgColor)
                                    );
                            }
                        });
                    } catch (ThreadAbortException) {
#if LOG4NET
                        f_Logger.Debug("FindThread aborted");
#endif
                        Thread.ResetAbort();
                    } catch (Exception ex) {
                        Frontend.ShowError(this, _("Error while fetching the list of group chats from the server."), ex);
                    } finally {
                        Gtk.Application.Invoke(delegate {
                            // if the dialog is gone the GdkWindow might be destroyed already
                            if (GdkWindow != null)
                            {
                                GdkWindow.Cursor = null;
                            }
                        });
                    }
                }));
                f_FindThread.IsBackground = true;
                f_FindThread.Start();
            } catch (Exception ex) {
                Frontend.ShowException(ex);
            }
        }
Exemplo n.º 11
0
        public void Load(CProjectConfiguration config)
        {
            configuration = config;

            switch (configuration.WarningLevel)
            {
            case WarningLevel.None:
                noWarningRadio.Active = true;
                break;

            case WarningLevel.Normal:
                normalWarningRadio.Active = true;
                break;

            case WarningLevel.All:
                allWarningRadio.Active = true;
                break;
            }

            warningsAsErrorsCheckBox.Active = configuration.WarningsAsErrors;

            optimizationSpinButton.Value = configuration.OptimizationLevel;

            switch (configuration.CompileTarget)
            {
            case CBinding.CompileTarget.Bin:
                targetComboBox.Active = 0;
                break;

            case CBinding.CompileTarget.StaticLibrary:
                targetComboBox.Active = 1;
                break;

            case CBinding.CompileTarget.SharedLibrary:
                targetComboBox.Active = 2;
                break;
            }

            extraCompilerTextView.Buffer.Text = configuration.ExtraCompilerArguments;

            extraLinkerTextView.Buffer.Text = configuration.ExtraLinkerArguments;

            defineSymbolsTextEntry.Text = configuration.DefineSymbols;

            libStore.Clear();
            foreach (string lib in configuration.Libs)
            {
                libStore.AppendValues(lib);
            }

            libPathStore.Clear();
            foreach (string libPath in configuration.LibPaths)
            {
                libPathStore.AppendValues(libPath);
            }

            includePathStore.Clear();
            foreach (string includePath in configuration.Includes)
            {
                includePathStore.AppendValues(includePath);
            }
        }
Exemplo n.º 12
0
        public void Load(DProject proj, DProjectConfiguration config)
        {
            project       = proj;
            configuration = config;

            cbUseDefaultCompiler.Active       = proj.UseDefaultCompilerVendor;
            cbIsUnittestConfig.Active         = config.UnittestMode;
            cbPreferOneStepCompilation.Active = proj.PreferOneStepBuild;

            OnUseDefaultCompilerChanged();
            Gtk.TreeIter iter;
            if (cmbCompiler.Model.GetIterFirst(out iter))
            {
                do
                {
                    if (proj.UsedCompilerVendor == cmbCompiler.Model.GetValue(iter, 0) as string)
                    {
                        cmbCompiler.SetActiveIter(iter);
                        break;
                    }
                } while (cmbCompiler.Model.IterNext(ref iter));
            }

            extraCompilerTextView.Buffer.Text = config.ExtraCompilerArguments;
            extraLinkerTextView.Buffer.Text   = config.ExtraLinkerArguments;

            check_LinkThirdPartyLibs.Active = configuration.LinkinThirdPartyLibraries;

            text_BinDirectory.Text     = proj.GetRelativeChildPath(config.OutputDirectory);
            text_TargetFile.Text       = config.Output;
            text_ObjectsDirectory.Text = config.ObjectDirectory;
            text_DDocDir.Text          = config.DDocDirectory;

            if (config.CustomDebugIdentifiers == null)
            {
                text_debugConstants.Text = "";
            }
            else
            {
                text_debugConstants.Text = string.Join(";", config.CustomDebugIdentifiers);
            }
            if (config.CustomVersionIdentifiers == null)
            {
                text_versionConstants.Text = "";
            }
            else
            {
                text_versionConstants.Text = string.Join(";", config.CustomVersionIdentifiers);
            }
            spin_debugLevel.Value = (double)config.DebugLevel;

            // Disable debug-specific fields on non-debug configurations
            text_debugConstants.Sensitive = spin_debugLevel.Sensitive = config.DebugMode;

            if (model_compileTarget.GetIterFirst(out iter))
            {
                do
                {
                    if (config.CompileTarget == (DCompileTarget)model_compileTarget.GetValue(iter, 1))
                    {
                        combo_ProjectType.SetActiveIter(iter);
                        break;
                    }
                } while (model_compileTarget.IterNext(ref iter));
            }

            text_Libraries.Buffer.Text = string.Join("\n", config.ExtraLibraries);

            model_Platforms.Clear();
            var blackListed = new List <string>();

            foreach (var cfg in proj.Configurations)
            {
                if (cfg.Name == config.Name && cfg.Platform != config.Platform)
                {
                    blackListed.Add(cfg.Platform.ToLower());
                }
            }

            var platform_lower = config.Platform.ToLower();

            foreach (var platform in proj.SupportedPlatforms)
            {
                // Skip already taken platforms
                if (blackListed.Contains(platform.ToLower()))
                {
                    continue;
                }

                var it = model_Platforms.Append();
                if (platform_lower == platform.ToLower())
                {
                    combo_Platform.SetActiveIter(it);
                }
                model_Platforms.SetValue(it, 0, platform);
            }
        }
Exemplo n.º 13
0
 internal void Clear()
 {
     store.Clear();
 }
Exemplo n.º 14
0
        public void SetPolicies(PolicyContainer pset)
        {
            if (pset == null)
            {
                store.Clear();
                HasPolicies = false;
                return;
            }

            var content = new Dictionary <string, List <string> > ();

            foreach (var p in pset.DirectGetAll())
            {
                string        name = PolicyService.GetPolicyTypeDescription(p.PolicyType);
                List <string> scopes;
                if (!content.TryGetValue(name, out scopes))
                {
                    scopes = content [name] = new List <string> ();
                }
                scopes.Add(p.Scope ?? "");
            }

            var sorted = content.ToList();

            sorted.Sort((x, y) => x.Key.CompareTo(y.Key));

            store.Clear();

            var sb = StringBuilderCache.Allocate();

            foreach (var pol in sorted)
            {
                sb.Append(pol.Key);
                if (pol.Value.Count != 1 || pol.Value[0].Length != 0)
                {
                    sb.Append(" (");
                    bool first = true;
                    if (pol.Value.Remove(""))
                    {
                        sb.Append(GettextCatalog.GetString("default settings"));
                        first = false;
                    }
                    foreach (var s in pol.Value)
                    {
                        if (!first)
                        {
                            sb.Append(", ");
                        }
                        sb.Append(s);
                        first = false;
                    }
                    sb.Append(")");
                }
                store.AppendValues(sb.ToString());
                sb.Length = 0;
            }
            StringBuilderCache.Free(sb);
            HasPolicies = sorted.Count > 0;
            if (!HasPolicies)
            {
                store.AppendValues(GettextCatalog.GetString("No policies"));
                ShowEmptyItem = true;
            }
            if (store.GetIterFirst(out var iter))
            {
                Selection.SelectIter(iter);
            }
        }
Exemplo n.º 15
0
 public static void Clear()
 {
     mListStore.Clear();
 }
Exemplo n.º 16
0
        public void Load(CProjectConfiguration config)
        {
            configuration = config;

            switch (configuration.CVersion)
            {
            case CVersion.CustomVersionString:
                CVersionComboBox.Active           = 0;
                customVersionStringTextEntry.Text = configuration.CustomVersionString;
                break;

            case CVersion.ISOC:
                CVersionComboBox.Active = 1;
                break;

            case CVersion.C99:
                CVersionComboBox.Active = 2;
                break;

            case CVersion.C11:
                CVersionComboBox.Active = 3;
                break;

            case CVersion.ISOCPP:
                CVersionComboBox.Active = 4;
                break;

            case CVersion.CPP03:
                CVersionComboBox.Active = 5;
                break;

            case CVersion.CPP11:
                CVersionComboBox.Active = 6;
                break;
            }

            switch (configuration.WarningLevel)
            {
            case WarningLevel.None:
                noWarningRadio.Active = true;
                break;

            case WarningLevel.Normal:
                normalWarningRadio.Active = true;
                break;

            case WarningLevel.All:
                allWarningRadio.Active = true;
                break;
            }

            warningsAsErrorsCheckBox.Active = configuration.WarningsAsErrors;

            optimizationSpinButton.Value = configuration.OptimizationLevel;

            switch (configuration.CompileTarget)
            {
            case CompileTarget.Exe:
                targetComboBox.Active = 0;
                break;

            case CompileTarget.Library:
                targetComboBox.Active = 1;
                break;

            case CompileTarget.Module:
                targetComboBox.Active = 2;
                break;
            }

            extraCompilerTextView.Buffer.Text = configuration.ExtraCompilerArguments;

            extraLinkerTextView.Buffer.Text = configuration.ExtraLinkerArguments;

            defineSymbolsTextEntry.Text = configuration.DefineSymbols;

            libStore.Clear();
            foreach (string lib in configuration.Libs)
            {
                libStore.AppendValues(lib);
            }

            libPathStore.Clear();
            foreach (string libPath in configuration.LibPaths)
            {
                libPathStore.AppendValues(libPath);
            }

            includePathStore.Clear();
            foreach (string includePath in configuration.Includes)
            {
                includePathStore.AppendValues(includePath);
            }
        }