summaryrefslogtreecommitdiff
path: root/examples/simple-pim/simple.cpp
Side-by-side diff
Diffstat (limited to 'examples/simple-pim/simple.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/simple-pim/simple.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/examples/simple-pim/simple.cpp b/examples/simple-pim/simple.cpp
index 50905bf..efd5070 100644
--- a/examples/simple-pim/simple.cpp
+++ b/examples/simple-pim/simple.cpp
@@ -1,50 +1,60 @@
+/* We use a sane order of include files, from the most special to the least special
+ That helps to reduce the number of implicit includes hence increases the reuse */
+
+/* First the local include files */
+#include "simple.h"
+
+/* Then the Ope include files.
+This includes qpe stuff which will eventually be merged with libopie2 */
+#include <opie2/odebug.h> // for odebug streams
+#include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching
+#include <opie2/otabwidget.h>
+#include <opie2/owait.h>
+#include <qpe/qpeapplication.h> // the QPEApplication
+#include <qpe/resource.h>
+#include <qpe/sound.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/datebookmonth.h>
+#include <qpe/timestring.h>
+using namespace Opie::Core;
+
+/* Now the Qt includes */
#include <qaction.h> // action
#include <qmenubar.h> // menubar
#include <qtoolbar.h> // toolbar
#include <qlabel.h> // a label
#include <qpushbutton.h> // the header file for the QPushButton
#include <qlayout.h>
#include <qtimer.h> // we use it for the singleShot
#include <qdatetime.h> // for QDate
#include <qtextview.h> // a rich text widget
#include <qdialog.h>
#include <qwhatsthis.h> // for whats this
-#include <qpe/qpeapplication.h> // the QPEApplication
-#include <qpe/resource.h>
-#include <qpe/sound.h>
-#include <qpe/qcopenvelope_qws.h>
-#include <qpe/datebookmonth.h>
-#include <qpe/timestring.h>
-
-#include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching
-#include <opie2/otabwidget.h>
-#include <opie2/owait.h>
-
-#include "simple.h"
+/* Add standard includes here if you need some
+ Examples are: stdlib.h, socket.h, etc. */
/*
* implementation of simple
*/
/*
* The factory is used for quicklaunching
* It needs a constructor ( c'tor ) with at least QWidget, const char* and WFlags as parameter and a static QString appName() matching the TARGET of the .pro
*
* Depending on the global quick launch setting this will create
* either a main method or one for our component plugin system
*/
-using namespace Opie::Core;
OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl ) {
setCaption(tr("My MainWindow") );
m_desktopChannel = 0;
m_loading = 0;
initUI();
@@ -295,25 +305,25 @@ void MainWindow::slotShowRecord( const Opie::OPimRecord& rec) {
dia->showMaximized();
QPEApplication::execDialog( dia );
delete dia;
}
void MainWindow::slotDate() {
/*
* called by the action we will show a Popup
* at the current mouse position with a DateChooser
* to select the day
*/
- qWarning("slot Date");
+ odebug << "slot Date" << oendl;
QPopupMenu *menu = new QPopupMenu();
/* A Month to select a date from TRUE for auto close */
DateBookMonth *month = new DateBookMonth(menu, 0, true );
connect(month, SIGNAL(dateClicked(int,int,int) ),
this, SLOT(slotLoadForDay(int,int,int) ) );
menu->insertItem( month );
menu->exec( QCursor::pos() );
/*
* we do not need to delete month because