Commit 814962d7 authored by Benjamin Meyer's avatar Benjamin Meyer
Browse files

No longer saves its own size or statusbar settings. KMainWindow does

it now.

svn path=/trunk/kdegames/ktron/; revision=210264
parent 0dbb0011
......@@ -90,20 +90,14 @@ KTron::KTron() : settings(0) {
(void)new KAction(i18n("&Configure KTron..."), 0, this, SLOT(showSettings()), actionCollection(), "configure_ktron" );
createGUI();
resize(400,300);
setAutoSaveSettings();
showStatusbar->setChecked(!statusBar()->isHidden());
readSettings();
}
void KTron::readSettings() {
KConfig *config=kapp->config();
config->setGroup("Window");
bool visible=config->readBoolEntry("Statusbar",true);
showStatusbar->setChecked(visible);
int width=config->readNumEntry("Width",400);
int height=config->readNumEntry("Height",300);
resize(width,height);
config->setGroup("Game");
playerName[0]=config->readEntry("Name_Pl1");
if ( playerName[0].isEmpty() )
......@@ -117,19 +111,9 @@ void KTron::readSettings() {
// Destructor
KTron::~KTron(){
saveSettings();
delete tron;
}
void KTron::saveSettings() {
KConfig *config=kapp->config();
KConfigGroupSaver saver(config,"Window");
config->writeEntry("Statusbar", showStatusbar->isChecked());
config->writeEntry("Width",width());
config->writeEntry("Height",height());
}
void KTron::updateStatusbar(){
for(int i=0;i<2;i++){
Player player;
......
......@@ -55,7 +55,6 @@ private:
KDialogBase *settings;
void updateStatusbar();
void saveSettings();
protected:
/** calls tron->updatePixmap to draw frame in the new colors */
......
......@@ -39,7 +39,7 @@ int main(int argc, char* argv[])
KAboutData aboutData( "ktron", I18N_NOOP("KTron"),
KTRON_VERSION, description, KAboutData::License_GPL, notice);
aboutData.addAuthor("Matthias Kiefer",I18N_NOOP("Original author"), "matthias.kiefer@gmx.de");
aboutData.addAuthor("Benjamin Meyer",0, "ben@meyerhome.net");
aboutData.addAuthor("Benjamin Meyer",I18N_NOOP("Various improvements"), "ben@meyerhome.net");
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication a;
......@@ -52,7 +52,7 @@ int main(int argc, char* argv[])
RESTORE(KTron)
}
else {
KTron* ktron = new KTron;
KTron *ktron = new KTron();
a.setMainWidget(ktron);
ktron->show();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment