// Setup colors
        public override void SetupColors(ColorPalette c)
        {
            base.SetupColors(c);

            searchtext.BackColor = General.Colors[ColorIndex.ControlNormal];
            searchtext.ForeColor = General.Colors[ColorIndex.ControlNormalText];
        }
        // Setup colors
        public override void SetupColors(ColorPalette c)
        {
            base.SetupColors(c);

            itemname.BackColor = General.Colors[ColorIndex.ControlNormal];
            itemname.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            itemcount.BackColor = General.Colors[ColorIndex.ControlNormal];
            itemcount.ForeColor = General.Colors[ColorIndex.ControlNormalText];
        }
Exemplo n.º 3
0
        // Setup colors
        public virtual void SetupColors(ColorPalette c)
        {
            this.BackColor = c[backcolor];
            this.ForeColor = c[ColorIndex.WindowText];

            // Setup colors on child controls
            foreach(Control cc in base.Controls)
            {
                if(cc is IColorable)
                    (cc as IColorable).SetupColors(c);
            }
        }
 // Setup colors
 public override void SetupColors(ColorPalette c)
 {
     base.SetupColors(c);
 }
Exemplo n.º 5
0
		public static void Main()
		{
			// Enable visual styles
			//Application.EnableVisualStyles();
			//Application.DoEvents();		// This must be here to work around a .NET bug
			Application.SetCompatibleTextRenderingDefault(true);
			
			// Set current thread name
			Thread.CurrentThread.Name = "Main Application";
			
			// Application is running
			appmutex = new Mutex(false, "gluon");
			apprunning = true;
			
			// Get a reference to this assembly
			thisasm = Assembly.GetExecutingAssembly();
			Version thisversion = thisasm.GetName().Version;
			
			// Find paths
			Uri localpath = new Uri(Path.GetDirectoryName(thisasm.GetName().CodeBase));
			apppath = Uri.UnescapeDataString(localpath.AbsolutePath);
			temppath = Path.GetTempPath();
			settingspath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Gluon");
			logfile = Path.Combine(settingspath, "Log.txt");
			
			// Make program settings directory if missing
			if(!Directory.Exists(settingspath)) Directory.CreateDirectory(settingspath);
			
			// Remove the previous log file and start logging
			//if(File.Exists(logfile)) File.Delete(logfile);
			General.WriteLogLine("===============================================================================================");
			General.WriteLogLine("Gluon " + thisversion.Major + "." + thisversion.Minor + "." + thisversion.Build + "." + thisversion.Revision + " startup.");
			
			#if HIGH_PRIORITY_PROCESS
				Process thisproc = Process.GetCurrentProcess();
				thisproc.PriorityClass = ProcessPriorityClass.AboveNormal;
			#endif
			Thread thisthread = Thread.CurrentThread;
			thisthread.Priority = ThreadPriority.Highest;

			// Load settings
			settings = new SettingsManager();
			
			#if DEBUG
				if(!settings.LiveEnvironment)
					accessenabled = true;
			#endif

			// Make me a clock
			clock = new Clock();
			
			// Make the power managment
			power = new PowerManager();
			
			// Load sounds
			sounds = new SoundsManager();
			sounds.LoadSounds();

			// If audio is not set to primary device, we must make it so and restart Gluon
			if(!sounds.CheckAudioOutputPrimary())
			{
				sounds.SetAudioOutputPrimary();
				
				// Restart Gluon
				ProcessStartInfo proc = new ProcessStartInfo();
				proc.ErrorDialog = false;
				proc.FileName = Path.Combine(General.AppPath, "Gluon.exe");
				proc.LoadUserProfile = true;
				//proc.UserName = "******";
				proc.UseShellExecute = false;
				proc.WorkingDirectory = General.AppPath;
				Process.Start(proc);
				return;
			}
			
			// Load color palette
			colors = new ColorPalette();
			
			// Load interface images
			images = new InterfaceImageProvider();
			
			// Build images for all color schemes
			colors.SetupDarkScheme();
			images.BuildImages();
			colors.SetupNormalScheme();
			images.BuildImages();

			// Managers
			remote = new RemoteManager();
			display = new DisplayManager();
			pcap = new PCapManager();
			obex = new ObexManager();
			agenda = new AgendaManager();
			notes = new NotesManager();
			groceries = new GroceriesManager();
			db = new DatabaseManager();

			// Load main window
			mainwindow = new MainForm();
			mainwindow.ShowTaggedPanel("loading");
			
			// See LoadingDisplaypanel::Load() for connect/setup stuff
			
			#if CATCH_EXCEPTIONS
					
				// Add exception handlers
				AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
				Application.ThreadException += Application_ThreadException;
			
			#endif
			
			bool failed;
			
			do
			{
				failed = false;
				
				#if CATCH_EXCEPTIONS
				
				try
				{
				
				#endif
					
					// Show main window
					Application.Run(mainwindow);
					
				#if CATCH_EXCEPTIONS
				
				}
				catch(Exception e)
				{
					Application.ExitThread();
					failed = true;
					mainwindow = new MainForm();
					General.ErrorMessage = e.GetType().Name + ": " + e.Message + "\r\n" + e.StackTrace;
					General.WriteLogLine(General.ErrorMessage);
					mainwindow.ShowTaggedPanel("error");
				}
				
				#endif
			}
			while(failed);

			// Clean stuff up
			sounds.SetAudioOutputPrimary();
			display.Dispose();
			obex.Dispose();
			pcap.Dispose();
			db.Dispose();
			remote.Dispose();
		}
