summaryrefslogtreecommitdiffstats
path: root/tools/linguist/tutorial
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
commitd796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch)
tree6e3dcca4f77e20ec8966c666aac7c35bd4704053 /tools/linguist/tutorial
downloadtqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz
tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'tools/linguist/tutorial')
-rw-r--r--tools/linguist/tutorial/tt1/main.cpp25
-rw-r--r--tools/linguist/tutorial/tt1/tt1.pro4
-rw-r--r--tools/linguist/tutorial/tt2/arrowpad.cpp31
-rw-r--r--tools/linguist/tutorial/tt2/arrowpad.h22
-rw-r--r--tools/linguist/tutorial/tt2/main.cpp26
-rw-r--r--tools/linguist/tutorial/tt2/mainwindow.cpp26
-rw-r--r--tools/linguist/tutorial/tt2/mainwindow.h19
-rw-r--r--tools/linguist/tutorial/tt2/tt2.pro9
-rw-r--r--tools/linguist/tutorial/tt3/main.cpp26
-rw-r--r--tools/linguist/tutorial/tt3/mainwindow.cpp47
-rw-r--r--tools/linguist/tutorial/tt3/mainwindow.h23
-rw-r--r--tools/linguist/tutorial/tt3/printpanel.cpp37
-rw-r--r--tools/linguist/tutorial/tt3/printpanel.h19
-rw-r--r--tools/linguist/tutorial/tt3/tt3.pro8
-rw-r--r--tools/linguist/tutorial/tt3/tt3_pt.ts65
15 files changed, 387 insertions, 0 deletions
diff --git a/tools/linguist/tutorial/tt1/main.cpp b/tools/linguist/tutorial/tt1/main.cpp
new file mode 100644
index 000000000..2cee6e11e
--- /dev/null
+++ b/tools/linguist/tutorial/tt1/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************
+**
+** Translation tutorial 1
+**
+****************************************************************/
+
+#include <qapplication.h>
+#include <qpushbutton.h>
+#include <qtranslator.h>
+
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( "tt1_la", "." );
+ app.installTranslator( &translator );
+
+ TQPushButton hello( TQPushButton::tr("Hello world!"), 0 );
+
+ app.setMainWidget( &hello );
+ hello.show();
+ return app.exec();
+}
diff --git a/tools/linguist/tutorial/tt1/tt1.pro b/tools/linguist/tutorial/tt1/tt1.pro
new file mode 100644
index 000000000..3b5249cbc
--- /dev/null
+++ b/tools/linguist/tutorial/tt1/tt1.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+SOURCES = main.cpp
+TRANSLATIONS = tt1_la.ts
diff --git a/tools/linguist/tutorial/tt2/arrowpad.cpp b/tools/linguist/tutorial/tt2/arrowpad.cpp
new file mode 100644
index 000000000..8e23d931d
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/arrowpad.cpp
@@ -0,0 +1,31 @@
+/****************************************************************
+**
+** Implementation of ArrowPad class, translation tutorial 2
+**
+****************************************************************/
+
+#include "arrowpad.h"
+
+#include <qpushbutton.h>
+
+ArrowPad::ArrowPad( TQWidget *parent, const char *name )
+ : TQGrid( 3, Horizontal, parent, name )
+{
+ setMargin( 10 );
+ setSpacing( 10 );
+
+ skip();
+ (void) new TQPushButton( tr("&Up"), this );
+ skip();
+ (void) new TQPushButton( tr("&Left"), this );
+ skip();
+ (void) new TQPushButton( tr("&Right"), this );
+ skip();
+ (void) new TQPushButton( tr("&Down"), this );
+ skip();
+}
+
+void ArrowPad::skip()
+{
+ (void) new TQWidget( this );
+}
diff --git a/tools/linguist/tutorial/tt2/arrowpad.h b/tools/linguist/tutorial/tt2/arrowpad.h
new file mode 100644
index 000000000..06e11fa45
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/arrowpad.h
@@ -0,0 +1,22 @@
+/****************************************************************
+**
+** Definition of ArrowPad class, translation tutorial 2
+**
+****************************************************************/
+
+#ifndef ARROWPAD_H
+#define ARROWPAD_H
+
+#include <qgrid.h>
+
+class ArrowPad : public TQGrid
+{
+ Q_OBJECT
+public:
+ ArrowPad( TQWidget *parent = 0, const char *name = 0 );
+
+private:
+ void skip();
+};
+
+#endif
diff --git a/tools/linguist/tutorial/tt2/main.cpp b/tools/linguist/tutorial/tt2/main.cpp
new file mode 100644
index 000000000..132d4c49f
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/main.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Translation tutorial 2
+**
+****************************************************************/
+
+#include "mainwindow.h"
+
+#include <qapplication.h>
+#include <qstring.h>
+#include <qtextcodec.h>
+#include <qtranslator.h>
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( TQString("tt2_") + TQTextCodec::locale(), "." );
+ app.installTranslator( &translator );
+
+ MainWindow *mw = new MainWindow;
+ app.setMainWidget( mw );
+ mw->show();
+ return app.exec();
+}
diff --git a/tools/linguist/tutorial/tt2/mainwindow.cpp b/tools/linguist/tutorial/tt2/mainwindow.cpp
new file mode 100644
index 000000000..542846b49
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/mainwindow.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Implementation of MainWindow class, translation tutorial 2
+**
+****************************************************************/
+
+#include "arrowpad.h"
+#include "mainwindow.h"
+
+#include <qaccel.h>
+#include <qapplication.h>
+#include <qmenubar.h>
+#include <qpopupmenu.h>
+
+MainWindow::MainWindow( TQWidget *parent, const char *name )
+ : TQMainWindow( parent, name )
+{
+ ArrowPad *ap = new ArrowPad( this, "arrow pad" );
+ setCentralWidget( ap );
+
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( tr("E&xit"), qApp, SLOT(tquit()),
+ tr("Ctrl+Q", "Quit") );
+ menuBar()->insertItem( tr("&File"), file );
+ menuBar()->setSeparator( TQMenuBar::InWindowsStyle );
+}
diff --git a/tools/linguist/tutorial/tt2/mainwindow.h b/tools/linguist/tutorial/tt2/mainwindow.h
new file mode 100644
index 000000000..0d023bb6b
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/mainwindow.h
@@ -0,0 +1,19 @@
+/****************************************************************
+**
+** Definition of MainWindow class, translation tutorial 2
+**
+****************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <qmainwindow.h>
+
+class MainWindow : public TQMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow( TQWidget *parent = 0, const char *name = 0 );
+};
+
+#endif
diff --git a/tools/linguist/tutorial/tt2/tt2.pro b/tools/linguist/tutorial/tt2/tt2.pro
new file mode 100644
index 000000000..8c1ea6d4c
--- /dev/null
+++ b/tools/linguist/tutorial/tt2/tt2.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+HEADERS = arrowpad.h \
+ mainwindow.h
+SOURCES = arrowpad.cpp \
+ main.cpp \
+ mainwindow.cpp
+TRANSLATIONS = tt2_fr.ts \
+ tt2_nl.ts
diff --git a/tools/linguist/tutorial/tt3/main.cpp b/tools/linguist/tutorial/tt3/main.cpp
new file mode 100644
index 000000000..0c2f083c6
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/main.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Translation tutorial 3
+**
+****************************************************************/
+
+#include "mainwindow.h"
+
+#include <qapplication.h>
+#include <qstring.h>
+#include <qtextcodec.h>
+#include <qtranslator.h>
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( TQString("tt3_") + TQTextCodec::locale(), "." );
+ app.installTranslator( &translator );
+
+ MainWindow *mw = new MainWindow;
+ app.setMainWidget( mw );
+ mw->show();
+ return app.exec();
+}
diff --git a/tools/linguist/tutorial/tt3/mainwindow.cpp b/tools/linguist/tutorial/tt3/mainwindow.cpp
new file mode 100644
index 000000000..a0aca2b9e
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/mainwindow.cpp
@@ -0,0 +1,47 @@
+/****************************************************************
+**
+** Implementation of MainWindow class, translation tutorial 3
+**
+****************************************************************/
+
+#include "mainwindow.h"
+#include "printpanel.h"
+
+#include <qaccel.h>
+#include <qapplication.h>
+#include <qmenubar.h>
+#include <qmessagebox.h>
+#include <qpopupmenu.h>
+
+MainWindow::MainWindow( TQWidget *parent, const char *name )
+ : TQMainWindow( parent, name )
+{
+ setCaption( tr("Troll Print 1.0") );
+
+ PrintPanel *pp = new PrintPanel( this );
+ setCentralWidget( pp );
+
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( tr("E&xit"), qApp, SLOT(tquit()),
+ tr("Ctrl+Q", "Quit") );
+ TQPopupMenu *help = new TQPopupMenu( this );
+ help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
+ help->insertItem( tr("About &TQt"), this, SLOT(aboutTQt()) );
+
+ menuBar()->insertItem( tr("&File"), file );
+ menuBar()->insertSeparator();
+ menuBar()->insertItem( tr("&Help"), help );
+ menuBar()->setSeparator( TQMenuBar::InWindowsStyle );
+}
+
+void MainWindow::about()
+{
+ TQMessageBox::information( this, tr("About Troll Print 1.0"),
+ tr("Troll Print 1.0.\n\n"
+ "Copyright 1999 Macroshaft, Inc.") );
+}
+
+void MainWindow::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this );
+}
diff --git a/tools/linguist/tutorial/tt3/mainwindow.h b/tools/linguist/tutorial/tt3/mainwindow.h
new file mode 100644
index 000000000..dc9ad11e1
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/mainwindow.h
@@ -0,0 +1,23 @@
+/****************************************************************
+**
+** Definition of MainWindow class, translation tutorial 3
+**
+****************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <qmainwindow.h>
+
+class MainWindow : public TQMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow( TQWidget *parent = 0, const char *name = 0 );
+
+private slots:
+ void about();
+ void aboutTQt();
+};
+
+#endif
diff --git a/tools/linguist/tutorial/tt3/printpanel.cpp b/tools/linguist/tutorial/tt3/printpanel.cpp
new file mode 100644
index 000000000..c377efc26
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/printpanel.cpp
@@ -0,0 +1,37 @@
+/****************************************************************
+**
+** Implementation of PrintPanel class, translation tutorial 3
+**
+****************************************************************/
+
+#include "printpanel.h"
+
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qhbuttongroup.h>
+
+PrintPanel::PrintPanel( TQWidget *parent, const char *name )
+ : TQVBox( parent, name )
+{
+ setMargin( 10 );
+ setSpacing( 10 );
+
+/*
+ TQLabel *lab = new TQLabel( tr("<b>TROLL PRINT</b>"), this );
+ lab->setAlignment( AlignCenter );
+*/
+
+ TQRadioButton *but;
+
+ TQHButtonGroup *twoSided = new TQHButtonGroup( this );
+ twoSided->setTitle( tr("2-sided") );
+ but = new TQRadioButton( tr("Enabled"), twoSided );
+ but = new TQRadioButton( tr("Disabled"), twoSided );
+ but->toggle();
+
+ TQHButtonGroup *colors = new TQHButtonGroup( this );
+ colors->setTitle( tr("Colors") );
+ but = new TQRadioButton( tr("Enabled"), colors );
+ but = new TQRadioButton( tr("Disabled"), colors );
+ but->toggle();
+}
diff --git a/tools/linguist/tutorial/tt3/printpanel.h b/tools/linguist/tutorial/tt3/printpanel.h
new file mode 100644
index 000000000..8b1f9bc60
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/printpanel.h
@@ -0,0 +1,19 @@
+/****************************************************************
+**
+** Definition of PrintPanel class, translation tutorial 3
+**
+****************************************************************/
+
+#ifndef PRINTPANEL_H
+#define PRINTPANEL_H
+
+#include <qvbox.h>
+
+class PrintPanel : public TQVBox
+{
+ Q_OBJECT
+public:
+ PrintPanel( TQWidget *parent = 0, const char *name = 0 );
+};
+
+#endif
diff --git a/tools/linguist/tutorial/tt3/tt3.pro b/tools/linguist/tutorial/tt3/tt3.pro
new file mode 100644
index 000000000..c219d1e83
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/tt3.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+HEADERS = mainwindow.h \
+ printpanel.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ printpanel.cpp
+TRANSLATIONS = tt3_pt.ts
diff --git a/tools/linguist/tutorial/tt3/tt3_pt.ts b/tools/linguist/tutorial/tt3/tt3_pt.ts
new file mode 100644
index 000000000..cf8ff4f63
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/tt3_pt.ts
@@ -0,0 +1,65 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Troll Print 1.0</source>
+ <translation>Troll Imprimir 1.0</translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation>&amp;Sair</translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation>&amp;Sobre</translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation>Sobre &amp;Qt</translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation>&amp;Arquivo</translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation>A&amp;juda</translation>
+ </message>
+ <message>
+ <source>About Troll Print 1.0</source>
+ <translation>Sobre Troll Imprimir 1.0</translation>
+ </message>
+ <message>
+ <source>Troll Print 1.0.
+
+Copyright 1999 Macroshaft, Inc.</source>
+ <translation>Troll Imprimir 1.0
+
+Copyright 1999 Macroshaft, Inc.</translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <comment>Quit</comment>
+ <translation>Ctrl+Q</translation>
+ </message>
+</context>
+<context>
+ <name>PrintPanel</name>
+ <message>
+ <source>2-sided</source>
+ <translation>2-lados</translation>
+ </message>
+ <message>
+ <source>Enabled</source>
+ <translation>Ativado</translation>
+ </message>
+ <message>
+ <source>Disabled</source>
+ <translation>Desativado</translation>
+ </message>
+ <message>
+ <source>Colors</source>
+ <translation>Cores</translation>
+ </message>
+</context>
+</TS>