-rw-r--r-- | library/categoryselect.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/library/categoryselect.h b/library/categoryselect.h index 5c6b565..7a8e491 100644 --- a/library/categoryselect.h +++ b/library/categoryselect.h | |||
@@ -35,9 +35,10 @@ class CategoryCombo : public QComboBox | |||
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | CategoryCombo( QWidget *parent, const char* name = 0 ); | 39 | CategoryCombo( QWidget *parent, const char* name = 0, int width=0); |
40 | |||
40 | ~CategoryCombo(); | 41 | ~CategoryCombo(); |
41 | 42 | ||
42 | int currentCategory() const; | 43 | int currentCategory() const; |
43 | void setCurrentCategory( int id ); | 44 | void setCurrentCategory( int id ); |
@@ -45,8 +46,10 @@ public: | |||
45 | void initCombo( const QArray<int> &recCats, const QString &appName ); | 46 | void initCombo( const QArray<int> &recCats, const QString &appName ); |
46 | void initCombo( const QArray<int> &recCats, const QString &appName, | 47 | void initCombo( const QArray<int> &recCats, const QString &appName, |
47 | const QString &visibleName /* = appName */ ); | 48 | const QString &visibleName /* = appName */ ); |
48 | 49 | ||
50 | QArray<int> initComboWithRefind( const QArray<int> &recCats, const QString &appName ); | ||
51 | |||
49 | signals: | 52 | signals: |
50 | void sigCatChanged( int newUid ); | 53 | void sigCatChanged( int newUid ); |
51 | 54 | ||
52 | private slots: | 55 | private slots: |
@@ -64,41 +67,46 @@ class CategorySelect : public QHBox | |||
64 | { | 67 | { |
65 | Q_OBJECT | 68 | Q_OBJECT |
66 | public: | 69 | public: |
67 | // we need two constructors, the first gets around designer limitations | 70 | // we need two constructors, the first gets around designer limitations |
68 | CategorySelect( QWidget *parent = 0, const char *name = 0 ); | 71 | |
72 | CategorySelect( QWidget *parent = 0, const char *name = 0, int width = 0 ); | ||
69 | 73 | ||
70 | CategorySelect( const QArray<int> &vlCats, const QString &appName, | 74 | CategorySelect( const QArray<int> &vlCats, const QString &appName, |
71 | QWidget *parent = 0, const char *name = 0 ); | 75 | QWidget *parent = 0, const char *name = 0, |
76 | int width = 0); | ||
72 | CategorySelect( const QArray<int> &vlCats, const QString &appName, | 77 | CategorySelect( const QArray<int> &vlCats, const QString &appName, |
73 | const QString &visibleName, QWidget *parent = 0, | 78 | const QString &visibleName, QWidget *parent = 0, |
74 | const char *name = 0 ); | 79 | const char *name = 0 , int width = 0); |
80 | |||
75 | ~CategorySelect(); | 81 | ~CategorySelect(); |
76 | 82 | ||
77 | const QArray<int> ¤tCategories() const; | 83 | const QArray<int> ¤tCategories() const; |
78 | int currentCategory() const; | 84 | int currentCategory() const; |
79 | void setCurrentCategory( int newCatUid ); | 85 | void setCurrentCategory( int newCatUid ); |
80 | // pretty much if you don't set it the constructor, you need to | 86 | // pretty much if you don't set it the constructor, you need to |
81 | // call it here ASAP! | 87 | // call it here ASAP! |
82 | // however this call is depreciated... | 88 | // however this call is depreciated... |
83 | void setCategories( const QArray<int> &vlCats, const QString &appName ); | ||
84 | // use this one instead (for translating ) | ||
85 | void setCategories( const QArray<int> &vlCats, const QString &appName, | ||
86 | const QString &visibleName ); | ||
87 | 89 | ||
90 | QString setCategories( const QArray<int> &vlCats, const QString &appName ); | ||
91 | QString setCategories( const QArray<int> &vlCats, const QString &appName, | ||
92 | const QString &visibleName ); | ||
88 | // these were added for find dialog. | 93 | // these were added for find dialog. |
89 | void setRemoveCategoryEdit( bool remove ); | 94 | void setRemoveCategoryEdit( bool remove ); |
90 | void setAllCategories( bool add ); | 95 | void setAllCategories( bool add ); |
91 | 96 | ||
97 | void setFixedWidth(int width); | ||
92 | signals: | 98 | signals: |
93 | void signalSelected( int ); | 99 | void signalSelected( int ); |
94 | 100 | ||
95 | private slots: | 101 | private slots: |
96 | void slotDialog(); | 102 | void slotDialog(); |
103 | |||
104 | public slots: | ||
97 | void slotNewCat( int id ); | 105 | void slotNewCat( int id ); |
98 | 106 | ||
99 | private: | 107 | private: |
100 | void init(); | 108 | void init(int width=0); |
101 | QString mStrAppName; | 109 | QString mStrAppName; |
102 | CategoryCombo *cmbCat; | 110 | CategoryCombo *cmbCat; |
103 | QToolButton *cmdCat; | 111 | QToolButton *cmdCat; |
104 | CategorySelectPrivate *d; | 112 | CategorySelectPrivate *d; |