Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dziallas <sebastian@when.com>2010-07-05 11:59:08 (GMT)
committer Sebastian Dziallas <sebastian@when.com>2010-07-05 11:59:08 (GMT)
commit0f435356ce7267583514927672e90bacece93a5b (patch)
tree2877a10b6861acbf6df2ccce5366d2253f742416
parent0b27bdc4cfa9396f0e21c99a89dd6896f99cb3f9 (diff)
only show delete button when profile is present
-rw-r--r--extensions/cpsection/smolt/view.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/extensions/cpsection/smolt/view.py b/extensions/cpsection/smolt/view.py
index 8efdc7d..9e893d4 100644
--- a/extensions/cpsection/smolt/view.py
+++ b/extensions/cpsection/smolt/view.py
@@ -72,13 +72,14 @@ class smolt(SectionView):
box_smolt.pack_start(box_submit_profile, expand=False)
box_submit_profile.show()
- box_delete_profile = gtk.HBox(spacing=style.DEFAULT_SPACING)
- self._delete_profile_button = gtk.Button()
- self._delete_profile_button.set_label(_('Delete Profile'))
- box_delete_profile.pack_start(self._delete_profile_button, expand=False)
- self._delete_profile_button.show()
- box_smolt.pack_start(box_delete_profile, expand=False)
- box_delete_profile.show()
+ if os.path.exists(os.getenv("HOME") + '/.smolt/uuiddb.cfg'):
+ box_delete_profile = gtk.HBox(spacing=style.DEFAULT_SPACING)
+ self._delete_profile_button = gtk.Button()
+ self._delete_profile_button.set_label(_('Delete Profile'))
+ box_delete_profile.pack_start(self._delete_profile_button, expand=False)
+ self._delete_profile_button.show()
+ box_smolt.pack_start(box_delete_profile, expand=False)
+ box_delete_profile.show()
box_profile = gtk.HBox(spacing=style.DEFAULT_SPACING)
label_profile = gtk.Label(_('Profile:'))
@@ -99,9 +100,11 @@ class smolt(SectionView):
box_smolt.show()
self._setup_submit()
- self._setup_delete()
self._setup_policy()
+ if os.path.exists(os.getenv("HOME") + '/.smolt/uuiddb.cfg'):
+ self._setup_delete()
+
def _setup_submit(self):
self._smolt_submit_profile_handler = \
self._submit_profile_button.connect( \