allow customizing initial and minimal size in pykit.ini
Stefan Bund [Wed, 22 Dec 2010 14:10:34 +0000 (15:10 +0100)]
main.cc

diff --git a/main.cc b/main.cc
index 355abf3..bd65730 100644 (file)
--- a/main.cc
+++ b/main.cc
 
 extern void qt_drt_overwritePluginDirectories();
 
+namespace {
+    QSize parseSize(QString const & s)
+    {
+        QStringList coords (s.split(" "));
+        if (coords.size() != 2)
+            return QSize();
+        return QSize(coords[0].toInt(), coords[1].toInt());
+    }
+}
+
 int main(int argc, char *argv[])
 {
     try {
@@ -83,6 +93,9 @@ int main(int argc, char *argv[])
             window.setWindowIcon(QIcon(iconPath));
         window.setWindowIconText(window.windowTitle());
 
+        window.setMinimumSize(parseSize(settings.value("minsize").toString()));
+        window.resize(parseSize(settings.value("size").toString()));
+
         window.show();
         if (splash)
             splash->finish(&window);
@@ -107,5 +120,5 @@ int main(int argc, char *argv[])
 // c-file-style: "j32"
 // indent-tabs-mode: nil
 // ispell-local-dictionary: "american"
-// compile-command: "scons -U"
+// compile-command: "make"
 // End: