[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeedu/klatin/klatin
From: Anne-Marie Mahfouf <annma () kde ! org>
Date: 2004-07-10 2:57:19
Message-ID: 20040710025719.9430516B1B () office ! kde ! org
[Download RAW message or body]
CVS commit by annma:
make settings applied
cleaned code
M +5 -3 klatin.cpp 1.48
M +1 -27 klatinvocab.cpp 1.30
M +0 -2 klatinvocab.h 1.16
--- kdeedu/klatin/klatin/klatin.cpp #1.47:1.48
@@ -186,7 +186,6 @@ void KLatin::LoadSettings()
dialog->addPage(vocabPage, i18n("Vocabulary"), "kdict");
- connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));
-
connect(vocabPage->ChangeButton, SIGNAL(clicked()), this, SLOT(vocab_SetDefaultFile()));
+ connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));
dialog->show();
}
@@ -196,5 +195,5 @@ void KLatin::slotSettingsChanged()
// Only the vocab section so far needs config refreshed for it
if (Section == 1) {
- klatinvocabsection->Reset();
+ klatinvocabsection->changeVocab(Settings::defaultFile());
}
}
@@ -215,4 +214,5 @@ void KLatin::vocab_FileSave()
Settings::setDefaultFile(loadVocabDialog->selectedFile());
Settings::writeConfig();
+ slotSettingsChanged();
}
@@ -299,4 +299,6 @@ void KLatin::MenuChangeConfirm()
{
klatinvocabsection->changeVocab(loadVocabDialog->selectedFile());
+ Settings::setDefaultFile(loadVocabDialog->selectedFile());
+ Settings::writeConfig();
}
--- kdeedu/klatin/klatin/klatinvocab.cpp #1.29:1.30
@@ -63,22 +63,4 @@ KLatinVocab::~KLatinVocab()
}
-void KLatinVocab::Reset()
-{
- // Reset to defaults
- Total = 0;
- TotalCorrect = 0;
- QuestionNumber = 0;
- QuestionNumber2 = 0;
- NumberOfQuestions = 10;
-
- // Reset score labels
- Score1Label->setNum(TotalCorrect);
- Score2Label->setNum(Total);
- PercentageLabel->setText(0);
-
- // Load stuff from config file
- ParseVocab(vocabFile);
-}
-
void KLatinVocab::ParseVocab(QString customFile = QString::null)
{
@@ -422,5 +404,5 @@ void KLatinVocab::ResultsDialog()
QuestionNumber2 = 0;
- Reset();
+ changeVocab(Settings::defaultFile());
}
@@ -439,12 +421,4 @@ void KLatinVocab::changeVocab(QString fi
PercentageLabel->setText(0);
- // Load stuff from config file
- QString countrycode = KGlobal::locale()->language();
- if (countrycode.left(2) == "en")
- countrycode = "en";
-
- //QString fileDir = locate("data", "klatin/data/vocabs/");
- //fileDir += countrycode;
- //ParseVocab(locate("data", fileDir + "/" + filename));
ParseVocab(filename);
}
--- kdeedu/klatin/klatin/klatinvocab.h #1.15:1.16
@@ -46,6 +46,4 @@ public:
/// Show the results dialog
void ResultsDialog();
- /// Reset all variables to defaults
- void Reset();
/// Shuffle the words into a random sequence
void CreateRandomSequence();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic