|
|
@ -29,16 +29,16 @@
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
TQPtrList<KGrCollection> & gamesList, KGrGame * theGame,
|
|
|
|
TQPtrList<KGrCollection> & gamesList, KGrGame * theGame,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: TQDialog (tqparent, name, TRUE,
|
|
|
|
: TQDialog (parent, name, TRUE,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
TQPtrList<KGrCollection> & gamesList, KGrGame * theGame,
|
|
|
|
TQPtrList<KGrCollection> & gamesList, KGrGame * theGame,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Select Game"),
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Select Game"),
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
|
|
|
|
KDialogBase::Ok, tqparent, name)
|
|
|
|
KDialogBase::Ok, parent, name)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
slAction = action;
|
|
|
|
slAction = action;
|
|
|
@ -47,7 +47,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
collections = gamesList;
|
|
|
|
collections = gamesList;
|
|
|
|
game = theGame;
|
|
|
|
game = theGame;
|
|
|
|
collection = collections.at(defaultGame);
|
|
|
|
collection = collections.at(defaultGame);
|
|
|
|
slParent = tqparent;
|
|
|
|
slParent = parent;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
int margin = 10;
|
|
|
|
int margin = 10;
|
|
|
@ -117,7 +117,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2);
|
|
|
|
grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2);
|
|
|
|
|
|
|
|
|
|
|
|
// Set thumbnail cell size to about 1/5 of game cell size.
|
|
|
|
// Set thumbnail cell size to about 1/5 of game cell size.
|
|
|
|
int cellSize = tqparent->width() / (5 * (FIELDWIDTH + 4));
|
|
|
|
int cellSize = parent->width() / (5 * (FIELDWIDTH + 4));
|
|
|
|
thumbNail-> setFixedWidth ((FIELDWIDTH * cellSize) + 2);
|
|
|
|
thumbNail-> setFixedWidth ((FIELDWIDTH * cellSize) + 2);
|
|
|
|
thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2);
|
|
|
|
thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2);
|
|
|
|
|
|
|
|
|
|
|
@ -130,10 +130,10 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
|
|
|
|
OK = new TQPushButton (i18n("&OK"), buttons);
|
|
|
|
OK = new TQPushButton (i18n("&OK"), buttons);
|
|
|
|
CANCEL = new TQPushButton (i18n("&Cancel"), buttons);
|
|
|
|
CANCEL = new TQPushButton (i18n("&Cancel"), buttons);
|
|
|
|
|
|
|
|
|
|
|
|
TQPoint p = tqparent->mapToGlobal (TQPoint (0,0));
|
|
|
|
TQPoint p = parent->mapToGlobal (TQPoint (0,0));
|
|
|
|
|
|
|
|
|
|
|
|
// Base the tqgeometry of the dialog box on the playing area.
|
|
|
|
// Base the tqgeometry of the dialog box on the playing area.
|
|
|
|
int cell = tqparent->width() / (FIELDWIDTH + 4);
|
|
|
|
int cell = parent->width() / (FIELDWIDTH + 4);
|
|
|
|
dad-> move (p.x()+2*cell, p.y()+2*cell);
|
|
|
|
dad-> move (p.x()+2*cell, p.y()+2*cell);
|
|
|
|
dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell);
|
|
|
|
dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell);
|
|
|
|
|
|
|
|
|
|
|
@ -486,15 +486,15 @@ void KGrSLDialog::slotHelp ()
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
|
|
|
|
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: TQDialog (tqparent, name, TRUE,
|
|
|
|
: TQDialog (parent, name, TRUE,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
|
|
|
|
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"),
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"),
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok, tqparent, name)
|
|
|
|
KDialogBase::Ok, parent, name)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
@ -538,8 +538,8 @@ KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Base the tqgeometry of the text box on the playing area.
|
|
|
|
// Base the tqgeometry of the text box on the playing area.
|
|
|
|
TQPoint p = tqparent->mapToGlobal (TQPoint (0,0));
|
|
|
|
TQPoint p = parent->mapToGlobal (TQPoint (0,0));
|
|
|
|
int c = tqparent->width() / (FIELDWIDTH + 4);
|
|
|
|
int c = parent->width() / (FIELDWIDTH + 4);
|
|
|
|
dad-> move (p.x()+4*c, p.y()+4*c);
|
|
|
|
dad-> move (p.x()+4*c, p.y()+4*c);
|
|
|
|
mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c);
|
|
|
|
mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c);
|
|
|
|
|
|
|
|
|
|
|
@ -573,16 +573,16 @@ KGrNHDialog::~KGrNHDialog()
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
KGrECDialog::KGrECDialog (int action, int collnIndex,
|
|
|
|
KGrECDialog::KGrECDialog (int action, int collnIndex,
|
|
|
|
TQPtrList<KGrCollection> & gamesList,
|
|
|
|
TQPtrList<KGrCollection> & gamesList,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: TQDialog (tqparent, name, TRUE,
|
|
|
|
: TQDialog (parent, name, TRUE,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
KGrECDialog::KGrECDialog (int action, int collnIndex,
|
|
|
|
KGrECDialog::KGrECDialog (int action, int collnIndex,
|
|
|
|
TQPtrList<KGrCollection> & gamesList,
|
|
|
|
TQPtrList<KGrCollection> & gamesList,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"),
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"),
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok, tqparent, name)
|
|
|
|
KDialogBase::Ok, parent, name)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
collections = gamesList;
|
|
|
|
collections = gamesList;
|
|
|
@ -640,10 +640,10 @@ KGrECDialog::KGrECDialog (int action, int collnIndex,
|
|
|
|
OK = new TQPushButton (i18n("&OK"), buttons);
|
|
|
|
OK = new TQPushButton (i18n("&OK"), buttons);
|
|
|
|
CANCEL = new TQPushButton (i18n("&Cancel"), buttons);
|
|
|
|
CANCEL = new TQPushButton (i18n("&Cancel"), buttons);
|
|
|
|
|
|
|
|
|
|
|
|
TQPoint p = tqparent->mapToGlobal (TQPoint (0,0));
|
|
|
|
TQPoint p = parent->mapToGlobal (TQPoint (0,0));
|
|
|
|
|
|
|
|
|
|
|
|
// Base the tqgeometry of the dialog box on the playing area.
|
|
|
|
// Base the tqgeometry of the dialog box on the playing area.
|
|
|
|
int cell = tqparent->width() / (FIELDWIDTH + 4);
|
|
|
|
int cell = parent->width() / (FIELDWIDTH + 4);
|
|
|
|
dad-> move (p.x()+2*cell, p.y()+2*cell);
|
|
|
|
dad-> move (p.x()+2*cell, p.y()+2*cell);
|
|
|
|
dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell);
|
|
|
|
dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -750,16 +750,16 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');}
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
KGrLGDialog::KGrLGDialog (TQFile * savedGames,
|
|
|
|
KGrLGDialog::KGrLGDialog (TQFile * savedGames,
|
|
|
|
TQPtrList<KGrCollection> & collections,
|
|
|
|
TQPtrList<KGrCollection> & collections,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: TQDialog (tqparent, name, TRUE,
|
|
|
|
: TQDialog (parent, name, TRUE,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
KGrLGDialog::KGrLGDialog (TQFile * savedGames,
|
|
|
|
KGrLGDialog::KGrLGDialog (TQFile * savedGames,
|
|
|
|
TQPtrList<KGrCollection> & collections,
|
|
|
|
TQPtrList<KGrCollection> & collections,
|
|
|
|
TQWidget * tqparent, const char * name)
|
|
|
|
TQWidget * parent, const char * name)
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"),
|
|
|
|
: KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"),
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok | KDialogBase::Cancel,
|
|
|
|
KDialogBase::Ok, tqparent, name)
|
|
|
|
KDialogBase::Ok, parent, name)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
@ -803,8 +803,8 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames,
|
|
|
|
dad-> setCaption (i18n("Select Saved Game"));
|
|
|
|
dad-> setCaption (i18n("Select Saved Game"));
|
|
|
|
|
|
|
|
|
|
|
|
// Base the tqgeometry of the list box on the playing area.
|
|
|
|
// Base the tqgeometry of the list box on the playing area.
|
|
|
|
TQPoint p = tqparent->mapToGlobal (TQPoint (0,0));
|
|
|
|
TQPoint p = parent->mapToGlobal (TQPoint (0,0));
|
|
|
|
int c = tqparent->width() / (FIELDWIDTH + 4);
|
|
|
|
int c = parent->width() / (FIELDWIDTH + 4);
|
|
|
|
dad-> move (p.x()+2*c, p.y()+2*c);
|
|
|
|
dad-> move (p.x()+2*c, p.y()+2*c);
|
|
|
|
lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c);
|
|
|
|
lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c);
|
|
|
|
OK-> setMaximumWidth (4*c);
|
|
|
|
OK-> setMaximumWidth (4*c);
|
|
|
@ -858,26 +858,26 @@ void KGrLGDialog::lgSelect (int n)
|
|
|
|
*********************** CENTRALISED MESSAGE FUNCTIONS ************************
|
|
|
|
*********************** CENTRALISED MESSAGE FUNCTIONS ************************
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void KGrMessage::information (TQWidget * tqparent, const TQString &caption, const TQString &text)
|
|
|
|
void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
// Force TQt to do word-wrapping (but it ignores "\n" line-breaks).
|
|
|
|
// Force TQt to do word-wrapping (but it ignores "\n" line-breaks).
|
|
|
|
TQMessageBox::information (tqparent, caption,
|
|
|
|
TQMessageBox::information (parent, caption,
|
|
|
|
"<qt>" + text + "</qt>");
|
|
|
|
"<qt>" + text + "</qt>");
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
// KDE does word-wrapping and will observe "\n" line-breaks.
|
|
|
|
// KDE does word-wrapping and will observe "\n" line-breaks.
|
|
|
|
KMessageBox::information (tqparent, text, caption);
|
|
|
|
KMessageBox::information (parent, text, caption);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int KGrMessage::warning (TQWidget * tqparent, TQString caption, TQString text,
|
|
|
|
int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text,
|
|
|
|
TQString label0, TQString label1, TQString label2)
|
|
|
|
TQString label0, TQString label1, TQString label2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int ans = 0;
|
|
|
|
int ans = 0;
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
#ifdef KGR_PORTABLE
|
|
|
|
// Display a box with 2 or 3 buttons, depending on if label2 is empty or not.
|
|
|
|
// Display a box with 2 or 3 buttons, depending on if label2 is empty or not.
|
|
|
|
// Force TQt to do word-wrapping (but it ignores "\n" line-breaks).
|
|
|
|
// Force TQt to do word-wrapping (but it ignores "\n" line-breaks).
|
|
|
|
ans = TQMessageBox::warning (tqparent, caption,
|
|
|
|
ans = TQMessageBox::warning (parent, caption,
|
|
|
|
"<qt>" + text + "</qt>",
|
|
|
|
"<qt>" + text + "</qt>",
|
|
|
|
label0, label1, label2,
|
|
|
|
label0, label1, label2,
|
|
|
|
0, (label2.isEmpty()) ? 1 : 2);
|
|
|
|
0, (label2.isEmpty()) ? 1 : 2);
|
|
|
@ -885,13 +885,13 @@ int KGrMessage::warning (TQWidget * tqparent, TQString caption, TQString text,
|
|
|
|
// KDE does word-wrapping and will observe "\n" line-breaks.
|
|
|
|
// KDE does word-wrapping and will observe "\n" line-breaks.
|
|
|
|
if (label2.isEmpty()) {
|
|
|
|
if (label2.isEmpty()) {
|
|
|
|
// Display a box with 2 buttons.
|
|
|
|
// Display a box with 2 buttons.
|
|
|
|
ans = KMessageBox::questionYesNo (tqparent, text, caption,
|
|
|
|
ans = KMessageBox::questionYesNo (parent, text, caption,
|
|
|
|
label0, label1);
|
|
|
|
label0, label1);
|
|
|
|
ans = (ans == KMessageBox::Yes) ? 0 : 1;
|
|
|
|
ans = (ans == KMessageBox::Yes) ? 0 : 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// Display a box with 3 buttons.
|
|
|
|
// Display a box with 3 buttons.
|
|
|
|
ans = KMessageBox::questionYesNoCancel (tqparent, text, caption,
|
|
|
|
ans = KMessageBox::questionYesNoCancel (parent, text, caption,
|
|
|
|
label0, label1);
|
|
|
|
label0, label1);
|
|
|
|
if (ans == KMessageBox::Cancel)
|
|
|
|
if (ans == KMessageBox::Cancel)
|
|
|
|
ans = 2;
|
|
|
|
ans = 2;
|
|
|
@ -906,12 +906,12 @@ int KGrMessage::warning (TQWidget * tqparent, TQString caption, TQString text,
|
|
|
|
/********************** WORD-WRAPPED MESSAGE BOX ************************/
|
|
|
|
/********************** WORD-WRAPPED MESSAGE BOX ************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void KGrMessage::wrapped (TQWidget * tqparent, TQString title, TQString contents)
|
|
|
|
void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifndef KGR_PORTABLE
|
|
|
|
#ifndef KGR_PORTABLE
|
|
|
|
KMessageBox::information (tqparent, contents, title);
|
|
|
|
KMessageBox::information (parent, contents, title);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
TQDialog * mm = new TQDialog (tqparent, "wrappedMessage", TRUE,
|
|
|
|
TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title);
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title);
|
|
|
|
|
|
|
|
|
|
|
|
int margin = 10;
|
|
|
|
int margin = 10;
|
|
|
@ -943,8 +943,8 @@ void KGrMessage::wrapped (TQWidget * tqparent, TQString title, TQString contents
|
|
|
|
mm-> setCaption (title);
|
|
|
|
mm-> setCaption (title);
|
|
|
|
|
|
|
|
|
|
|
|
// Base the tqgeometry of the text box on the playing area.
|
|
|
|
// Base the tqgeometry of the text box on the playing area.
|
|
|
|
TQPoint p = tqparent->mapToGlobal (TQPoint (0,0));
|
|
|
|
TQPoint p = parent->mapToGlobal (TQPoint (0,0));
|
|
|
|
int c = tqparent->width() / (FIELDWIDTH + 4);
|
|
|
|
int c = parent->width() / (FIELDWIDTH + 4);
|
|
|
|
mm-> move (p.x()+4*c, p.y()+4*c);
|
|
|
|
mm-> move (p.x()+4*c, p.y()+4*c);
|
|
|
|
mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c);
|
|
|
|
mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c);
|
|
|
|
OK-> setMaximumWidth (3*c);
|
|
|
|
OK-> setMaximumWidth (3*c);
|
|
|
|