Exemplo n.º 6
0
 // Setup colors
 public override void SetupColors(ColorPalette c)
 {
     base.SetupColors(c);
 }
Exemplo n.º 7
0
        // Setup colors
        public override void SetupColors(ColorPalette c)
        {
            base.SetupColors(c);

            // Do we still need this here? These controls are DisplayTextboxes and should be able to set their own colors.
            description.BackColor = General.Colors[ColorIndex.ControlNormal];
            description.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            startday.BackColor = General.Colors[ColorIndex.ControlNormal];
            startday.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            startmonth.BackColor = General.Colors[ColorIndex.ControlNormal];
            startmonth.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            startyear.BackColor = General.Colors[ColorIndex.ControlNormal];
            startyear.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            starthour.BackColor = General.Colors[ColorIndex.ControlNormal];
            starthour.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            startminute.BackColor = General.Colors[ColorIndex.ControlNormal];
            startminute.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            durdays.BackColor = General.Colors[ColorIndex.ControlNormal];
            durdays.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            durhours.BackColor = General.Colors[ColorIndex.ControlNormal];
            durhours.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            durminutes.BackColor = General.Colors[ColorIndex.ControlNormal];
            durminutes.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            endday.BackColor = General.Colors[ColorIndex.ControlNormal];
            endday.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            endmonth.BackColor = General.Colors[ColorIndex.ControlNormal];
            endmonth.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            endyear.BackColor = General.Colors[ColorIndex.ControlNormal];
            endyear.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            endhour.BackColor = General.Colors[ColorIndex.ControlNormal];
            endhour.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            endminute.BackColor = General.Colors[ColorIndex.ControlNormal];
            endminute.ForeColor = General.Colors[ColorIndex.ControlNormalText];
            alarmminutes.BackColor = General.Colors[ColorIndex.ControlNormal];
            alarmminutes.ForeColor = General.Colors[ColorIndex.ControlNormalText];
        }
