Commit 1cf2936c authored by Nicolas Hadacek's avatar Nicolas Hadacek
Browse files

some fixes

svn path=/trunk/kdegames/kmines/; revision=46620
parent 57479adf
2.0.4
* hack to resize correctly when menu is hidden (due to bugs
in KTMainWindow)
* nicer (and simpler) custom level with KNumIntInput
2.0.3
* use kkeydialog for actions
* rationalize settings (much better now)
* animate autoreveal with keyboard
* enable/disable and change text for pause in menu
* configuration of mouse bindings [idea of FX Duranceau]
* hack to resize correctly when menu is hidden (due to limitation
in KTMainWindow) (still broken ...)
* nicer custom level dialog (well it is broken ...)
2.0.2
* XMLify the GUI
......
......@@ -5,5 +5,4 @@ IDEAS:
KNOWN BUGS:
* occasionnal X BadMatch error in highscore (KDialogBase bug ?)
* none !
......@@ -140,27 +140,32 @@ CustomDialog::CustomDialog(Level &_lev, QWidget *parent)
km = new KIntNumInput(lev.nbMines, plainPage());
connect(km, SIGNAL(valueChanged(int)), SLOT(nbMinesChanged(int)));
top->addWidget(km);
nbMinesChanged(lev.nbMines);
updateNbMines();
}
void CustomDialog::widthChanged(int n)
{
lev.width = (uint)n;
nbMinesChanged(lev.nbMines);
updateNbMines();
}
void CustomDialog::heightChanged(int n)
{
lev.height = (uint)n;
nbMinesChanged(lev.nbMines);
updateNbMines();
}
void CustomDialog::nbMinesChanged(int n)
{
lev.nbMines = (uint)n;
updateNbMines();
}
void CustomDialog::updateNbMines()
{
uint nb = lev.width * lev.height;
km->setRange(1, nb - 2);
km->setLabel(i18n("Mines (%1%)").arg(100*n/nb));
km->setLabel(i18n("Mines (%1%)").arg(100*lev.nbMines/nb));
enableButton(Ok, lev.width!=initLev.width || lev.height!=initLev.height
|| lev.nbMines!=initLev.nbMines);
}
......
......@@ -103,7 +103,9 @@ class CustomDialog : public DialogBase
private:
KIntNumInput *km;
Level &lev, &initLev;
Level &lev, initLev;
void updateNbMines();
};
//-----------------------------------------------------------------------------
......
......@@ -22,7 +22,9 @@ Field::Field(QWidget *parent, const char *name)
connect(pb, SIGNAL(clicked()), this, SLOT(resume()));
top->addStretch(1);
setFont( QFont("Helvetica", 14, QFont::Bold) );
QFont f = font();
f.setBold(true);
setFont(f);
readSettings();
}
......
......@@ -94,6 +94,7 @@ MainWidget::MainWidget()
createGUI();
readSettings();
setView(status);
updateRects(); // #### should be in KTMainWindow::setView
}
#define MENUBAR_ACTION \
......@@ -107,9 +108,11 @@ void MainWidget::readSettings()
{
GameType type = OptionDialog::readLevel();
levelAction[type]->setChecked(TRUE);
status->newGame(type);
bool visible = OptionDialog::readMenuVisible();
MENUBAR_ACTION->setChecked(visible);
toggleMenubar();
setKeyboardEnabled( OptionDialog::readKeyboard() );
}
......@@ -145,6 +148,7 @@ void MainWidget::toggleMenubar()
if (b) menuBar()->show();
else {
menuBar()->hide();
// #### sort of hack : because KTMainWindow does not manage correctly
// main widget with a fixed layout
updateRects();
......
#define VERSION "2.0.2"
#define LONG_VERSION "2.0.2 (11 Apr 2000)"
#define VERSION "2.0.4"
#define LONG_VERSION "2.0.4 (14 Apr 2000)"
#define COPYLEFT "(c) 1996-2000, Nicolas Hadacek"
#define HOMEPAGE "http://azhyd.free.fr/KDE/kmines.php3"
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