update tintwizard : added button Apply and Close
git-svn-id: http://tint2.googlecode.com/svn/trunk@258 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
ac61a62958
commit
8e52784453
3 changed files with 55 additions and 29 deletions
2
AUTHORS
2
AUTHORS
|
@ -3,13 +3,13 @@ tint2 is developped by :
|
||||||
- Thierry Lorthiois <lorthiois@bbsoft.fr>
|
- Thierry Lorthiois <lorthiois@bbsoft.fr>
|
||||||
- Andreas Fink <andreas.fink85@googlemail.com>
|
- Andreas Fink <andreas.fink85@googlemail.com>
|
||||||
- Euan Freeman <euan04@gmail.com> (tintwizard)
|
- Euan Freeman <euan04@gmail.com> (tintwizard)
|
||||||
|
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
|
||||||
|
|
||||||
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
|
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
|
||||||
- 2007-2008 Pål Staurland <staura@gmail.com>
|
- 2007-2008 Pål Staurland <staura@gmail.com>
|
||||||
|
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
Christian Ruppert <Spooky85@gmail.com> : autotools build system
|
|
||||||
Kwaku Yeboah <kwakuyeboah@gmail.com> : wiki page
|
Kwaku Yeboah <kwakuyeboah@gmail.com> : wiki page
|
||||||
Daniel Moerner <dmoerner@gmail.com> : man page and debian package
|
Daniel Moerner <dmoerner@gmail.com> : man page and debian package
|
||||||
Doug Barton : freebsd package
|
Doug Barton : freebsd package
|
||||||
|
|
|
@ -219,7 +219,7 @@ static void menuAddWidget (GtkUIManager * p_uiManager, GtkWidget * p_widget, Gtk
|
||||||
|
|
||||||
static void menuAbout(GtkWindow * parent)
|
static void menuAbout(GtkWindow * parent)
|
||||||
{
|
{
|
||||||
const char *authors[] = { "Thierry Lorthiois", "Christian Ruppert (Build system)", "Euan Freeman <euan04@gmail.com> (tintwizard)\nSee http://code.google.com/p/tintwizard/", NULL };
|
const char *authors[] = { "Thierry Lorthiois <lorthiois@bbsoft.fr>", "Andreas Fink <andreas.fink85@googlemail.com>", "Christian Ruppert <Spooky85@gmail.com> (Build system)", "Euan Freeman <euan04@gmail.com> (tintwizard)\n See http://code.google.com/p/tintwizard/", NULL };
|
||||||
|
|
||||||
gtk_show_about_dialog( parent, "name", g_get_application_name( ),
|
gtk_show_about_dialog( parent, "name", g_get_application_name( ),
|
||||||
"comments", _("Theming tool for tint2 panel"),
|
"comments", _("Theming tool for tint2 panel"),
|
||||||
|
|
|
@ -1237,11 +1237,24 @@ class TintWizardGUI(gtk.Window):
|
||||||
# Add notebook to window and show
|
# Add notebook to window and show
|
||||||
self.table.attach(self.notebook, 0, 4, 2, 3, xpadding=5, ypadding=5)
|
self.table.attach(self.notebook, 0, 4, 2, 3, xpadding=5, ypadding=5)
|
||||||
|
|
||||||
|
if self.oneConfigFile:
|
||||||
|
# Add button Apply and Close
|
||||||
|
self.box1 = gtk.HBox(False, 20)
|
||||||
|
self.table.attach(self.box1, 0, 4, 3, 4, xpadding=5, ypadding=5)
|
||||||
|
temp = gtk.Button("Apply", gtk.STOCK_APPLY)
|
||||||
|
temp.set_name("applyBg")
|
||||||
|
temp.connect("clicked", self.apply)
|
||||||
|
self.box1.pack_start(temp, True, True, 0)
|
||||||
|
temp = gtk.Button("Close", gtk.STOCK_CLOSE)
|
||||||
|
temp.set_name("closeBg")
|
||||||
|
temp.connect("clicked", self.quit)
|
||||||
|
self.box1.pack_start(temp, True, True, 0)
|
||||||
|
|
||||||
# Create and add the status bar to the bottom of the main window
|
# Create and add the status bar to the bottom of the main window
|
||||||
self.statusBar = gtk.Statusbar()
|
self.statusBar = gtk.Statusbar()
|
||||||
self.statusBar.set_has_resize_grip(True)
|
self.statusBar.set_has_resize_grip(True)
|
||||||
self.updateStatusBar("New Config File [*]")
|
self.updateStatusBar("New Config File [*]")
|
||||||
self.table.attach(self.statusBar, 0, 4, 3, 4)
|
self.table.attach(self.statusBar, 0, 4, 4, 5)
|
||||||
|
|
||||||
self.add(self.table)
|
self.add(self.table)
|
||||||
|
|
||||||
|
@ -1415,12 +1428,6 @@ class TintWizardGUI(gtk.Window):
|
||||||
|
|
||||||
def apply(self, widget, event=None, confirmChange=True):
|
def apply(self, widget, event=None, confirmChange=True):
|
||||||
"""Applies the current config to tint2."""
|
"""Applies the current config to tint2."""
|
||||||
if confirmDialog(self, "This will terminate all currently running instances of tint2 before applying config. Continue?") == gtk.RESPONSE_YES:
|
|
||||||
if not self.save():
|
|
||||||
return
|
|
||||||
|
|
||||||
#shutil.copyfile(self.filename, self.filename+".backup") # Create backup
|
|
||||||
|
|
||||||
# Check if tint2 is running
|
# Check if tint2 is running
|
||||||
procs = os.popen('pidof "tint2"') # Check list of active processes for tint2
|
procs = os.popen('pidof "tint2"') # Check list of active processes for tint2
|
||||||
pids = [] # List of process ids for tint2
|
pids = [] # List of process ids for tint2
|
||||||
|
@ -1430,6 +1437,25 @@ class TintWizardGUI(gtk.Window):
|
||||||
|
|
||||||
procs.close()
|
procs.close()
|
||||||
|
|
||||||
|
if self.oneConfigFile:
|
||||||
|
# Save and copy as default
|
||||||
|
self.save()
|
||||||
|
tmpSrc = self.filename
|
||||||
|
tmpDest = os.path.expandvars("${HOME}") + "/.config/tint2/tint2rc"
|
||||||
|
try:
|
||||||
|
shutil.copyfile(tmpSrc, tmpDest)
|
||||||
|
except shutil.Error:
|
||||||
|
pass
|
||||||
|
# Ask tint2 to reload config
|
||||||
|
for pid in pids:
|
||||||
|
os.kill(pid, signal.SIGUSR1)
|
||||||
|
else:
|
||||||
|
if confirmDialog(self, "This will terminate all currently running instances of tint2 before applying config. Continue?") == gtk.RESPONSE_YES:
|
||||||
|
if not self.save():
|
||||||
|
return
|
||||||
|
|
||||||
|
#shutil.copyfile(self.filename, self.filename+".backup") # Create backup
|
||||||
|
|
||||||
# If it is - kill it
|
# If it is - kill it
|
||||||
for pid in pids:
|
for pid in pids:
|
||||||
os.kill(pid, signal.SIGTERM)
|
os.kill(pid, signal.SIGTERM)
|
||||||
|
|
Loading…
Reference in a new issue