summaryrefslogtreecommitdiffstats
path: root/tools/linguist/tutorial/tt3
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/tt3
downloadtqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz
tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'tools/linguist/tutorial/tt3')
-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
7 files changed, 225 insertions, 0 deletions
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>