Merge lp:~bzeghers/caffeine/main into lp:caffeine

Proposed by Ben
Status: Merged
Merge reported by: Isaiah Heyer
Merged at revision: not available
Proposed branch: lp:~bzeghers/caffeine/main
Merge into: lp:caffeine
Diff against target: 108 lines (+47/-1)
3 files modified
caffeine/__init__.py (+2/-0)
caffeine/main.py (+11/-1)
share/caffeine/glade/GUI.glade (+34/-0)
To merge this branch: bzr merge lp:~bzeghers/caffeine/main
Reviewer Review Type Date Requested Status
Isaiah Heyer Approve
Review via email: mp+46228@code.launchpad.net

Description of the change

This patch adds an option to show/hide the notification message when starting caffeine. I got tired of seeing it on every startup so why not add an option to disable it?

To post a comment you must log in.
Revision history for this message
Isaiah Heyer (freshapplepy) wrote :

There isn't supposed to be a notification when starting Caffeine...what does the notification say?

Revision history for this message
Ben (bzeghers) wrote :

I get a notification that says "Caffeine is running To show the tray icon,
run 'caffeine -p' or open Caffeine Preferences from your system menu." every
time caffeine is started (manually and on startup). I have had this come up
on two installs of 10.10 and on 10.04 on another box.

On Thu, Jan 13, 2011 at 11:29 PM, Isaiah Heyer <email address hidden>wrote:

> There isn't supposed to be a notification when starting Caffeine...what
> does the notification say?
> --
> https://code.launchpad.net/~bzeghers/caffeine/main/+merge/46228<https://code.launchpad.net/%7Ebzeghers/caffeine/main/+merge/46228>
> You are the owner of lp:~bzeghers/caffeine/main.
>

Revision history for this message
Isaiah Heyer (freshapplepy) wrote :

So you have the tray icon hidden?

Revision history for this message
Ben (bzeghers) wrote :

Yes, I do. There really isn't any need (for me anyway) for the tray icon. If I want to change a setting I can get into the caffeine preferences from the settings menu. I don't really need my tray starting to look like a Windows system tray :)

Revision history for this message
Isaiah Heyer (freshapplepy) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'caffeine/__init__.py'
2--- caffeine/__init__.py 2010-12-22 18:08:19 +0000
3+++ caffeine/__init__.py 2011-01-14 05:10:13 +0000
4@@ -120,6 +120,8 @@
5 "act_for_flash"), False)
6 _conf.register_opt("show_tray_icon", os.path.join(_key,
7 "show_tray_icon"), True)
8+_conf.register_opt("show_notification", os.path.join(_key,
9+ "show_notification"), True)
10
11 ## Functions to add/remove Caffeine from the list of startup programs
12 import shutil
13
14=== modified file 'caffeine/main.py'
15--- caffeine/main.py 2010-12-22 19:12:43 +0000
16+++ caffeine/main.py 2011-01-14 05:10:13 +0000
17@@ -347,6 +347,7 @@
18 get = builder.get_object
19
20 show_tray_icon = self.Conf.get("show_tray_icon").get_bool()
21+ show_notification = self.Conf.get("show_notification").get_bool()
22
23 if appindicator_avail:
24 self.AppInd = appindicator.Indicator ("caffeine-cup-empty",
25@@ -362,7 +363,7 @@
26 self.status_icon = get("statusicon")
27 self.status_icon.set_visible(show_tray_icon)
28
29- if show_tray_icon is False and options.preferences is not True:
30+ if show_notification is True and options.preferences is not True:
31 note = pynotify.Notification(_("Caffeine is running"), _("To show the tray icon, \nrun ") + "'caffeine -p' " + _("or open Caffeine Preferences from your system menu."), "caffeine")
32
33 note.show()
34@@ -413,6 +414,7 @@
35 self.ql_cb = get("ql_cbutton")
36 self.flash_cb = get("flash_cbutton")
37 self.trayicon_cb = get("trayicon_cbutton")
38+ self.notification_cb = get("notification_cbutton")
39
40 self.Conf.client.notify_add("/apps/caffeine/prefs/autostart",
41 self.on_gconf_autostart_changed)
42@@ -430,6 +432,7 @@
43 self.ql_cb.set_active(self.Conf.get("act_for_ql").get_bool())
44 self.flash_cb.set_active(self.Conf.get("act_for_flash").get_bool())
45 self.trayicon_cb.set_active(self.Conf.get("show_tray_icon").get_bool())
46+ self.notification_cb.set_active(self.Conf.get("show_notification").get_bool())
47
48 ## about dialog
49 self.about_dialog = get("aboutdialog")
50@@ -598,6 +601,13 @@
51 #if state = False:
52
53 self.Conf.set("show_tray_icon", state)
54+
55+ def on_notification_cbutton_toggled(self, cbutton, data=None):
56+ state = cbutton.get_active()
57+
58+ #if state = False:
59+
60+ self.Conf.set("show_notification", state)
61
62 #### Menu callbacks
63 def on_activate_menuitem_activate (self, menuitem, data=None):
64
65=== modified file 'share/caffeine/glade/GUI.glade'
66--- share/caffeine/glade/GUI.glade 2010-12-22 19:12:43 +0000
67+++ share/caffeine/glade/GUI.glade 2011-01-14 05:10:13 +0000
68@@ -383,6 +383,40 @@
69 <property name="position">5</property>
70 </packing>
71 </child>
72+ <child>
73+ <object class="GtkLabel" id="label8">
74+ <property name="visible">True</property>
75+ <property name="xalign">0</property>
76+ <property name="label" translatable="yes">Notification</property>
77+ <attributes>
78+ <attribute name="weight" value="bold"/>
79+ </attributes>
80+ </object>
81+ <packing>
82+ <property name="expand">False</property>
83+ <property name="position">4</property>
84+ </packing>
85+ </child>
86+ <child>
87+ <object class="GtkAlignment" id="alignment6">
88+ <property name="visible">True</property>
89+ <property name="left_padding">10</property>
90+ <child>
91+ <object class="GtkCheckButton" id="notification_cbutton">
92+ <property name="label" translatable="yes">Show notification message</property>
93+ <property name="visible">True</property>
94+ <property name="can_focus">True</property>
95+ <property name="receives_default">False</property>
96+ <property name="draw_indicator">True</property>
97+ <signal name="toggled" handler="on_notification_cbutton_toggled"/>
98+ </object>
99+ </child>
100+ </object>
101+ <packing>
102+ <property name="expand">False</property>
103+ <property name="position">5</property>
104+ </packing>
105+ </child>
106 </object>
107 <packing>
108 <property name="position">0</property>

Subscribers

People subscribed via source and target branches

to all changes: