Congratulations to all those implementing the
GUI-independent code. I've got a KDE Copyright label!!!

Looking at the code, however, it strikes me that the text
of the labels should be defined in a class from which the
different front-ends pop-ups are derived. This
should ease maintenance when there are many front
ends. Apologies for stating the obvious.

Best wishes,
Angus


Something like:
#ifndef COPYRIGHTLABELS_H
#define COPYRIGHTLABELS_H

class CopyrightLabels
{
 public:
  static char const* const WhoText() { return who; }
  static char const* const GnuText() { return gnu; }
  static char const* const LyxText() { return lyx; }

 private:
  static char const* const who = "LyX is Copyright (C) 1995 by Matthias Ettrich, 
\n1995-2000 LyX Team";

  static char const* const gnu = "This program is free software; you can redistribute 
it\nand/or modify it under the terms of the GNU General\nPublic License as published 
by the Free Software\nFoundation; either version 2 of the License, or\n(at your 
option) any later version.";

  static char const* const lyx = "LyX is distributed in the hope that it will\nbe 
useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of 
MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public 
License for more details.\nYou should have received a copy of\nthe GNU General Public 
License\nalong with this program; if not, write to\nthe Free Software Foundation, 
Inc., \n675 Mass Ave, Cambridge, MA 02139, USA.";
};

#endif // COPYRIGHTLABELS_H


Implemented as(in the kde front end):

In formcopyrightdialog.h

#include "copyrightLabels.h"
class FormCopyrightDialog : public QDialog, public
CopyrightLabels { ...
}

In formcopyrightdialog.C

void  FormCopyrightDialog::initDialog(){
...
  labelWho->setText(WhoText());
...
  labelGNU->setText(GnuText());
...
  labelLyX->setText(LyxText());
...
}

Reply via email to