From: Stefan Bund Date: Wed, 22 Dec 2010 14:10:34 +0000 (+0100) Subject: allow customizing initial and minimal size in pykit.ini X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=70bf8599015c1554a65dfb003b5c5189857dd320;p=pykit.git allow customizing initial and minimal size in pykit.ini --- diff --git a/main.cc b/main.cc index 355abf3..bd65730 100644 --- a/main.cc +++ b/main.cc @@ -28,6 +28,16 @@ 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: