summaryrefslogtreecommitdiffstats
path: root/kbarcode/dsmainwindow.h
blob: c43959bb96d6e14c83b608128dc9438a305f6df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/***************************************************************************
                          dsmainwindow.h  -  description
                             -------------------
    begin                : Fre Jan 17 2003
    copyright            : (C) 2003 by Dominik Seichter
    email                : domseichter@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef DSMAINWINDOW_H
#define DSMAINWINDOW_H

#include <qwidget.h>
#include <kmainwindow.h>

class KAction;
class KPopupMenu;
/** The base class of all main windows of KBarcode. It provides standard menu items
  * for database connections, preferences, help, the first start wizard and donations.
  * It checks also if this is the first start of KBarcode and if the configuration wizard
  * should be started.
  *
  * @author Dominik Seichter
  */
class DSMainWindow : public KMainWindow {
    Q_OBJECT
    public:
        DSMainWindow(QWidget *parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose );
        ~DSMainWindow();

        /** Is this the first start of KBarcode ?
          * If true, the configuration wizard will
          * be started automatically.
          */
        bool isFirstStart() const {
            return first;
        }


        /** Do a system check and return a text
          * informing the user about missing, programs
          * and drivers for barcode support and database
          * access.
          */
        static QString systemCheck();

    public slots:
        void wizard();

    signals:
        void connectedSQL();

    private slots:
        void connectMySQL();
        void appHelpActivated();
        void startInfo();
        bool newTables();
        void donations();
        void showCheck();
        void slotFunctionMap();

    protected slots:
        void loadConfig();
        void saveConfig();

    protected:
        void setupActions();

        static bool autoconnect;
        static bool startwizard;

        bool first;
        
        KAction* connectAct;
        KAction* importLabelDefAct;
        KAction* importExampleAct;
        
        KPopupMenu* file;
        KPopupMenu* settings;
        KPopupMenu* hlpMenu;
};
#endif