diff options
Diffstat (limited to 'tools/linguist/tutorial/tt3')
-rw-r--r-- | tools/linguist/tutorial/tt3/main.cpp | 26 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/mainwindow.cpp | 47 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/mainwindow.h | 23 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/printpanel.cpp | 37 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/printpanel.h | 19 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/tt3.pro | 8 | ||||
-rw-r--r-- | tools/linguist/tutorial/tt3/tt3_pt.ts | 65 |
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&xit</source> + <translation>&Sair</translation> + </message> + <message> + <source>&About</source> + <translation>&Sobre</translation> + </message> + <message> + <source>About &Qt</source> + <translation>Sobre &Qt</translation> + </message> + <message> + <source>&File</source> + <translation>&Arquivo</translation> + </message> + <message> + <source>&Help</source> + <translation>A&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> |