[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kmameleon/main
From: Primoz Anzur <zerokode () gmx ! net>
Date: 2004-04-05 23:20:31
Message-ID: 20040405232031.F3A0399BF () office ! kde ! org
[Download RAW message or body]
CVS commit by zero:
New: Window restoring
M +21 -1 mainwindow.cc 1.82
M +5 -0 xmameconfig.cc 1.89
M +1 -0 xmameconfig.h 1.56
--- kdenonbeta/kmameleon/main/mainwindow.cc #1.81:1.82
@@ -77,4 +77,13 @@ KMameleon::KMameleon()
//load the image of the file
loadScreenShots();
+ if (config->readBoolEntry("restoreWindowPosition"))
+ {
+ this->move(config->readNumEntry("posXMainWindow",0), \
config->readNumEntry("posYMainWindow",0)); + \
dbgWindow->move(config->readNumEntry("posXDebugWindow",0), \
config->readNumEntry("posYDebugWindow",0)); + \
ssWindow->move(config->readNumEntry("posXScreenShotWindow",0),config->readNumEntry("posYScreenShotWindow",0));
+ kdDebug() << "Restoring window positions: this->x(): " << \
config->readNumEntry("posXMainWindow",0) << " | ssWindow->y(): " << \
config->readNumEntry("posYMainWindow",0) << endl; + kdDebug() << \
"Restoring window positions: dbgWindow->x(): " << \
config->readNumEntry("posXDebugWindow",0) << " | dbgWindow->y(): " << \
config->readNumEntry("posYDebugWindow",0) << endl; + kdDebug() << \
"Restoring window positions: ssWindow->x(): " << \
config->readNumEntry("posXScreenShotWindow",0) << " | ssWindow->y(): " << \
config->readNumEntry("posYScreenShotWindow",0) << endl; + }
}
@@ -246,5 +255,5 @@ void KMameleon::runPlay()
void KMameleon::runConf()
{
- newConfig -> loadConfig();
+// newConfig -> loadConfig();
newConfig -> show();
}
@@ -417,4 +426,15 @@ void KMameleon::closeEvent(QCloseEvent *
proc.kill();
+//Save window positions:
+ config->writeEntry("posXMainWindow",this->x());
+ config->writeEntry("posYMainWindow",this->y());
+
+ config->writeEntry("posXDebugWindow",dbgWindow->x());
+ config->writeEntry("posYDebugWindow",dbgWindow->y());
+
+ config->writeEntry("posXScreenShotWindow",ssWindow->x());
+ config->writeEntry("posYScreenShotWindow",ssWindow->y());
+ config->sync();
+
kapp->exit();
}
--- kdenonbeta/kmameleon/main/xmameconfig.cc #1.88:1.89
@@ -201,4 +201,5 @@ void XMameCfg::modGeneral()
chkOutput = new QCheckBox(i18n("Show output"), page1);
chkScreenShots = new QCheckBox(i18n("Show screenshots"), page1);
+ chkRestoreWindowPos = new QCheckBox(i18n("Restore window positions"), \
page1);
chkCustomSwitch = new QCheckBox(i18n("Enable custom-only switches"), page1);
@@ -240,4 +241,5 @@ void XMameCfg::modGeneral()
topLayout->addWidget( lblInfo,10,0 );
topLayout->addWidget( chkCustomSwitch,11,0 );
+ topLayout->addWidget( chkRestoreWindowPos,12,0 );
connect (cbConfigType, SIGNAL(activated(int)), this, \
SLOT(slotConfigType(int)) ); @@ -1209,4 +1211,5 @@ void XMameCfg::modFirstRun()
config->writeEntry("xmame_gl",pthXmameGlBin->text());
config->writeEntry("xmame_svgalib",pthXmameSvgaLibBin->text());
+ config->writeEntry("restoreWindowPosition",true);
config->writeEntry("showOutput",true);
@@ -1312,4 +1315,5 @@ void XMameCfg::loadConfig()
xMameType->setCurrentItem(config->readNumEntry("xmame_type",0));
chkCustomSwitch->setChecked(config->readBoolEntry("custom", false));
+ chkRestoreWindowPos->setChecked(config->readBoolEntry("restoreWindowPosition",true));
lockLevelList();
}
@@ -1484,4 +1488,5 @@ void XMameCfg::writeConfig()
config->writeEntry("cheatFile", leCheatFile->text());
config->writeEntry("custom", chkCustomSwitch->isChecked());
+ config->writeEntry("restoreWindowPosition",chkRestoreWindowPos->isChecked());
config->writeEntry("detachProcess", chkDetachProcess->isChecked());
--- kdenonbeta/kmameleon/main/xmameconfig.h #1.55:1.56
@@ -90,4 +90,5 @@ public:
QCheckBox *chkOutput;
QCheckBox *chkScreenShots;
+ QCheckBox *chkRestoreWindowPos;
QCheckBox *chkColorOutput;
QCheckBox *chkCheatMode;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic