More improvement of HTML generation dialog.
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 6 Aug 2004 20:23:58 +0000 (20:23 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 6 Aug 2004 20:23:58 +0000 (20:23 +0000)
src/gkofoto/generatehtmldialog.py

index ec8c7ef..f6022d4 100644 (file)
@@ -33,15 +33,18 @@ class GenerateHTMLDialog:
             os.path.isdir(self.directoryTextEntry.get_text()))
 
     def _onBrowse(self, *unused):
-        def fileListChanged(widget):
-            model, iterator = widget.get_tree_view() \
-                .get_selection().get_selected()
-            dirDialog.ok_button.set_sensitive(iterator == None)
+        directorySelectedInDirList = False
         dirDialog = gtk.FileSelection(title="Choose directory")
-        dirDialog.file_list.get_selection().connect(
-            "changed", fileListChanged)
+        dirDialog.file_list.set_sensitive(False)
+        dirDialog.fileop_del_file.set_sensitive(False)
+        dirDialog.fileop_ren_file.set_sensitive(False)
         if dirDialog.run() == gtk.RESPONSE_OK:
-            self.directoryTextEntry.set_text(dirDialog.get_filename())
+            model, iterator = dirDialog.dir_list.get_selection().get_selected()
+            directory = dirDialog.get_filename()
+            if iterator:
+                directory = os.path.join(
+                    directory, model.get_value(iterator, 0))
+            self.directoryTextEntry.set_text(directory)
         dirDialog.destroy()
 
     def _onCancel(self, *unused):