Просмотр исходного кода

Implement about dialog (also gets rid of the warning about the deprecated version of KCmdLineArgs::init).

git-svn-id: file:///var/svn/tigccpp/trunk@312 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 лет назад
Родитель
Сommit
32eb8a6d6d
4 измененных файлов с 37 добавлено и 3 удалено
  1. 1 1
      ktigcc/Makefile
  2. 18 1
      ktigcc/ktigcc.cpp
  3. 1 0
      ktigcc/mainform.ui
  4. 17 1
      ktigcc/mainform.ui.h

+ 1 - 1
ktigcc/Makefile

@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ktigcc
-# Generated by qmake (1.07a) (Qt 3.3.4) on: Mon Nov 21 13:34:37 2005
+# Generated by qmake (1.07a) (Qt 3.3.4) on: Mon Nov 21 14:34:38 2005
 # Project:  ktigcc.pro
 # Template: app
 # Command: $(QMAKE) -o Makefile ktigcc.pro

+ 18 - 1
ktigcc/ktigcc.cpp

@@ -23,6 +23,7 @@
 #include <unistd.h>
 #include <kapplication.h>
 #include <kcmdlineargs.h>
+#include <kaboutdata.h>
 #include "mainform.h"
 using namespace std;
 void qCleanupImages_ktigcc();
@@ -31,10 +32,26 @@ void qInitImages_ktigcc();
 const char *tigcc_base;
 char tempdir[]="/tmp/ktigccXXXXXX";
 char *quill_drv;
+KAboutData *pabout;
 
 int main( int argc, char *argv[] )
 {
-  KCmdLineArgs::init(argc,argv,"KTIGCC","TIGCC IDE for KDE","1.00");
+  KAboutData about("KTIGCC","TIGCC IDE for KDE","1.00",
+  "TIGCC C and ASM SDK", KAboutData::License_GPL,
+  "Copyright (C) 2004-2005 Kevin Kofler. All rights reserved.\n"
+  "TIGCC Copyright (C) 1999-2005 The TIGCC Team.",
+  "Original linker by Xavier and Niklas\n"
+  "Compiler modifications by Jean, Sebastian and Kevin\n"
+  "Linker by Sebastian and Kevin\n"
+  "Documentation by Zeljko\n"
+  "A68k modifications by Kevin\n"
+  "Windows IDE by Sebastian\n"
+  "KTIGCC IDE by Kevin\n"
+  "Documentation conversion to CHM by Philipp\n"
+  "Documentation conversion to Qt Assistant by Kevin",
+  "http://tigcc.ticalc.org/linux/", "Bugs@tigcc.ticalc.org");
+  pabout=&about;
+  KCmdLineArgs::init(argc,argv,&about);
   KApplication app;
   // Readd the images KDE kindly removes...
   qCleanupImages_ktigcc();

+ 1 - 0
ktigcc/mainform.ui

@@ -1309,6 +1309,7 @@
     <slot>fileNewTextFile()</slot>
 </slots>
 <functions>
+    <function access="private" specifier="non virtual">destroy()</function>
     <function access="private" specifier="non virtual">updateSizes()</function>
     <function access="private" specifier="non virtual">newFile( QListViewItem * parent )</function>
     <function access="private" specifier="non virtual">updateLeftStatusLabel()</function>

+ 17 - 1
ktigcc/mainform.ui.h

@@ -37,6 +37,8 @@
 #include <kate/view.h>
 #include <kconfig.h>
 #include <ktexteditor/configinterfaceextension.h>
+#include <kaboutdata.h>
+#include <khelpmenu.h>
 #include <cstdio>
 #include <cstdlib>
 using std::puts;
@@ -47,6 +49,7 @@ extern const char *quill_drv;
 extern char tempdir[];
 extern void write_temp_file(const char *filename, const char *data, const size_t len);
 extern void delete_temp_file(const char *filename);
+extern KAboutData *pabout;
 
 // All the methods are inline because otherwise QT Designer will mistake them
 // for slots of the main form.
@@ -136,6 +139,7 @@ static QListViewItem *currentListItem;
 static QLabel *leftStatusLabel;
 static QLabel *rightStatusLabel;
 static Kate::View* m_view;
+static KHelpMenu *khelpmenu;
 static int fileCount=0, hFileCount=0, cFileCount=0, sFileCount=0, asmFileCount=0, qllFileCount=0, oFileCount=0, aFileCount=0, txtFileCount=0, othFileCount=0;
 
 class DnDListView : public QListView {
@@ -239,9 +243,21 @@ void MainForm::init()
   folderListItem=new ListViewFolder(rootListItem,folderListItem);
   othFilesListItem=folderListItem;
   folderListItem->setText(0,"Other Files");
+  khelpmenu=new KHelpMenu(this,pabout);
   startTimer(100);
 }
 
+void MainForm::destroy()
+{
+  Kate::Document *doc=m_view->getDoc();
+  delete m_view;
+  delete doc;
+  delete leftStatusLabel;
+  delete rightStatusLabel;
+  delete rootListItem;
+  delete khelpmenu;
+}
+
 void MainForm::fileNewProject()
 {
   rootListItem->setText(0,"Project1");
@@ -356,7 +372,7 @@ void MainForm::helpContents()
 
 void MainForm::helpAbout()
 {
-  
+  khelpmenu->aboutApplication();
 }
 
 void MainForm::updateSizes()