Beispiel #1
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();
            align.Add(table);


            // Menu Note Count option
            label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)"));

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

            table.Attach(label, 0, 1, 0, 1);

            menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            // we have a hard limit of 18 set, thus not allowing anything bigger than 18
            menuNoteCountSpinner       = new Gtk.SpinButton(1, 18, 1);
            menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;

            menuNoteCountSpinner.Show();
            table.Attach(menuNoteCountSpinner, 1, 2, 0, 1);

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
Beispiel #2
0
 static void OnShowPreferencesAction(object sender, EventArgs args)
 {
     if (prefs_dlg == null)
     {
         prefs_dlg           = new PreferencesDialog(manager.AddinManager);
         prefs_dlg.Response += OnPreferencesResponse;
     }
     prefs_dlg.Present();
 }
Beispiel #3
0
        protected override void OnActivated()
        {
            base.OnActivated();

            PreferencesDialog pd = new PreferencesDialog(TypPreferences.GlobalSetting, MainClass.Languages.Translate("settings"));
            int result           = pd.Run();

            if (result == (int)ResponseType.Ok)
            {
                MainClass.Settings.SaveSettings();
                MainClass.MainWindow.ReloadSettings(true);
            }
            pd.Destroy();
        }
Beispiel #4
0
        private void Awake()
        {
            ConsoleLog.Initialize();
            TextureManager.Initialize();
            FileReference.Initialize();
            CacheDetails.Initialize();

            // If game directory hasn't been set, Open "Locate Outpost2" dialog to force user to select one
            if (string.IsNullOrEmpty(UserPrefs.gameDirectory))
            {
                PreferencesDialog.Create();
            }

            Debug.Log("Hub initialized.");
        }
Beispiel #5
0
        private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var plugIns = new IUIPlugIn[_registeredFileTypes.Values.Count];

            _registeredFileTypes.Values.CopyTo(plugIns, 0);
            using (var preferencesDialog = new PreferencesDialog()) {
                if (preferencesDialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                _preferences.Reload();
                NotifyAll(Notification.PreferenceChange);
            }
        }
Beispiel #6
0
        void OnPreferences(object sender, EventArgs args)
        {
            PreferencesDialog dialog;

            dialog = new PreferencesDialog(Translations, session.PlayerHistory);
            if ((Gtk.ResponseType)dialog.Run() == ResponseType.Ok)
            {
                session.Difficulty          = (GameDifficulty)Preferences.Get <int> (Preferences.DifficultyKey);
                session.PlayList.ColorBlind = Preferences.Get <bool> (Preferences.ColorBlindKey);

                if (dialog.NewThemeSet == true)
                {
                    drawing_area.ReloadBackground();
                }
            }
            dialog.Destroy();
        }
Beispiel #7
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            /*
             * If you want to add new settings to the Advanced tab - follow the steps below:
             *      1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
             *      2) define property/method for that class that returns the widget you want to place onto the tab;
             *      3) (similar to the below) instantiate object of your class and PackStart its widget to opts_list;
             *      It's expected that the returned widget is already within Gtk.Alignment, so no further alignment done.
             */

            // TODO: More elegant way of implementing this would be to create a collection of "prefs" objects
            // and iterate over them adding them to opts_list (fewer lines to add upon adding new setting).

            // Instantiate class for Menu Min/Max Note Count setting
            MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();

            // Add the widget for this setting to the Advanced tab
            opts_list.PackStart(menuNoteCountPref.Widget, false, false, 0);

            //Instantiate class for Enable Startup Notes setting
            EnableStartupNotesPreference enableStartupNotesPref = new EnableStartupNotesPreference();

            // Add the widget to the Advanced tab
            opts_list.PackStart(enableStartupNotesPref.Widget, false, false, 0);

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
Beispiel #8
0
        public TestMobiusSpotfireApiForm()
        {
            this.InitializeComponent();

            InitialFormSize = Size;

            PreferencesDialog.SetLookAndFeel("Blue");

            MessageSnatcher = new MessageSnatcher(WebBrowserContainerPanel);
            MessageSnatcher.RightMouseClickOccured += BrowserControlRightMouseClickOccured;

            Mobius.ServiceFacade.ServiceFacade.UseRemoteServices = false;
            Mobius.ServiceFacade.UalUtil.Initialize(ServicesIniFile.IniFilePath);

            DataTableMapsMsx.DevMode = true;
            SessionManager.DoFoundationDependencyInjections();

            return;
        }
Beispiel #9
0
        protected override void OnActivated()
        {
            base.OnActivated();

            if (MainClass.Workspace.ActualProject == null)
            {
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, "Please, select project.", "", Gtk.MessageType.Error);
                md.ShowDialog();
                return;
            }

            PreferencesDialog pd = new PreferencesDialog(TypPreferences.ProjectSetting, MainClass.Workspace.ActualProject, MainClass.Workspace.ActualProject.ProjectName);
            int result           = pd.Run();

            if (result == (int)ResponseType.Ok)
            {
                MainClass.Workspace.SaveProject(MainClass.Workspace.ActualProject);
            }
            pd.Destroy();
        }
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Alignment align;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            /*
             * If you want to add new settings to the Advanced tab - follow the steps below:
             *      1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
             *      2) define property/method for that class that returns the widget you want to place onto the tab;
             *      3) (similar to the below) instantiate object of your class and add its widget to the "align" widget;
             */
            // Instantiate class for Menu Min/Max Note Count setting
            MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();

            // Add the widget for this setting to the Advanced tab
            align.Add(menuNoteCountPref.Widget);

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
        private void ModificaPreferenzeClickHandler(object sender, EventArgs e)
        {
            PreferencesDialog dialog = new PreferencesDialog();

            dialog.PreferencesList.DataSource         = ManagerProvider.getManager <KitchenManager>().Ingredients;
            dialog.PreferencesList.AllowColumnReorder = false;
            dialog.PreferencesList.AllowDragDrop      = false;
            dialog.PreferencesList.AllowDrop          = false;
            dialog.PreferencesList.FullRowSelect      = false;
            dialog.PreferencesList.AllowEdit          = false;
            dialog.PreferencesList.AllowRemove        = false;
            dialog.PreferencesList.CheckOnClickMode   = CheckOnClickMode.FirstClick;
            dialog.PreferencesList.HotTracking        = true;


            foreach (Ingredient i in Model.CurrentUser.Preferences)
            {
                dialog.PreferencesList.Items.Where(el => el.DataBoundItem == i).Single().CheckState = Telerik.WinControls.Enumerations.ToggleState.On;
            }
            dialog.PreferencesList.SelectedItem = null;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                List <Ingredient> newPrefs = new List <Ingredient>();
                foreach (ListViewDataItem element in dialog.PreferencesList.CheckedItems)
                {
                    Ingredient i = (Ingredient)element.DataBoundItem;
                    newPrefs.Add(i);
                }
                Model.CurrentUser.Preferences = newPrefs;
                string pref = "";
                if (newPrefs.Any())
                {
                    pref = (from p in newPrefs select p.Name).Aggregate((x, y) => x + ", " + y);
                }
                ProfilePanel.Controls.OfType <Label>().First(c => c.Name == "Preferences").Text = pref;
            }
        }
Beispiel #12
0
        public void ShowPreferences()
        {
            Logger.Info ("OnPreferences called");
            if (preferencesDialog == null) {
                preferencesDialog = new PreferencesDialog (this);
                preferencesDialog.Hidden += OnPreferencesDialogHidden;
            }

            preferencesDialog.Present ();
        }
Beispiel #13
0
 public override void Initialize(PreferencesDialog dialog, object dataObject)
 {
     workspace = dataObject as Workspace.Workspace;
     base.Initialize(dialog, dataObject);
 }
Beispiel #14
0
        ///<summary>Handle edit->preferences command from menu</summary>
        public void OnPreferencesActivated(object o, EventArgs args)
        {
            PreferencesDialog pd = new PreferencesDialog(mainWindow);

            pd.Show();
        }
Beispiel #15
0
        private static bool FinishLoading()
        {
            if (tmpSettings.FirstRun)
            {
                LoggingService.LogDebug("First run");

                // Generate key
                if (tmpSettings.PrivateKey == null)
                {
                    GenerateKeyDialog keyDialog = new GenerateKeyDialog(null);
                    keyDialog.Run();
                    tmpSettings.PrivateKey = keyDialog.Key;
                }

                /* Init the core */
                core = new Core(tmpSettings, getPlatform());

                /* Show change password dialog */
//				var dialog = new ChangeKeyPasswordDialog(splashWindow.Window);
//				dialog.Run();

                splashWindow.Close();

                PreferencesDialog preferences = new PreferencesDialog();
                if (preferences.Run() != (int)ResponseType.Ok)
                {
                    // Abort !!
                    Gtk.Application.Quit();
                    Environment.Exit(1);
                    return(false);
                }
                core.ReloadSettings();
            }
            else
            {
                /* Init the core */
                core = new Core(tmpSettings, getPlatform());
            }

            tmpSettings = null;

            core.AvatarManager = (IAvatarManager) new AvatarManager(core);

            /* Set up UI actions */
            builtin_actions = new BuiltinActionGroup();
            ui_manager      = new UIManager();
            ui_manager.InsertActionGroup(builtin_actions, 0);
            ui_manager.AddUiFromResource("Meshwork.Client.GtkClient.MainWindow.xml");
            ui_manager.AddUiFromResource("Meshwork.Client.GtkClient.TrayPopupMenu.xml");
            ui_manager.AddUiFromResource("Meshwork.Client.GtkClient.SearchPopupMenu.xml");
            ui_manager.AddUiFromResource("Meshwork.Client.GtkClient.MapPopupMenu.xml");

            /* Create the Tray Icon */
            trayIcon = new TrayIcon();

            /* Load the gui */
            Gui.MainWindow = new MainWindow();

            Gdk.Screen screen = Gdk.Screen.Default;

            /*
             * if (Utils.OSName == "Linux") {
             *      Gdk.Colormap colormap = screen.RgbaColormap;
             *      if (colormap != null) {
             *              Widget.DefaultColormap = colormap;
             *              Gtk.Widget.PushColormap(colormap);
             *      }
             * }
             */

            splashWindow.Close();

            if ((!Gui.Settings.StartInTray && options.MainWindowState != "hidden") ||
                (Gui.Settings.StartInTray && (options.MainWindowState == "shown" | options.MainWindowState == "iconified")))
            {
                Gui.MainWindow.Show();
                if (options.MainWindowState == "iconified")
                {
                    Gui.MainWindow.Iconify();
                }
            }

            core.Started += (EventHandler)DispatchService.GuiDispatch(new EventHandler(Core_Started));

            Thread thread = new Thread(delegate() {
                core.Start();
            });

            thread.Start();

            return(false);
        }
