From 7ecc8de084835f9da9f76356eaebe22cf6b9fb34 Mon Sep 17 00:00:00 2001 From: Stelios Bounanos Date: Fri, 16 May 2008 03:43:22 +0100 Subject: [PATCH] Save rigctl window size --- src/include/status.h | 2 ++ src/misc/status.cxx | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/include/status.h b/src/include/status.h index fe54dbc9..ebeaed36 100644 --- a/src/include/status.h +++ b/src/include/status.h @@ -13,6 +13,8 @@ struct status { bool rigShown; int rigX; int rigY; + int rigW; + int rigH; int carrier; int mag; int speed; diff --git a/src/misc/status.cxx b/src/misc/status.cxx index 3db69fe3..9b80f58e 100644 --- a/src/misc/status.cxx +++ b/src/misc/status.cxx @@ -44,6 +44,8 @@ status progStatus = { false, // bool rigShown; 50, // int rigX; 50, // int rigY; + 560, // int rigW + 80, // int rigH 1000, // int carrier; 1, // int mag; NORMAL, // WFdisp::WFspeed @@ -97,6 +99,8 @@ void status::saveLastState() if (rigcontrol && rigcontrol->visible()) { rigX = rigcontrol->x(); rigY = rigcontrol->y(); + rigW = rigcontrol->w(); + rigH = rigcontrol->h(); rigShown = true; } @@ -137,6 +141,8 @@ void status::saveLastState() spref.set("rigctl_visible", rigShown); spref.set("rigctl_x", rigX); spref.set("rigctl_y", rigY); + spref.set("rigctl_w", rigW); + spref.set("rigctl_h", rigH); spref.set("viewer_visible", VIEWERvisible); spref.set("viewer_x", static_cast(VIEWERxpos)); @@ -192,6 +198,8 @@ void status::loadLastState() spref.get("rigctl_visible", i, i); rigShown = i; spref.get("rigctl_x", rigX, rigX); spref.get("rigctl_y", rigY, rigY); + spref.get("rigctl_w", rigW, rigW); + spref.get("rigctl_h", rigH, rigH); spref.get("viewer_visible", i, i); VIEWERvisible = i; spref.get("viewer_x", i, i); VIEWERxpos = i; @@ -255,9 +263,7 @@ void status::initLastState() if (rigShown == true) { if (!rigcontrol) createRigDialog(); - int rdW = rigcontrol->w(); - int rdH = rigcontrol->h(); - rigcontrol->resize(rigX, rigY, rdW, rdH); + rigcontrol->resize(rigX, rigY, rigW, rigH); rigcontrol->show(); } if (VIEWERvisible == true)