OSDN Git Service

ファイルダイアログの初期ディレクトリを修正。
authorhrwatahiki <hrwatahiki@44a3fe10-d6a8-4042-99bc-5bf971f0e03b>
Thu, 25 Apr 2013 05:28:45 +0000 (05:28 +0000)
committerhrwatahiki <hrwatahiki@44a3fe10-d6a8-4042-99bc-5bf971f0e03b>
Thu, 25 Apr 2013 05:28:45 +0000 (05:28 +0000)
git-svn-id: https://svn.osdn.net/svnroot/pydun/trunk@21 44a3fe10-d6a8-4042-99bc-5bf971f0e03b

Pydun.exe
Pydun.py

index 13d1563..85cb276 100644 (file)
Binary files a/Pydun.exe and b/Pydun.exe differ
index 0e5d750..1612672 100644 (file)
--- a/Pydun.py
+++ b/Pydun.py
@@ -152,7 +152,13 @@ class MainWindow(QtGui.QMainWindow):
 \r
     @QtCore.Slot()\r
     def open_triggered(self):\r
+        d = ""\r
+        try:\r
+            d = os.path.dirname(_mapengine.filename)\r
+        except:\r
+            pass\r
         filename = QtGui.QFileDialog.getOpenFileName(\r
+            dir=d,\r
             filter=u"*.pydun;;*.*", selectedFilter=u"*.pydun")\r
         if filename[0] != u"":\r
             self.open(filename[0])\r
@@ -176,7 +182,13 @@ class MainWindow(QtGui.QMainWindow):
 \r
     @QtCore.Slot()\r
     def saveas_triggered(self):\r
+        d = ""\r
+        try:\r
+            d = os.path.dirname(_mapengine.filename)\r
+        except:\r
+            pass\r
         filename = QtGui.QFileDialog.getSaveFileName(\r
+            dir=d,\r
             filter=u"*.pydun;;*.*", selectedFilter=u"*.pydun")\r
         if filename[0] != u"":\r
             self.save(filename[0])\r
@@ -423,7 +435,7 @@ class MainFrame(QtGui.QFrame):
         global config\r
         dlg = PydunColorDialog(self, config.get("customColor", dict()))\r
         dlg.setCurrentColor(self.backcolorbox.color)\r
-        dlg.exec_()\r
+        dlg.exec_(config)\r
         if dlg.result() == QtGui.QDialog.Accepted:\r
             self.backcolorbox.color = dlg.currentColor()\r
             self.backcolorbutton.setChecked(True)\r
@@ -677,7 +689,7 @@ class DetailDialog(QtGui.QDialog):
         global config\r
         dlg = PydunColorDialog(self, config.get("customColor", dict()))\r
         dlg.setCurrentColor(self.forecolorbox.color)\r
-        dlg.exec_()\r
+        dlg.exec_(config)\r
         if dlg.result() == QtGui.QDialog.Accepted:\r
             self.forecolorbox.color = dlg.currentColor()\r
 \r
@@ -1286,11 +1298,11 @@ class PydunColorDialog(QtGui.QColorDialog):
                 getcolorfromstring(\r
                     config.get(index, "#FFFFFF")).rgb())\r
 \r
-    def exec_(self):\r
+    def exec_(self, config):\r
         super(PydunColorDialog, self).exec_()\r
-        config["customColor"] = dict()\r
+        config = dict()\r
         for index in range(self.customCount()):\r
-            config["customColor"][index] = getcolorstring(\r
+            config[index] = getcolorstring(\r
                 QtGui.QColor.fromRgb(self.customColor(index)))\r
 \r
 \r