Beispiel #16
0
        private void MenuItem_Preferences_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new PreferencesDialog(_preferences);

            dlg.ShowDialog();
        }
Beispiel #17
0
    public void PropertisProject()
    {
        string appname = "";
        int typ = -1;
        Gtk.TreeIter ti = new Gtk.TreeIter();
        WorkspaceTree.GetSelectedFile(out appname, out typ, out ti);

        if (String.IsNullOrEmpty(appname))
            return;
        Project p = MainClass.Workspace.FindProject_byApp(appname, true);

        if (p == null){	return;}

        PreferencesDialog pd = new PreferencesDialog(TypPreferences.ProjectSetting,p,p.ProjectName);
        int result = pd.Run();
        if (result == (int)ResponseType.Ok)
            MainClass.Workspace.SaveProject(p);

        pd.Destroy();
    }
Beispiel #18
0
	protected void OnPreferences_Activated (object sender, System.EventArgs e)
	{
		PreferencesDialog preferencesDialog = new PreferencesDialog();
		preferencesDialog.Response += new Gtk.ResponseHandler(OnPreferencesAction_Response);
		
		preferencesDialog.TransientFor = this;
		
		preferencesDialog.Show();
	}
Beispiel #19
0
 static void OnShowPreferencesAction(object sender, EventArgs args)
 {
     prefs_dlg = new PreferencesDialog(manager);
     prefs_dlg.ShowAll();
 }
Beispiel #20
0
 /// <summary>
 /// Returns a Gtk.Widget to place in a new tab in Tomboy's
 /// preferences dialog.
 /// <param name="parent">The preferences dialog.  Add-ins should
 /// use this for connecting to Hidden or other events as needed.
 /// Another use would be to pop open dialogs, so they can properly
 /// set their parent.
 /// </param>
 /// <param name="tabLabel">The string to be used in the tab's
 /// label.</param>
 /// <param name="preferenceWidget">The Gtk.Widget to use as the
 /// content of the tab page.</param>
 /// <returns>Returns <value>true</value> if the widget is
 /// valid/created or <value>false</value> otherwise.</returns>
 /// </summary>
 public abstract bool GetPreferenceTabWidget(
     PreferencesDialog parent,
     out string tabLabel,
     out Gtk.Widget preferenceWidget);
Beispiel #21
0
    public void PropertisDirectory()
    {
        string file = "";
        string appfile = "";
        int typ = -1;
        Gtk.TreeIter ti = new Gtk.TreeIter();
        WorkspaceTree.GetSelectedFile(out file, out typ, out ti);

        if (String.IsNullOrEmpty(file)) return;

        appfile = WorkspaceTree.GetSelectedProjectApp();

        Project p = MainClass.Workspace.FindProject_byApp(appfile, true);
        if (p == null)
            return;

        FilePropertisData fpd = new FilePropertisData();
        fpd.Filename = MainClass.Workspace.GetRelativePath(file);
        fpd.Project = p;

        PreferencesDialog pd = new PreferencesDialog(TypPreferences.DirectorySetting,fpd,fpd.Filename);
        int result = pd.Run();
        if (result == (int)ResponseType.Ok)
            MainClass.Workspace.SaveProject(p);

        pd.Destroy();
    }
Beispiel #22
0
        private void Preferences_Activated(object sender, EventArgs args)
        {
            PreferencesDialog dialog = new PreferencesDialog();

            dialog.Run();
        }
Beispiel #23
0
 public override void Initialize(PreferencesDialog dialog, object dataObject)
 {
     workspace = dataObject as Workspace.Workspace;
     base.Initialize(dialog, dataObject);
 }
Beispiel #24
0
        private static bool FinishLoading()
        {
            Core.Started += (EventHandler)DispatchService.GuiDispatch(new EventHandler(Core_Started));

            if (tmpSettings.FirstRun)
            {
                Core.LoggingService.LogDebug("First run");

                // Generate key
                if (!tmpSettings.HasKey)
                {
                    GenerateKeyDialog keyDialog = new GenerateKeyDialog(null);
                    keyDialog.Run();
                    tmpSettings.SetKey(keyDialog.Key);
                }

                /* Init the core */
                if (!Core.Init(tmpSettings))
                {
                    throw new Exception("Core failed to init on first run!");
                }

                /* Show change password dialog */
                var dialog = new ChangeKeyPasswordDialog(splashWindow.Window);
                dialog.Run();

                splashWindow.Close();

                PreferencesDialog preferences = new PreferencesDialog();
                if (preferences.Run() != (int)ResponseType.Ok)
                {
                    // Abort !!
                    Gtk.Application.Quit();
                    Environment.Exit(1);
                    return(false);
                }
                Core.ReloadSettings();
            }
            else
            {
                /* Init the core */

                Core.PasswordPrompt += delegate {
                    var dialog = new FileFind.Meshwork.GtkClient.Windows.UnlockKeyDialog(splashWindow.Window);
                    dialog.Run();
                };

                bool didInit = Core.Init(tmpSettings);
                if (!didInit)
                {
                    // Right now this means the password dialog was aborted, or already running.
                    Gtk.Application.Quit();
                    Environment.Exit(1);
                    return(false);
                }
            }

            tmpSettings = null;

            Core.AvatarManager = (IAvatarManager) new AvatarManager();

            /* Load the gui */
            Gui.MainWindow = new MainWindow();

            Gdk.Screen screen = Gdk.Screen.Default;

            /*
             * if (Common.OSName == "Linux") {
             *      Gdk.Colormap colormap = screen.RgbaColormap;
             *      if (colormap != null) {
             *              Widget.DefaultColormap = colormap;
             *              Gtk.Widget.PushColormap(colormap);
             *      }
             * }
             */

            splashWindow.Close();

            if ((!Gui.Settings.StartInTray && options.MainWindowState != "hidden") ||
                (Gui.Settings.StartInTray && (options.MainWindowState == "shown" | options.MainWindowState == "iconified")))
            {
                Gui.MainWindow.Show();
                if (options.MainWindowState == "iconified")
                {
                    Gui.MainWindow.Iconify();
                }
            }

            Thread thread = new Thread(delegate() {
                Core.Start();
            });

            thread.Start();

            return(false);
        }
Beispiel #25
0
 static void OnPreferencesResponse(object sender, Gtk.ResponseArgs args)
 {
     ((Gtk.Widget)sender).Destroy();
     prefs_dlg = null;
 }
Beispiel #26
0
 void OnPreferencesDialogHidden(object sender, EventArgs args)
 {
     preferencesDialog.Destroy ();
     preferencesDialog.Hidden -= OnPreferencesDialogHidden;
     preferencesDialog = null;
 }
Beispiel #27
0
 public void OnClick_Preferences()
 {
     PreferencesDialog.Create();
 }
Beispiel #28
0
    public void PropertisFile()
    {
        string file = "";
        string appfile = "";
        int typ = -1;
        Gtk.TreeIter ti = new Gtk.TreeIter();
        WorkspaceTree.GetSelectedFile(out file, out typ, out ti);

        if (String.IsNullOrEmpty(file))
            return;

        appfile = WorkspaceTree.GetSelectedProjectApp();

        Project p = MainClass.Workspace.FindProject_byApp(appfile, true);
        if (p == null)
            return;

        FilePropertisData fpd = new FilePropertisData();
        fpd.Filename = MainClass.Workspace.GetRelativePath(file);
        fpd.Project = p;

        PreferencesDialog pd = new PreferencesDialog(TypPreferences.FileSetting,fpd,fpd.Filename);
        int result = pd.Run();
        if (result == (int)ResponseType.Ok) {
            MainClass.Workspace.SaveProject(p);

            FileItem fi = p.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);

            if (fi != null) {
                TypeFile newTyp = TypeFile.SourceFile;

                if (fi.IsExcluded)
                    newTyp = TypeFile.ExcludetFile;
                else
                    newTyp = TypeFile.SourceFile;

                MainClass.MainWindow.WorkspaceTree.UpdateIter(ti, String.Empty, String.Empty, (int)newTyp);
            }

        }
        pd.Destroy();
    }