~ubuntu-branches/debian/stretch/linpsk/stretch

« back to all changes in this revision

Viewing changes to src/interfaces/addmacro.ui.h

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-04-10 18:17:27 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050410181727-3l9dnfg0sp7bhk13
Tags: 0.8.1-1
* New upstream release 0.8.1
  * Modified upstream configure.in to support FHS-compliant Qt
    installation! (ie /usr/include/qt3, not /usr/lib/qt3/include) :-(
  * Re-autotools with autoconf2.59 and automake-1.9
* linpsk is no longer a Debian-native package (dsc/tar.gz)
* Now maintained by the debian-hams group
* Switch to debhelper 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** ui.h extension file, included from the uic-generated form implementation.
 
3
**
 
4
** If you wish to add, delete or rename functions or slots use
 
5
** Qt Designer which will update this file, preserving your code. Create an
 
6
** init() function in place of a constructor, and a destroy() function in
 
7
** place of a destructor.
 
8
*****************************************************************************/
 
9
#include "macros.h"
 
10
#include <qmessagebox.h>
 
11
 
 
12
 
 
13
void AddMacro::init()
 
14
{
 
15
}
 
16
 
 
17
 
 
18
void AddMacro::setKeywords( Macros *k )
 
19
{
 
20
int anzahl=k->Keywordcount();  
 
21
if ( anzahl > 0 )
 
22
 for(int i=0; i < anzahl; i++)
 
23
  KeywordDisplay->insertItem(k->getKeyword(i));
 
24
anzahl=k->count();
 
25
Position->setValue(anzahl+1);
 
26
Position->setMaxValue(anzahl+1);
 
27
if (anzahl>0)
 
28
    for (int i=0; i< anzahl;i++)
 
29
      MacroDisplay->insertItem(k->getMacroName(i));
 
30
 
 
31
  
 
32
}
 
33
 
 
34
 
 
35
void AddMacro::checkandaccept()
 
36
{
 
37
if (MacroName->text().length()== 0)
 
38
  {
 
39
    QMessageBox::warning(this,"Incomplete Macro Definition","Name of Macro is missing \n Enter Name of Macro",
 
40
      QMessageBox::Ok,NoButton,NoButton);
 
41
    return;  
 
42
  }
 
43
if (MacroDefinition->text().length()== 0)
 
44
  {
 
45
    QMessageBox::warning(this,"Incomplete Macro Definition","Macrodefinition is missing \n Enter  Macrodefinition",
 
46
      QMessageBox::Ok,NoButton,NoButton);
 
47
    return;
 
48
  }
 
49
int anzahl=MacroDefinition->text().contains('@',true);
 
50
 
 
51
if( (anzahl/2)*2 != anzahl )
 
52
        {
 
53
    QMessageBox::warning(this,"Error in Macro Definition","Error in Macrodefinition. Incorrect number of @  \n Enter  Macrodefinition",
 
54
      QMessageBox::Ok,NoButton,NoButton);
 
55
    return;
 
56
  }
 
57
accept();    
 
58
}