Exemplo n.º 8
0
        public static void Main()
        {
            // Enable visual styles
            //Application.EnableVisualStyles();
            //Application.DoEvents();		// This must be here to work around a .NET bug
            Application.SetCompatibleTextRenderingDefault(true);

            // Set current thread name
            Thread.CurrentThread.Name = "Main Application";

            // Application is running
            appmutex   = new Mutex(false, "gluon");
            apprunning = true;

            // Get a reference to this assembly
            thisasm = Assembly.GetExecutingAssembly();
            Version thisversion = thisasm.GetName().Version;

            // Find paths
            Uri localpath = new Uri(Path.GetDirectoryName(thisasm.GetName().CodeBase));

            apppath      = Uri.UnescapeDataString(localpath.AbsolutePath);
            temppath     = Path.GetTempPath();
            settingspath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Gluon");
            logfile      = Path.Combine(settingspath, "Log.txt");

            // Make program settings directory if missing
            if (!Directory.Exists(settingspath))
            {
                Directory.CreateDirectory(settingspath);
            }

            // Remove the previous log file and start logging
            //if(File.Exists(logfile)) File.Delete(logfile);
            General.WriteLogLine("===============================================================================================");
            General.WriteLogLine("Gluon " + thisversion.Major + "." + thisversion.Minor + "." + thisversion.Build + "." + thisversion.Revision + " startup.");

                        #if HIGH_PRIORITY_PROCESS
            Process thisproc = Process.GetCurrentProcess();
            thisproc.PriorityClass = ProcessPriorityClass.AboveNormal;
                        #endif
            Thread thisthread = Thread.CurrentThread;
            thisthread.Priority = ThreadPriority.Highest;

            // Load settings
            settings = new SettingsManager();

                        #if DEBUG
            if (!settings.LiveEnvironment)
            {
                accessenabled = true;
            }
                        #endif

            // Make me a clock
            clock = new Clock();

            // Make the power managment
            power = new PowerManager();

            // Load sounds
            sounds = new SoundsManager();
            sounds.LoadSounds();

            // If audio is not set to primary device, we must make it so and restart Gluon
            if (!sounds.CheckAudioOutputPrimary())
            {
                sounds.SetAudioOutputPrimary();

                // Restart Gluon
                ProcessStartInfo proc = new ProcessStartInfo();
                proc.ErrorDialog     = false;
                proc.FileName        = Path.Combine(General.AppPath, "Gluon.exe");
                proc.LoadUserProfile = true;
                //proc.UserName = "******";
                proc.UseShellExecute  = false;
                proc.WorkingDirectory = General.AppPath;
                Process.Start(proc);
                return;
            }

            // Load color palette
            colors = new ColorPalette();

            // Load interface images
            images = new InterfaceImageProvider();

            // Build images for all color schemes
            colors.SetupDarkScheme();
            images.BuildImages();
            colors.SetupNormalScheme();
            images.BuildImages();

            // Managers
            remote    = new RemoteManager();
            display   = new DisplayManager();
            pcap      = new PCapManager();
            obex      = new ObexManager();
            agenda    = new AgendaManager();
            notes     = new NotesManager();
            groceries = new GroceriesManager();
            db        = new DatabaseManager();

            // Load main window
            mainwindow = new MainForm();
            mainwindow.ShowTaggedPanel("loading");

            // See LoadingDisplaypanel::Load() for connect/setup stuff

                        #if CATCH_EXCEPTIONS
            // Add exception handlers
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Application.ThreadException += Application_ThreadException;
                        #endif

            bool failed;

            do
            {
                failed = false;

                                #if CATCH_EXCEPTIONS
                try
                {
                                #endif

                // Show main window
                Application.Run(mainwindow);

                                #if CATCH_EXCEPTIONS
            }
            catch (Exception e)
            {
                Application.ExitThread();
                failed               = true;
                mainwindow           = new MainForm();
                General.ErrorMessage = e.GetType().Name + ": " + e.Message + "\r\n" + e.StackTrace;
                General.WriteLogLine(General.ErrorMessage);
                mainwindow.ShowTaggedPanel("error");
            }
                                #endif
            }while(failed);

            // Clean stuff up
            sounds.SetAudioOutputPrimary();
            display.Dispose();
            obex.Dispose();
            pcap.Dispose();
            db.Dispose();
            remote.Dispose();
        }
Exemplo n.º 9
0
        // This must set up all the colors
        // Also call this function on child controls
        public void SetupColors(ColorPalette c)
        {
            General.LockWindowUpdate(this.Handle);

            this.BackColor = c[ColorIndex.WindowBackground];

            // Setup colors on child controls
            foreach(Control cc in base.Controls)
            {
                if(cc is IColorable)
                    (cc as IColorable).SetupColors(c);
            }

            General.LockWindowUpdate(IntPtr.Zero);
        }
Exemplo n.º 10
0
        // Setup colors
        public override void SetupColors(ColorPalette c)
        {
            base.SetupColors(c);

            addressbox.BackColor = General.Colors[ColorIndex.ControlNormal];
            addressbox.ForeColor = General.Colors[ColorIndex.ControlNormalText];
        }
Exemplo n.º 11
0
 // Setup colors locally only
 private void SetupColorsLocal(ColorPalette c)
 {
     // Disabled?
     if(!localenabled)
     {
         // Disabled color
         this.BackColor = c[ColorIndex.ControlDisabled];
         this.ForeColor = c[ColorIndex.ControlDisabledText];
     }
     // Info color?
     else if(!flashwarning && flashinfo)
     {
         if(General.MainWindow.InfoFlashState ^ inverseflash)
         {
             this.BackColor = c[ColorIndex.InfoLight];
             this.ForeColor = c[ColorIndex.InfoLightText];
         }
         else
         {
             this.BackColor = c[ColorIndex.InfoDark];
             this.ForeColor = c[ColorIndex.InfoDarkText];
         }
     }
     // Warning color?
     else if(flashwarning)
     {
         if(General.MainWindow.WarningFlashState ^ inverseflash)
         {
             this.BackColor = c[ColorIndex.WarningLight];
             this.ForeColor = c[ColorIndex.WarningLightText];
         }
         else
         {
             this.BackColor = c[ColorIndex.WarningDark];
             this.ForeColor = c[ColorIndex.WarningDarkText];
         }
     }
     else
     {
         // Normal color
         this.BackColor = c[normalcolor];
         this.ForeColor = c[textcolor];
     }
 }
Exemplo n.º 12
0
        // Setup colors
        public virtual void SetupColors(ColorPalette c)
        {
            SetupColorsLocal(c);

            // Setup colors on child controls
            foreach(Control cc in base.Controls)
            {
                if(cc is IColorable)
                    (cc as IColorable).SetupColors(c);
            }
        }