Exemplo n.º 1
0
        void IExtensionService.Initialize()
        {
            Log.Debug("Initializing Alarm Plugin");

            AlarmClockService.alarm_service = this;
            ThreadStart alarmThreadStart = new ThreadStart(AlarmClockService.DoWait);

            alarm_thread = new Thread(alarmThreadStart);
            alarm_thread.Start();

            action_service = ServiceManager.Get <InterfaceActionService> ();

            actions = new ActionGroup("AlarmClock");

            actions.Add(new ActionEntry [] {
                new ActionEntry("AlarmClockAction", null,
                                AddinManager.CurrentLocalizer.GetString("Alarm Clock"), null,
                                null, null),

                new ActionEntry("SetSleepTimerAction", null,
                                AddinManager.CurrentLocalizer.GetString("Sleep Timer..."), null,
                                AddinManager.CurrentLocalizer.GetString("Set the sleep timer value"), OnSetSleepTimer),

                new ActionEntry("SetAlarmAction", null,
                                AddinManager.CurrentLocalizer.GetString("Alarm..."), null,
                                AddinManager.CurrentLocalizer.GetString("Set the alarm time"), OnSetAlarm),

                new ActionEntry("AlarmClockConfigureAction", Stock.Properties,
                                AddinManager.CurrentLocalizer.GetString("_Configure..."), null,
                                AddinManager.CurrentLocalizer.GetString("Configure the Alarm Clock plugin"), OnConfigure)
            });

            action_service.UIManager.InsertActionGroup(actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource("AlarmMenu.xml");
        }
        public AlarmConfigDialog(AlarmClockService service) : base(AddinManager.CurrentLocalizer.GetString("Alarm Time"))
        {
            this.service = service;

            WidthRequest  = 250;
            HeightRequest = 150;

            BuildWidget();
            ShowAll();
        }
Exemplo n.º 3
0
        public SleepTimerConfigDialog (AlarmClockService service) : base (AddinManager.CurrentLocalizer.GetString ("Sleep Timer"))
        {
            this.service = service;

            WidthRequest = 250;
            HeightRequest = 150;

            BuildWidget ();
            ShowAll ();
        }
        public AlarmConfigDialog(AlarmClockService plugin) : base()
        {
            this.plugin = plugin;

            Title         = "Alarm";
            WidthRequest  = 250;
            HeightRequest = 150;

            BuildWidget();
            ShowAll();
        }
        public AlarmConfigDialog(AlarmClockService plugin)
            : base()
        {
            this.plugin = plugin;

            Title = "Alarm";
            WidthRequest = 250;
            HeightRequest = 150;

            BuildWidget ();
            ShowAll ();
        }
Exemplo n.º 6
0
        public SleepTimerConfigDialog(AlarmClockService plugin) : base()
        {
            this.plugin = plugin;

            Title         = Catalog.GetString("Sleep Timer");
            WidthRequest  = 250;
            HeightRequest = 150;
            VBox.Spacing  = 10;

            BuildWidget();
            ShowAll();
        }
        public SleepTimerConfigDialog(AlarmClockService plugin)
            : base()
        {
            this.plugin = plugin;

            Title = Catalog.GetString ("Sleep Timer");
            WidthRequest = 250;
            HeightRequest = 150;
            VBox.Spacing = 10;

            BuildWidget ();
            ShowAll ();
        }
Exemplo n.º 8
0
        public ConfigurationDialog(AlarmClockService plugin) : base()
        {
            this.plugin = plugin;

            Title        = Catalog.GetString("Alarm Clock configuration");
            HasSeparator = false;
            BorderWidth  = 5;

            fade_start               = new VScale(0, 100, 1);
            fade_start.Inverted      = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end                 = new VScale(0, 100, 1);
            fade_end.Inverted        = true;
            fade_end.HeightRequest   = volumeSliderHeight;
            fade_duration            = new SpinButton(0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox();

            VBox fade_start_box = new VBox();

            fade_start_box.PackEnd(new Label(Catalog.GetString("Start")));
            fade_start_box.PackStart(fade_start, false, false, 3);

            VBox fade_end_box = new VBox();

            fade_end_box.PackEnd(new Label(Catalog.GetString("End")));
            fade_end_box.PackStart(fade_end, false, false, 3);

            HBox fade_box_group = new HBox();

            fade_box_group.PackStart(fade_start_box);
            fade_box_group.PackStart(fade_end_box);

            Label volume_label = new Label(Catalog.GetString("<b>Volume</b>"));

            volume_label.UseMarkup = true;
            fade_big_box.PackStart(volume_label, false, true, 3);
            fade_big_box.PackStart(fade_box_group);
            Label duration_label         = new Label(Catalog.GetString("Duration:"));
            Label duration_seconds_label = new Label(Catalog.GetString(" <i>(seconds)</i>"));

            duration_label.UseMarkup         = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox();

            duration_box.PackStart(duration_label, false, false, 3);
            duration_box.PackStart(fade_duration, false, false, 3);
            duration_box.PackStart(duration_seconds_label, false, true, 3);
            fade_big_box.PackStart(duration_box);

            Frame alarm_fade_frame = new Frame(Catalog.GetString("Fade-In Adjustment"));

            alarm_fade_frame.Add(fade_big_box);
            alarm_fade_frame.ShowAll();

            HBox command_box = new HBox();

            command_box.PackStart(new Label(Catalog.GetString("Command:")), false, false, 3);
            command_entry = new Entry();
            command_box.PackStart(command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame(Catalog.GetString("Command To Execute:"));

            alarm_misc_frame.Add(command_box);
            alarm_misc_frame.ShowAll();

            VBox.PackStart(alarm_fade_frame, false, false, 3);
            VBox.PackStart(alarm_misc_frame, false, false, 3);

            AddButton(Stock.Close, ResponseType.Close);

            // initialize values
            command_entry.Text  = plugin.AlarmCommand;
            fade_start.Value    = plugin.FadeStartVolume;
            fade_end.Value      = plugin.FadeEndVolume;
            fade_duration.Value = plugin.FadeDuration;

            // attach change handlers
            command_entry.Changed      += new EventHandler(AlarmCommand_Changed);
            fade_start.ValueChanged    += new EventHandler(FadeStartVolume_Changed);
            fade_end.ValueChanged      += new EventHandler(FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler(FadeDuration_Changed);
        }
Exemplo n.º 9
0
 public AlarmThread(AlarmClockService plugin)
 {
     this.plugin = plugin;
 }
        void IExtensionService.Initialize()
        {
            Log.Debug("Initializing Alarm Plugin");

            AlarmClockService.alarm_service = this;
            ThreadStart alarmThreadStart = new ThreadStart (AlarmClockService.DoWait);
            alarm_thread = new Thread (alarmThreadStart);
            alarm_thread.Start ();

            action_service = ServiceManager.Get<InterfaceActionService> ("InterfaceActionService");

            actions = new ActionGroup ("AlarmClock");

            actions.Add (new ActionEntry [] {
                new ActionEntry ("AlarmClockAction", null,
                    Catalog.GetString ("Alarm Clock"), null,
                    null, null),

                new ActionEntry ("SetSleepTimerAction", null,
                    Catalog.GetString ("Sleep Timer..."), null,
                    Catalog.GetString ("Set the sleep timer value"), OnSetSleepTimer),

                new ActionEntry ("SetAlarmAction", null,
                    Catalog.GetString ("Alarm..."), null,
                    Catalog.GetString ("Set the alarm time"), OnSetAlarm),

                new ActionEntry ("AlarmClockConfigureAction", Stock.Properties,
                    Catalog.GetString ("_Configure..."), null,
                    Catalog.GetString ("Configure the Alarm Clock plugin"), OnConfigure)
            });

            action_service.UIManager.InsertActionGroup (actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource ("AlarmMenu.xml");
        }
        public ConfigurationDialog(AlarmClockService plugin)
            : base()
        {
            this.plugin = plugin;

            Title = Catalog.GetString ("Alarm Clock configuration");
            HasSeparator = false;
            BorderWidth = 5;

            fade_start = new VScale (0, 100, 1);
            fade_start.Inverted = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end = new VScale (0, 100, 1);
            fade_end.Inverted = true;
            fade_end.HeightRequest = volumeSliderHeight;
            fade_duration = new SpinButton (0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox ();

            VBox fade_start_box = new VBox ();
            fade_start_box.PackEnd (new Label (Catalog.GetString ("Start")));
            fade_start_box.PackStart (fade_start, false, false, 3);

            VBox fade_end_box = new VBox ();
            fade_end_box.PackEnd (new Label (Catalog.GetString ("End")));
            fade_end_box.PackStart (fade_end, false, false, 3);

            HBox fade_box_group = new HBox ();
            fade_box_group.PackStart (fade_start_box);
            fade_box_group.PackStart (fade_end_box);

            Label volume_label = new Label (Catalog.GetString ("<b>Volume</b>"));
            volume_label.UseMarkup = true;
            fade_big_box.PackStart (volume_label, false, true, 3);
            fade_big_box.PackStart (fade_box_group);
            Label duration_label = new Label (Catalog.GetString ("Duration:"));
            Label duration_seconds_label = new Label (Catalog.GetString (" <i>(seconds)</i>"));
            duration_label.UseMarkup = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox ();
            duration_box.PackStart (duration_label, false, false, 3);
            duration_box.PackStart (fade_duration, false, false, 3);
            duration_box.PackStart (duration_seconds_label, false, true, 3);
            fade_big_box.PackStart (duration_box);

            Frame alarm_fade_frame = new Frame (Catalog.GetString ("Fade-In Adjustment"));
            alarm_fade_frame.Add (fade_big_box);
            alarm_fade_frame.ShowAll ();

            HBox command_box = new HBox ();
            command_box.PackStart (new Label (Catalog.GetString ("Command:")), false, false, 3);
            command_entry = new Entry ();
            command_box.PackStart (command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame (Catalog.GetString ("Command To Execute:"));
            alarm_misc_frame.Add (command_box);
            alarm_misc_frame.ShowAll ();

            VBox.PackStart (alarm_fade_frame, false, false, 3);
            VBox.PackStart (alarm_misc_frame, false, false, 3);

            AddButton (Stock.Close, ResponseType.Close);

            // initialize values
            command_entry.Text = plugin.AlarmCommand;
            fade_start.Value = plugin.FadeStartVolume;
            fade_end.Value = plugin.FadeEndVolume;
            fade_duration.Value = plugin.FadeDuration;

            // attach change handlers
            command_entry.Changed += new EventHandler (AlarmCommand_Changed);
            fade_start.ValueChanged += new EventHandler (FadeStartVolume_Changed);
            fade_end.ValueChanged += new EventHandler (FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler (FadeDuration_Changed);
        }
        public ConfigurationDialog(AlarmClockService service)
            : base(AddinManager.CurrentLocalizer.GetString ("Alarm Clock configuration"))
        {
            this.service = service;

            fade_start = new VScale (0, 100, 1);
            fade_start.Inverted = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end = new VScale (0, 100, 1);
            fade_end.Inverted = true;
            fade_end.HeightRequest = volumeSliderHeight;
            fade_duration = new SpinButton (0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox ();

            VBox fade_start_box = new VBox ();
            fade_start_box.PackEnd (new Label (AddinManager.CurrentLocalizer.GetString ("Start")), true, true, 2);
            fade_start_box.PackStart (fade_start, false, false, 3);

            VBox fade_end_box = new VBox ();
            fade_end_box.PackEnd (new Label (AddinManager.CurrentLocalizer.GetString ("End")), true, true, 2);
            fade_end_box.PackStart (fade_end, false, false, 3);

            HBox fade_box_group = new HBox ();
            fade_box_group.PackStart (fade_start_box, true, true, 2);
            fade_box_group.PackStart (fade_end_box, true, true, 2);

            Label volume_label = new Label (AddinManager.CurrentLocalizer.GetString ("<b>Volume</b>"));
            volume_label.UseMarkup = true;
            fade_big_box.PackStart (volume_label, false, true, 3);
            fade_big_box.PackStart (fade_box_group, true, true, 2);
            Label duration_label = new Label (AddinManager.CurrentLocalizer.GetString ("Duration:"));
            Label duration_seconds_label = new Label (AddinManager.CurrentLocalizer.GetString (" <i>(seconds)</i>"));
            duration_label.UseMarkup = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox ();
            duration_box.PackStart (duration_label, false, false, 3);
            duration_box.PackStart (fade_duration, false, false, 3);
            duration_box.PackStart (duration_seconds_label, false, true, 3);
            fade_big_box.PackStart (duration_box, true, true, 2);

            Frame alarm_fade_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("Fade-In Adjustment"));
            alarm_fade_frame.Add (fade_big_box);
            alarm_fade_frame.ShowAll ();

            HBox command_box = new HBox ();
            command_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Command:")), false, false, 3);
            command_entry = new Entry ();
            command_box.PackStart (command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("Command To Execute:"));
            alarm_misc_frame.Add (command_box);
            alarm_misc_frame.ShowAll ();

            VBox.PackStart (alarm_fade_frame, false, false, 3);
            VBox.PackStart (alarm_misc_frame, false, false, 3);

            AddDefaultCloseButton ();

            // initialize values
            command_entry.Text = service.AlarmCommand;
            fade_start.Value = service.FadeStartVolume;
            fade_end.Value = service.FadeEndVolume;
            fade_duration.Value = service.FadeDuration;

            // attach change handlers
            command_entry.Changed += new EventHandler (AlarmCommand_Changed);
            fade_start.ValueChanged += new EventHandler (FadeStartVolume_Changed);
            fade_end.ValueChanged += new EventHandler (FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler (FadeDuration_Changed);
        }
Exemplo n.º 13
0
 public AlarmThread(AlarmClockService service)
 {
     this.service = service;
 }
Exemplo n.º 14
0
 public AlarmThread(AlarmClockService plugin)
 {
     this.plugin = plugin;
 }
        public ConfigurationDialog(AlarmClockService service) : base(AddinManager.CurrentLocalizer.GetString("Alarm Clock configuration"))
        {
            this.service = service;

            fade_start               = new VScale(0, 100, 1);
            fade_start.Inverted      = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end                 = new VScale(0, 100, 1);
            fade_end.Inverted        = true;
            fade_end.HeightRequest   = volumeSliderHeight;
            fade_duration            = new SpinButton(0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox();

            VBox fade_start_box = new VBox();

            fade_start_box.PackEnd(new Label(AddinManager.CurrentLocalizer.GetString("Start")), true, true, 2);
            fade_start_box.PackStart(fade_start, false, false, 3);

            VBox fade_end_box = new VBox();

            fade_end_box.PackEnd(new Label(AddinManager.CurrentLocalizer.GetString("End")), true, true, 2);
            fade_end_box.PackStart(fade_end, false, false, 3);

            HBox fade_box_group = new HBox();

            fade_box_group.PackStart(fade_start_box, true, true, 2);
            fade_box_group.PackStart(fade_end_box, true, true, 2);

            Label volume_label = new Label(AddinManager.CurrentLocalizer.GetString("<b>Volume</b>"));

            volume_label.UseMarkup = true;
            fade_big_box.PackStart(volume_label, false, true, 3);
            fade_big_box.PackStart(fade_box_group, true, true, 2);
            Label duration_label         = new Label(AddinManager.CurrentLocalizer.GetString("Duration:"));
            Label duration_seconds_label = new Label(AddinManager.CurrentLocalizer.GetString(" <i>(seconds)</i>"));

            duration_label.UseMarkup         = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox();

            duration_box.PackStart(duration_label, false, false, 3);
            duration_box.PackStart(fade_duration, false, false, 3);
            duration_box.PackStart(duration_seconds_label, false, true, 3);
            fade_big_box.PackStart(duration_box, true, true, 2);

            Frame alarm_fade_frame = new Frame(AddinManager.CurrentLocalizer.GetString("Fade-In Adjustment"));

            alarm_fade_frame.Add(fade_big_box);
            alarm_fade_frame.ShowAll();

            HBox command_box = new HBox();

            command_box.PackStart(new Label(AddinManager.CurrentLocalizer.GetString("Command:")), false, false, 3);
            command_entry = new Entry();
            command_box.PackStart(command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame(AddinManager.CurrentLocalizer.GetString("Command To Execute:"));

            alarm_misc_frame.Add(command_box);
            alarm_misc_frame.ShowAll();

            VBox.PackStart(alarm_fade_frame, false, false, 3);
            VBox.PackStart(alarm_misc_frame, false, false, 3);

            AddDefaultCloseButton();

            // initialize values
            command_entry.Text  = service.AlarmCommand;
            fade_start.Value    = service.FadeStartVolume;
            fade_end.Value      = service.FadeEndVolume;
            fade_duration.Value = service.FadeDuration;

            // attach change handlers
            command_entry.Changed      += new EventHandler(AlarmCommand_Changed);
            fade_start.ValueChanged    += new EventHandler(FadeStartVolume_Changed);
            fade_end.ValueChanged      += new EventHandler(FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler(FadeDuration_Changed);
        }
 public AlarmThread(AlarmClockService service)
 {
     this.service = service;
 }