-rw-r--r-- | korganizer/koeventviewer.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 64eb4ff..3df667f 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -13,56 +13,59 @@ | |||
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | #ifndef KOEVENTVIEWER_H | 19 | #ifndef KOEVENTVIEWER_H |
20 | #define KOEVENTVIEWER_H | 20 | #define KOEVENTVIEWER_H |
21 | // | 21 | // |
22 | // Viewer widget for events. | 22 | // Viewer widget for events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextbrowser.h> | 25 | #include <q3textbrowser.h> |
26 | //Added by qt3to4: | ||
27 | #include <Q3VBoxLayout> | ||
28 | #include <QKeyEvent> | ||
26 | 29 | ||
27 | #include <libkcal/event.h> | 30 | #include <libkcal/event.h> |
28 | #include <libkcal/journal.h> | 31 | #include <libkcal/journal.h> |
29 | 32 | ||
30 | 33 | ||
31 | using namespace KCal; | 34 | using namespace KCal; |
32 | 35 | ||
33 | #ifdef DESKTOP_VERSION | 36 | #ifdef DESKTOP_VERSION |
34 | 37 | ||
35 | #include <qradiobutton.h> | 38 | #include <qradiobutton.h> |
36 | #include <qpushbutton.h> | 39 | #include <qpushbutton.h> |
37 | #include <qlayout.h> | 40 | #include <qlayout.h> |
38 | #include <qdialog.h> | 41 | #include <qdialog.h> |
39 | #include <qlabel.h> | 42 | #include <qlabel.h> |
40 | #include <qbuttongroup.h> | 43 | #include <q3buttongroup.h> |
41 | #include <kglobal.h> | 44 | #include <kglobal.h> |
42 | 45 | ||
43 | class KOPrintPrefs : public QDialog | 46 | class KOPrintPrefs : public QDialog |
44 | { | 47 | { |
45 | public: | 48 | public: |
46 | KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : | 49 | KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : |
47 | QDialog( parent, name, true ) | 50 | QDialog( parent, name, true ) |
48 | { | 51 | { |
49 | setCaption( i18n("KO/Pi Printout") ); | 52 | setCaption( i18n("KO/Pi Printout") ); |
50 | QVBoxLayout* lay = new QVBoxLayout( this ); | 53 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
51 | lay->setSpacing( 9 ); | 54 | lay->setSpacing( 9 ); |
52 | lay->setMargin( 9 ); | 55 | lay->setMargin( 9 ); |
53 | QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); | 56 | QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); |
54 | lay->addWidget( lab ); | 57 | lay->addWidget( lab ); |
55 | lab->setAlignment( AlignCenter ); | 58 | lab->setAlignment( Qt::AlignCenter ); |
56 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); | 59 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this ); |
57 | lay->addWidget( format ); | 60 | lay->addWidget( format ); |
58 | format->setExclusive ( true ) ; | 61 | format->setExclusive ( true ) ; |
59 | pmNo = new QRadioButton(i18n("Print unscaled"), format ); | 62 | pmNo = new QRadioButton(i18n("Print unscaled"), format ); |
60 | pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); | 63 | pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); |
61 | new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); | 64 | new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); |
62 | pmScaledDown->setChecked( true ); | 65 | pmScaledDown->setChecked( true ); |
63 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 66 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
64 | lay->addWidget( ok ); | 67 | lay->addWidget( ok ); |
65 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 68 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
66 | lay->addWidget( cancel ); | 69 | lay->addWidget( cancel ); |
67 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 70 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
68 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 71 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
@@ -74,25 +77,25 @@ class KOPrintPrefs : public QDialog | |||
74 | return 0; | 77 | return 0; |
75 | if ( pmScaledDown->isChecked() ) | 78 | if ( pmScaledDown->isChecked() ) |
76 | return 1; | 79 | return 1; |
77 | return 2; | 80 | return 2; |
78 | } | 81 | } |
79 | private: | 82 | private: |
80 | QRadioButton* pmNo; | 83 | QRadioButton* pmNo; |
81 | QRadioButton* pmScaledDown; | 84 | QRadioButton* pmScaledDown; |
82 | }; | 85 | }; |
83 | 86 | ||
84 | #endif | 87 | #endif |
85 | 88 | ||
86 | class KOEventViewer : public QTextBrowser { | 89 | class KOEventViewer : public Q3TextBrowser { |
87 | Q_OBJECT | 90 | Q_OBJECT |
88 | public: | 91 | public: |
89 | KOEventViewer(QWidget *parent=0,const char *name=0); | 92 | KOEventViewer(QWidget *parent=0,const char *name=0); |
90 | virtual ~KOEventViewer(); | 93 | virtual ~KOEventViewer(); |
91 | 94 | ||
92 | void setSource(const QString &); | 95 | void setSource(const QString &); |
93 | void setEvent(Event *event); | 96 | void setEvent(Event *event); |
94 | void addEvent(Event *event); | 97 | void addEvent(Event *event); |
95 | void setTodo(Todo *event, bool clearV = true ); | 98 | void setTodo(Todo *event, bool clearV = true ); |
96 | void setJournal(Journal *jour, bool clearV = true ); | 99 | void setJournal(Journal *jour, bool clearV = true ); |
97 | 100 | ||
98 | void appendEvent(Event *event, int mode = 0 ); | 101 | void appendEvent(Event *event, int mode = 0 ); |
@@ -108,25 +111,25 @@ class KOEventViewer : public QTextBrowser { | |||
108 | void printMe(); | 111 | void printMe(); |
109 | 112 | ||
110 | protected: | 113 | protected: |
111 | int mColorMode; | 114 | int mColorMode; |
112 | void addTag(const QString & tag,const QString & text); | 115 | void addTag(const QString & tag,const QString & text); |
113 | 116 | ||
114 | void formatCategories(Incidence *event); | 117 | void formatCategories(Incidence *event); |
115 | void formatAttendees(Incidence *event); | 118 | void formatAttendees(Incidence *event); |
116 | void formatReadOnly(Incidence *event); | 119 | void formatReadOnly(Incidence *event); |
117 | void keyPressEvent ( QKeyEvent * e ); | 120 | void keyPressEvent ( QKeyEvent * e ); |
118 | 121 | ||
119 | private: | 122 | private: |
120 | QTextBrowser *mEventTextView; | 123 | Q3TextBrowser *mEventTextView; |
121 | bool mSyncMode; | 124 | bool mSyncMode; |
122 | QString deTag(QString text); | 125 | QString deTag(QString text); |
123 | 126 | ||
124 | QString mText; | 127 | QString mText; |
125 | QString mMailSubject; | 128 | QString mMailSubject; |
126 | Incidence* mCurrentIncidence; | 129 | Incidence* mCurrentIncidence; |
127 | signals: | 130 | signals: |
128 | void launchaddressbook(QString uid); | 131 | void launchaddressbook(QString uid); |
129 | void showIncidence(QString uid); | 132 | void showIncidence(QString uid); |
130 | }; | 133 | }; |
131 | 134 | ||
132 | #endif | 135 | #endif |