summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
blob: 6f27e4159cf82cbf83626ed7923151ece5cdd279 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include <config.h>

#include <tdeaboutdata.h>
#include <tdeapplication.h>
#include <tdecmdlineargs.h>
#include <tdelocale.h>
#include <tdemainwindow.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <dcopclient.h>

#include <tqfileinfo.h>

#include "splashscreen.h"
#include "toplevel.h"
#include "plugincontroller.h"
#include "partcontroller.h"
#include "core.h"
#include "projectmanager.h"

#include "kdevideextension.h"

static TDECmdLineOptions options[] =
{
    { "profile <profile>",	I18N_NOOP("Profile to load"), 0 },
    { "+file(s)",		I18N_NOOP("Files to load"), 0 },
    { 0,0,0 }
};

int main(int argc, char *argv[])
{
  static const char description[] = I18N_NOOP("The TDevelop Integrated Development Environment");
  TDEAboutData aboutData("tdevelop", I18N_NOOP("TDevelop"),
                       VERSION, description, TDEAboutData::License_GPL,
                       I18N_NOOP("(c) 1999-2007, The KDevelop developers"), "", "http://www.kdevelop.org");
  aboutData.addAuthor("Alexander Dymo", I18N_NOOP("Release coordinator, Overall improvements, Pascal support, C++ support, New File and Documentation parts"), "[email protected]");
  aboutData.addAuthor("Amilcar do Carmo Lucas", I18N_NOOP("Release coordinator, API documentation, Doxygen and autoproject patches"), "[email protected]");
  aboutData.addAuthor("David Nolden", I18N_NOOP("Advanced C++ code completion, C++ support, overall improvements"), "[email protected]");
  aboutData.addAuthor("Bernd Gehrmann", I18N_NOOP("Initial idea, basic architecture, much initial source code"), "[email protected]");
  aboutData.addAuthor("Caleb Tennis", I18N_NOOP("KTabBar, bugfixes"), "[email protected]");
  aboutData.addAuthor("Richard Dale", I18N_NOOP("Java & Objective C support"), "[email protected]");
  aboutData.addAuthor("John Birch", I18N_NOOP("Debugger frontend"), "[email protected]");
  aboutData.addAuthor("Vladimir Prus", I18N_NOOP("Debugger frontend"), "[email protected]");
  aboutData.addAuthor("Sandy Meier", I18N_NOOP("PHP support, context menu stuff"), "[email protected]");
  aboutData.addAuthor("Kurt Granroth", I18N_NOOP("TDE application templates"), "[email protected]");
  aboutData.addAuthor("Ian Reinhart Geiser", I18N_NOOP("Dist part, bash support, application templates"), "[email protected]");
  aboutData.addAuthor("Matthias Hoelzer-Kluepfel", I18N_NOOP("Several components, htdig indexing"), "[email protected]");
  aboutData.addAuthor("Victor Roeder", I18N_NOOP("Help with Automake manager and persistent class store"), "[email protected]");
  aboutData.addAuthor("Megan Webb", I18N_NOOP("Automake manager patches, Astyle plugin update, plugin patches and improvements"),"[email protected]");
  aboutData.addAuthor("Harald Fernengel", I18N_NOOP("Ported to TQt 3, patches, valgrind, diff and perforce support"), "[email protected]");
  aboutData.addAuthor("Roberto Raggi", I18N_NOOP("TQEditor component, code completion, Abbrev component, C++ support, Java support"), "[email protected]");
  aboutData.addAuthor("Simon Hausmann", I18N_NOOP("Help with KParts infrastructure"), "[email protected]");
  aboutData.addAuthor("Oliver Kellogg", I18N_NOOP("Ada support"), "[email protected]");
  aboutData.addAuthor("Andreas Pakulat", I18N_NOOP("TQMake projectmanager, TQt4 Support"), "[email protected]");
  aboutData.addAuthor("Jakob Simon-Gaarde", I18N_NOOP("TQMake projectmanager"), "[email protected]");
  aboutData.addAuthor("F@lk Brettschneider", I18N_NOOP("MDI modes, TQEditor, bugfixes"), "[email protected]");
  aboutData.addAuthor("Mario Scalas", I18N_NOOP("PartExplorer, redesign of CvsPart, patches, bugs(fixes)"), "[email protected]");
  aboutData.addAuthor("Jens Dagerbo", I18N_NOOP("Replace, Bookmarks, FileList and CTags2 plugins. Overall improvements and patches"), "[email protected]");
  aboutData.addAuthor("Julian Rockey", I18N_NOOP("Filecreate part and other bits and patches"), "[email protected]");
  aboutData.addCredit("Ajay Guleria", I18N_NOOP("ClearCase support"), "[email protected]");
  aboutData.addCredit("Marek Janukowicz", I18N_NOOP("Ruby support"), "[email protected]");

  aboutData.addCredit("The KWrite authors", I18N_NOOP("Kate editor component"), "[email protected]");
  aboutData.addCredit("The TDEHTML authors", I18N_NOOP("HTML documentation component"), "[email protected]");
  aboutData.addCredit("Robert Moniot", I18N_NOOP("Fortran documentation"), "[email protected]");
  aboutData.addCredit("Ka-Ping Yee", I18N_NOOP("Python documentation utility"), "[email protected]");
  aboutData.addCredit("Dimitri van Heesch", I18N_NOOP("Doxygen wizard"), "[email protected]");
  aboutData.addCredit("Hugo Varotto", I18N_NOOP("Fileselector component"), "[email protected]");
  aboutData.addCredit("Matt Newell", I18N_NOOP("Fileselector component"), "[email protected]");
  aboutData.addCredit("Trolltech AS", I18N_NOOP("Designer code"), "[email protected]");
  aboutData.addCredit("Daniel Engelschalt", I18N_NOOP("C++ code completion, persistent class store"), "[email protected]");
  aboutData.addCredit("Stephane ANCELOT", I18N_NOOP("Patches"), "[email protected]");
  aboutData.addCredit("Jens Zurheide", I18N_NOOP("Patches"), "[email protected]");
  aboutData.addCredit("Luc Willems", I18N_NOOP("Help with Perl support"), "[email protected]");
  aboutData.addCredit("Marcel Turino", I18N_NOOP("Documentation index view"), "[email protected]");
  aboutData.addCredit("Yann Hodique", I18N_NOOP("Patches"), "[email protected]");
  aboutData.addCredit("Tobias Gl\303\244\303\237er" , I18N_NOOP("Documentation Finder,  qmake projectmanager patches, usability improvements, bugfixes ... "), "[email protected]");
  aboutData.addCredit("Andreas Koepfle" , I18N_NOOP("TQMake project manager patches"), "[email protected]");
  aboutData.addCredit("Sascha Cunz" , I18N_NOOP("Cleanup and bugfixes for qEditor, AutoMake and much other stuff"), "[email protected]");
  aboutData.addCredit("Robert Gruber" , I18N_NOOP("SnippetPart, debugger and usability patches"), "[email protected]");
  aboutData.addCredit("Zoran Karavla", I18N_NOOP("Artwork for the Ruby language"), "[email protected]", "http://the-error.net");

  TDECmdLineArgs::init(argc, argv, &aboutData);
  TDECmdLineArgs::addCmdLineOptions( options );
  TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();

  TDEApplication app;

  KDevIDEExtension::init();

  KDevSplashScreen *splash = 0;
  TQString splashFile = locate("appdata", "pics/tdevelop-splash.png");
  if (!splashFile.isEmpty())
  {
    TQPixmap pm;
    pm.load(splashFile);
    splash = new KDevSplashScreen( pm );
  }

  app.processEvents();

  if (splash) splash->message( i18n( "Loading Settings" ) );
  TopLevel::getInstance()->loadSettings();

  TQObject::connect(PluginController::getInstance(), TQT_SIGNAL(loadingPlugin(const TQString &)),
    splash, TQT_SLOT(message(const TQString &)));
  if (splash) splash->show();

  PluginController::getInstance()->loadInitialPlugins();

  Core::getInstance()->doEmitCoreInitialized();

  if (splash) splash->message( i18n( "Starting GUI" ) );
  TopLevel::getInstance()->main()->show();

  if (splash) delete splash;

  for( int i=0; i<args->count(); ++i ){
      kdDebug(9000) << "------> arg " << args->arg(i) << endl;
  }

  bool openProject = false;
  if( args->count() == 0 ){
      ProjectManager::getInstance()->loadDefaultProject();
      openProject = true;
  } else if( args->count() > 0 ){
      KURL url = args->url( 0 );
      TQString ext = TQFileInfo( url.fileName() ).extension();
      if( ext == "tdevelop" ){
	  ProjectManager::getInstance()->loadProject( url );
	  openProject = true;
      }
  }

  if( !openProject ){
      for( int a=0; a<args->count(); ++a ){
	  PartController::getInstance()->editDocument( KURL(args->url(a)) );
      }
  }

  kapp->dcopClient()->registerAs("tdevelop");

  int ret = app.exec();

  ProjectManager::getInstance()->closeProject( true ); // exiting
  delete ProjectManager::getInstance();

  delete PluginController::getInstance();
  if (TopLevel::mainWindowValid())
      delete TopLevel::getInstance();

  return ret;
}