| 863 | } |
| 864 | |
| 865 | void MainFrame::ReadSettings() |
| 866 | { |
| 867 | AppConfig &app = AppConfig::Instance(); |
| 868 | |
| 869 | // The history scale region. |
| 870 | int left = app.frameOptions.left; |
| 871 | int top = app.frameOptions.top; |
| 872 | int right = app.frameOptions.right; |
| 873 | int bottom = app.frameOptions.bottom; |
| 874 | int x = app.frameOptions.x; |
| 875 | int y = app.frameOptions.y; |
| 876 | QString lstDisplayName = app.frameOptions.displayName; |
| 877 | |
| 878 | if (x == NO_POINT_VALUE){ |
| 879 | x = left; |
| 880 | y = top; |
| 881 | } |
| 882 | |
| 883 | dsv_info("Read region info, x:%d, y:%d, w:%d, h:%d, isMax:%d", |
| 884 | x, y, right-left, bottom-top, app.frameOptions.isMax); |
| 885 | |
| 886 | if (lstDisplayName != ""){ |
| 887 | dsv_info("Last display:%s", lstDisplayName.toStdString().c_str()); |
| 888 | } |
| 889 | |
| 890 | bool bReset = false; |
| 891 | int scrIndex = -1; |
| 892 | int k = 1; |
| 893 | int zoomk = 1; |
| 894 | QString scrName = ""; |
| 895 | QRect full_rect = QRect(0,0,0,0); |
| 896 | QScreen *screen = NULL; |
| 897 | |
| 898 | for (int i=0; i<QGuiApplication::screens().size(); i++){ |
| 899 | QRect rc = QGuiApplication::screens().at(i)->availableGeometry(); |
| 900 | QString name = QGuiApplication::screens().at(i)->name(); |
| 901 | |
| 902 | if (name == lstDisplayName){ |
| 903 | scrIndex = i; |
| 904 | } |
| 905 | |
| 906 | dsv_info("Screen name:%s, region, left:%d, top:%d, width:%d, height:%d", |
| 907 | name.toStdString().c_str(), rc.left(), rc.top(), rc.width(), rc.height() ); |
| 908 | } |
| 909 | |
| 910 | if (scrIndex == -1){ |
| 911 | bReset = true; |
| 912 | screen = QGuiApplication::primaryScreen(); |
| 913 | } |
| 914 | else{ |
| 915 | screen = QGuiApplication::screens().at(scrIndex); |
| 916 | } |
| 917 | |
| 918 | full_rect = screen->availableGeometry(); |
| 919 | k = screen->devicePixelRatio(); |
| 920 | scrName = screen->name(); |
| 921 | |
| 922 | #ifdef _WIN32 |
nothing calls this directly
no test coverage detected