Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/volumestoolbar.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-11 10:55:37 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-11 10:55:37 (GMT)
commit2af4b107ff482ba2efb0fdf00fb9278fd81ed555 (patch)
treef6534bbd8f846627dd36083b0588271a97267930 /volumestoolbar.py
parentdd0b8a5fed9355020f8ef48ce46df4ecfe6469a0 (diff)
#1998 Only show the volumes toolbar when there are devices mounted.
Diffstat (limited to 'volumestoolbar.py')
-rw-r--r--volumestoolbar.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/volumestoolbar.py b/volumestoolbar.py
index 3842916..5974f90 100644
--- a/volumestoolbar.py
+++ b/volumestoolbar.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
import os
import logging
from gettext import gettext as _
@@ -151,6 +152,9 @@ class VolumesToolbar(gtk.Toolbar):
menu_item.connect('activate', self._unmount_activated_cb, udi, volume_id, button)
palette.append_menu_item(menu_item)
menu_item.show()
+
+ if len(self.get_children()) > 1:
+ self.show()
def _button_toggled_cb(self, button, volume_id):
if button.props.active:
@@ -161,6 +165,9 @@ class VolumesToolbar(gtk.Toolbar):
self._unmount_device(udi)
self.remove(button)
self.get_children()[0].props.active = True
+
+ if len(self.get_children()) < 2:
+ self.hide()
def _unmount_device(self, udi):
bus = dbus.SystemBus()