From 7d8f316f936d8cdd0e0c4047bcb5ff67ed2246e1 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Fri, 24 Mar 2006 15:10:33 +0100 Subject: * set the correct window type hint - dialog or window --- SoftwareProperties/SoftwareProperties.py | 6 ++++++ data/SoftwareProperties.glade | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 943af28d..f1518f37 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -70,12 +70,18 @@ class SoftwareProperties(SimpleGladeApp): #self.gconfclient = gconf.client_get_default() if parent: + self.window_main.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) + self.window_main.show() self.window_main.set_transient_for(parent) # If externally called, reparent to external application. if options and options.toplevel != None: + self.window_main.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) + self.window_main.show() toplevel = gtk.gdk.window_foreign_new(int(options.toplevel)) self.window_main.window.set_transient_for(toplevel) + + self.window_main.show() self.init_sourceslist() self.reload_sourceslist() diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index da164c23..57f7542d 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -7,7 +7,6 @@ 6 580 400 - True Software Preferences GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -18,7 +17,7 @@ True False False - GDK_WINDOW_TYPE_HINT_DIALOG + GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True False -- cgit v1.2.3 From 3aa98f64592d44a6c65ad1bac11e03292c7deb39 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sat, 25 Mar 2006 10:52:05 +0100 Subject: * add some sanity checking to aptsources --- SoftwareProperties/aptsources.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 77de510b..53ae2e84 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -102,8 +102,16 @@ class SourceEntry: line = line[:i] # source is ok, split it and see what we have pieces = self.mysplit(line) + # Sanity check + if len(pieces) < 3: + self.invalid = True + return # Type, deb or deb-src self.type = string.strip(pieces[0]) + # Sanity check + if self.type not in ("deb", "deb-src"): + self.invalid = True + return # URI self.uri = string.strip(pieces[1]) # distro and components (optional) -- cgit v1.2.3