21 #include <tdeuniqueapplication.h>
22 #include <tdecmdlineargs.h>
23 #include <tdeaboutdata.h>
24 #include <tdelocale.h>
25 #include <kxerrorhandler.h>
28 #include <X11/Xatom.h>
30 #include "knotesapp.h"
35 void remove_sm_from_client_leader()
39 unsigned long nitems = 0;
40 unsigned long extra = 0;
41 unsigned char *data = 0;
44 char *atom_names[ 2 ] = { ( char*) "WM_CLIENT_LEADER", ( char*) "SM_CLIENT_ID" };
46 XInternAtoms( tqt_xdisplay(), atom_names, 2, False, atoms );
49 KXErrorHandler handler;
50 status = XGetWindowProperty( tqt_xdisplay(), w.winId(), atoms[ 0 ], 0, 10000,
51 FALSE, XA_WINDOW, &type, &format,
52 &nitems, &extra, &data );
54 if (status == Success && !handler.error( false ))
56 if (data && nitems > 0)
58 Window leader = *((Window*) data);
59 XDeleteProperty( tqt_xdisplay(), leader, atoms[ 1 ] );
66 Application::Application()
67 : TDEUniqueApplication(), mMainWindow( 0 )
71 Application::~Application()
76 int Application::newInstance()
80 mMainWindow = new KNotesApp();
84 mMainWindow->newNote();
86 return TDEUniqueApplication::newInstance();
89 int main( int argc, char* argv[] )
91 TQString version = TQString::number( KNOTES_VERSION );
93 TDEAboutData aboutData(
97 I18N_NOOP( "TDE Notes" ),
98 TDEAboutData::License_GPL,
99 I18N_NOOP( "(c) 1997-2006, The KNotes Developers")
102 aboutData.addAuthor( "Michael Brade", I18N_NOOP( "Maintainer"), "brade@kde.org");
103 aboutData.addAuthor( "Bernd Johannes Wuebben", I18N_NOOP( "Original KNotes Author"), "wuebben@kde.org");
104 aboutData.addAuthor( "Wynn Wilkes", I18N_NOOP( "Ported KNotes to KDE 2"), "wynnw@calderasystems.com");
105 aboutData.addAuthor( "Daniel Martin", I18N_NOOP( "Network Interface"), "daniel.martin@pirack.com");
106 aboutData.addAuthor( "Bo Thorsen", I18N_NOOP( "Started KDE Resource Framework Integration"), "bo@sonofthor.dk");
108 aboutData.addCredit( "Bera Debajyoti", I18N_NOOP( "Idea and initial code for the new look&feel"),
109 "debajyotibera@gmail.com");
110 aboutData.addCredit( "Matthias Ettrich", 0, "ettrich@kde.org");
111 aboutData.addCredit( "David Faure", 0, "faure@kde.org");
112 aboutData.addCredit( "Matthias Kiefer", 0, "kiefer@kde.org");
113 aboutData.addCredit( "Luboš Luňák", 0, "l.lunak@kde.org");
114 aboutData.addCredit( "Laurent Montel", 0, "montel@kde.org");
115 aboutData.addCredit( "Dirk A. Mueller", 0, "dmuell@gmx.net");
116 aboutData.addCredit( "Carsten Pfeiffer", 0, "pfeiffer@kde.org");
117 aboutData.addCredit( "Harri Porten", 0, "porten@kde.org");
118 aboutData.addCredit( "Espen Sand", 0, "espen@kde.org");
120 TDECmdLineArgs::init( argc, argv, &aboutData );
122 TDEUniqueApplication::addCmdLineOptions();
125 app.connect( &app, TQ_SIGNAL( lastWindowClosed() ), &app, TQ_SLOT( quit() ) );
127 remove_sm_from_client_leader();
129 int rval = app.exec();
|