Merge lp:~andrewsomething/compizconfig-settings-manager/first_run_warning into lp:~compiz/compizconfig-settings-manager/ubuntu

Proposed by Andrew Starr-Bochicchio
Status: Merged
Merged at revision: 59
Proposed branch: lp:~andrewsomething/compizconfig-settings-manager/first_run_warning
Merge into: lp:~compiz/compizconfig-settings-manager/ubuntu
Diff against target: 124 lines (+112/-0)
2 files modified
debian/changelog (+7/-0)
debian/patches/02_add_first_run_warning.patch (+105/-0)
To merge this branch: bzr merge lp:~andrewsomething/compizconfig-settings-manager/first_run_warning
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+92880@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Looks good! thanks, merging :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-02-01 11:50:50 +0000
3+++ debian/changelog 2012-02-13 23:50:24 +0000
4@@ -1,3 +1,10 @@
5+compizconfig-settings-manager (0.9.5.92-0ubuntu3) precise; urgency=low
6+
7+ * debian/patches/02_add_first_run_warning.patch:
8+ - Add a first run dialog providing a user warning.
9+
10+ -- Andrew Starr-Bochicchio <a.starr.b@gmail.com> Thu, 02 Feb 2012 16:42:20 -0500
11+
12 compizconfig-settings-manager (0.9.5.92-0ubuntu2) precise; urgency=low
13
14 [Alan Bell]
15
16=== added file 'debian/patches/02_add_first_run_warning.patch'
17--- debian/patches/02_add_first_run_warning.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/02_add_first_run_warning.patch 2012-02-13 23:50:24 +0000
19@@ -0,0 +1,105 @@
20+Description: Add a first run dialog providing a user warning.
21+Author: Andrew Starr-Bochicchio <a.starr.b@gmail.com>
22+
23+=== modified file 'ccm/Widgets.py'
24+diff -Nur -x '*.orig' -x '*~' ccsm-warning//ccm/Constants.py.in ccsm-warning.new//ccm/Constants.py.in
25+--- ccsm-warning//ccm/Constants.py.in 2012-02-01 13:30:19.131478000 -0500
26++++ ccsm-warning.new//ccm/Constants.py.in 2012-02-13 18:26:19.699626332 -0500
27+@@ -23,6 +23,7 @@
28+ import pygtk
29+ import gtk
30+ import gtk.gdk
31++import os
32+
33+ # Current Screen
34+ #
35+@@ -66,6 +67,11 @@
36+ DataDir = "@prefix@/share"
37+ IconDir = DataDir+"/ccsm/icons"
38+ PixmapDir = DataDir+"/ccsm/images"
39++ConfigHome = os.getenv("XDG_CONFIG_HOME")
40++if not ConfigHome:
41++ ConfigHome = os.path.join(os.getenv("HOME"), ".config")
42++ConfDir = os.path.join(ConfigHome, "compiz-1/compizconfig/")
43++ConfFile = os.path.join(ConfDir, "firstrun")
44+
45+ # Version
46+ #
47+diff -Nur -x '*.orig' -x '*~' ccsm-warning//ccm/Widgets.py ccsm-warning.new//ccm/Widgets.py
48+--- ccsm-warning//ccm/Widgets.py 2012-02-02 22:43:52.623481000 -0500
49++++ ccsm-warning.new//ccm/Widgets.py 2012-02-13 18:25:55.659409730 -0500
50+@@ -1371,6 +1371,42 @@
51+ self.set_transient_for (parent)
52+ self.connect_after ("response", lambda *args: self.destroy ())
53+
54++# First run dialog providing a user warning.
55++#
56++class FirstRun (gtk.MessageDialog):
57++ '''First run dialog providing a user warning.'''
58++
59++ def __init__(self, parent):
60++ gtk.MessageDialog.__init__ (self, parent,
61++ gtk.DIALOG_DESTROY_WITH_PARENT,
62++ gtk.MESSAGE_WARNING,
63++ gtk.BUTTONS_OK)
64++ self.set_position (gtk.WIN_POS_CENTER)
65++ title = _("CCSM is an advanced tool. Use with caution.")
66++ self.set_markup("<b>%s</b>" % title)
67++ message = _("This tool allows you to deeply configure Compiz's settings. Some options may be incompatible with each other. Unless used with care, it is possible to be left with an unusable desktop.")
68++ self.format_secondary_markup(message)
69++ check_button = gtk.CheckButton(label=_("Show this warning next time?"))
70++ check_button.set_active(True)
71++ self.vbox.pack_start(check_button, True, True, 2)
72++ check_button.show()
73++ check_button.connect("toggled", self.callback, "check button 1")
74++ self.set_transient_for(parent)
75++ self.set_modal(True)
76++ self.show_all()
77++ self.connect("response", lambda *args: self.destroy ())
78++
79++ def callback(self, widget, data=None):
80++ if widget.get_active() == True:
81++ if os.path.isfile(ConfFile):
82++ os.remove(ConfFile)
83++ else:
84++ if not os.path.exists(ConfDir):
85++ os.mkdir(ConfDir)
86++ if os.path.isdir(ConfDir):
87++ f = open(ConfFile, "w")
88++ f.close()
89++
90+ # Plugin Button
91+ #
92+ class PluginButton (gtk.HBox):
93+diff -Nur -x '*.orig' -x '*~' ccsm-warning//ccsm ccsm-warning.new//ccsm
94+--- ccsm-warning//ccsm 2012-02-02 16:42:01.161305000 -0500
95++++ ccsm-warning.new//ccsm 2012-02-13 18:25:55.663409766 -0500
96+@@ -31,6 +31,7 @@
97+ pygtk.require('2.0')
98+ import gtk
99+ import sys
100++import os
101+
102+ def try_register_dbus ():
103+ '''Return instance of dbus control object on success, None on failure'''
104+@@ -92,7 +93,7 @@
105+ import compizconfig
106+ import ccm
107+ from ccm.Utils import GlobalUpdater
108+-from ccm.Constants import Version
109++from ccm.Constants import Version, ConfFile
110+
111+ plugin = None
112+ category = None
113+@@ -124,4 +125,11 @@
114+ idle = ccm.IdleSettingsParser(context, mainWin)
115+ mainWin.show_all()
116+
117++# Check if we should show the first run warning dialog.
118++if os.path.isfile(ConfFile):
119++ pass
120++else:
121++ warning = ccm.FirstRun(mainWin)
122++ warning.show_all()
123++
124+ gtk.main()

Subscribers

People subscribed via source and target branches