diff options
Diffstat (limited to 'languages/ruby/app_templates/qtrubyapp')
4 files changed, 71 insertions, 142 deletions
diff --git a/languages/ruby/app_templates/qtrubyapp/CMakeLists.txt b/languages/ruby/app_templates/qtrubyapp/CMakeLists.txt index e1f23012..8e159b4c 100644 --- a/languages/ruby/app_templates/qtrubyapp/CMakeLists.txt +++ b/languages/ruby/app_templates/qtrubyapp/CMakeLists.txt @@ -9,12 +9,17 @@ # ################################################# -add_custom_target( qtrubyapp.tar.gz ALL - COMMAND ${TAR} zcf qtrubyapp.tar.gz -C ${CMAKE_CURRENT_SOURCE_DIR} +set( _tarball_content main.rb qtrubyapp.rb qtrubyapp.png qtrubyapp.kdevelop filesave.xpm fileopen.xpm fileprint.xpm app.filelist app-Makefile README ) +list( SORT _tarball_content ) + +tde_create_tarball( + TARGET qtrubyapp.tar.gz + FILES ${_tarball_content} +) install( FILES @@ -22,6 +27,9 @@ install( FILES DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard ) -install( FILES - qtrubyapp.kdevtemplate - DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/templates ) +tde_create_translated_desktop( + SOURCE qtrubyapp.kdevtemplate + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/templates + KEYWORDS Category + PO_DIR tdevelop-desktops +) diff --git a/languages/ruby/app_templates/qtrubyapp/main.rb b/languages/ruby/app_templates/qtrubyapp/main.rb index 6f4bceae..f76c9dac 100644 --- a/languages/ruby/app_templates/qtrubyapp/main.rb +++ b/languages/ruby/app_templates/qtrubyapp/main.rb @@ -1,10 +1,10 @@ require 'Qt' require '%{APPNAMELC}.rb' -a = Qt::Application.new( ARGV ) +a = TQt::Application.new( ARGV ) mw = %{APPNAMESC}.new mw.caption = "%{APPNAMESC}" mw.show -a.connect( a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()') ) +a.connect( a, TQ_SIGNAL('lastWindowClosed()'), a, TQ_SLOT('quit()') ) a.exec diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate index 5fd82925..a657b79a 100644 --- a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate +++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate @@ -1,64 +1,12 @@ -# KDE Config File +# TDE Config File [General] Name=QtRuby Application -Name[ca]=Aplicació en QtRuby -Name[da]=QtRuby-program -Name[de]=QtRuby-Anwendung -Name[el]=Εφαρμογή QtRuby -Name[es]=Aplicación en QtRuby -Name[et]=QtRuby rakendus -Name[eu]=QtRuby aplikazioa -Name[fa]=کاربرد QtRuby -Name[fr]=Application QtRuby -Name[ga]=Feidhmchlár QtRuby -Name[gl]=Aplicación QtRuby -Name[hu]=QtRuby-alapú alkalmazás -Name[it]=Applicazione QtRuby -Name[ja]=QtRuby アプリケーション -Name[nds]=QtRuby-Programm -Name[ne]=QtRuby अनुप्रयोग -Name[nl]=QtRuby-toepassing -Name[pl]=Program w QtRuby -Name[pt]=Aplicação em QtRuby -Name[pt_BR]=Aplicativo QtRuby -Name[ru]=Приложение QtRuby -Name[sk]=QtRuby Aplikácia -Name[sr]=QtRuby програм -Name[sr@Latn]=QtRuby program -Name[sv]=QtRuby-program -Name[tr]=QtRuby Uygulaması -Name[zh_CN]=QtRuby 应用程序 -Name[zh_TW]=QtRuby 應用程式 -Icon=qtrubyapp.png -Category=Ruby/Qt -Category[fr]=Ruby/Qt + Comment=Generate a QtRuby based application (crossplatform compatible) -Comment[ca]=Genera una aplicació basada en QtRuby (multi plataforma) -Comment[da]=Genererer et QtRuby baseret program (krydsplatform kompatibelt) -Comment[de]=Erstellt eine auf QtRuby basierende Anwendung (plattformunabhängig) -Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης σε QtRuby (συμβατή με πολλαπλές πλατφόρμες) -Comment[es]=Genera una aplicación basada en QtRuby (compatible multiplataforma) -Comment[et]=Rakenduse loomine QtRuby põhjal (mitmeplatvormne) -Comment[eu]=Sortu QtRuby lengoaian oinarritutako aplikazioa (plataforma gurutzatuekin bateragarria) -Comment[fa]=یک کاربرد بر مبنای QtRuby تولید میکند )همساز بین سکویی( -Comment[fr]=Génèrer une application basée sur QtRuby (compatible multi-plateforme) -Comment[gl]=Xera unha aplicación baseada en QtRuby (compatibilidade multiplataforma) -Comment[hu]=Létrehoz egy QtRuby-alapú, keresztfordításra is megfelelő alkalmazást -Comment[it]=Genera un'applicazione basata su QtRuby (compatibile multipiattaforma) -Comment[ja]=QtRuby ベースのアプリケーションを作成 (クロスプラットフォーム) -Comment[nds]=Stellt en op QtRuby opbuut Programm op (över Bedriefümgeven weg kompatibel) -Comment[ne]= QtRuby आधारित अनुप्रयोग (क्रसप्लाटफर्म उपयुक्त) उत्पन्न गर्नुहोस् -Comment[nl]=Genereert een QtRuby-toepassing (crossplatform compatible) -Comment[pl]=Generuj program używający QtRuby (wieloplatformowy) -Comment[pt]=Gera uma aplicação baseada em QtRuby (compatível com várias plataformas) -Comment[pt_BR]=Gera um aplicativo baseado no QtRuby (compatível com várias plataformas) -Comment[ru]=Создание кроссплатформенного приложения на QtRuby -Comment[sk]=Vygeneruje QtRuby aplikáciu (multiplatformovo kompatibilnú) -Comment[sr]=Прави програм на основу QtRuby-ја (прекоплатформски компатибилан) -Comment[sr@Latn]=Pravi program na osnovu QtRuby-ja (prekoplatformski kompatibilan) -Comment[sv]=Skapa ett program baserat på QtRuby (fungerar på andra plattformar) -Comment[tr]=QtRuby tabanlı bir uygulama yarat (platformlararası geçimli) -Comment[zh_TW]=產生一個 QtRuby 為基礎的應用程式(跨平台相容) + +Category=Ruby/Qt + +Icon=qtrubyapp.png FileTemplates=rb,ShellStyle ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.rb,%{dest}/README Archive=qtrubyapp.tar.gz @@ -111,30 +59,3 @@ Dest=%{dest}/README [MSG] Type=message Comment=A QtRuby based application was created in %{dest} -Comment[ca]=Una aplicació basada en QtRuby ha estat creada en %{dest} -Comment[da]=Et QtRuby baseret program blev oprettet i %{dest} -Comment[de]=Eine auf QtRuby basierende Anwendung wurde in %{dest} erstellt. -Comment[el]=Μια εφαρμογή βασισμένη σε QtRuby δημιουργήθηκε στο %{dest} -Comment[es]=Una aplicación basada en QtRuby ha sido creada en %{dest} -Comment[et]=Rakendus QtRuby põhjal loodi asukohta %{dest} -Comment[eu]=QtRuby lengoaian oinarritutako aplikazioa sortu da hemen: %{dest} -Comment[fa]=یک کاربرد بر مبنای QtRuby در %{dest} ایجاد شد -Comment[fr]=Une application basée sur QtRuby a été créée dans %{dest} -Comment[ga]=Cruthaíodh feidhmchlár bunaithe ar QtRuby i %{dest} -Comment[gl]=Creouse unha aplicación baseada en QtRuby en %{dest} -Comment[hu]=Létrejött egy QtRuby-alapú alkalmazás itt: %{dest} -Comment[it]=È stata creata un'applicazione basata su QtRuby in %{dest} -Comment[ja]=QtRuby ベースのアプリケーションを %{dest} に作成しました -Comment[nds]=In %{dest} wöör en op QtRuby opbuut Programm opstellt. -Comment[ne]=QtRuby आधारित अनुप्रयोग %{dest} मा सिर्जना गरियो -Comment[nl]=Een QtRuby-toepassing is aangemaakt in %{dest} -Comment[pl]=Program używający QtRuby został utworzony w %{dest} -Comment[pt]=Foi criada uma aplicação baseada em QtRuby em %{dest} -Comment[pt_BR]=Foi criada uma aplicação baseada em QtRuby em %{dest} -Comment[ru]=Приложение QtRuby создано в %{dest} -Comment[sk]=QtRuby aplikácia bola vytvorená v %{dest} -Comment[sr]=QtRuby програм је направљен у %{dest} -Comment[sr@Latn]=QtRuby program je napravljen u %{dest} -Comment[sv]=Ett program baserat på QtRuby skapades i %{dest} -Comment[tr]=Bir QtRuby tabanlı uygulama %{dest} içinde yaratıldı. -Comment[zh_TW]=一個 QtRuby 為基礎的應用程式框架已建立於 %{dest} diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb index 7d5f9ad3..ceae4ad1 100644 --- a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb +++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb @@ -1,8 +1,8 @@ -class %{APPNAMESC} < Qt::MainWindow +class %{APPNAMESC} < TQt::MainWindow - Q_SLOTS 'newDoc()', + slots 'newDoc()', 'choose()', - 'load( const QString& )', + 'load( const TQString& )', 'save()', 'saveAs()', 'print()', @@ -11,89 +11,89 @@ class %{APPNAMESC} < Qt::MainWindow def initialize() super( nil, "%{APPNAMESC}", WDestructiveClose ) - @printer = Qt::Printer.new + @printer = TQt::Printer.new - fileTools = Qt::ToolBar.new( self, "file operations" ) + fileTools = TQt::ToolBar.new( self, "file operations" ) fileTools.setLabel( tr("File Operations") ) - openIcon = Qt::Pixmap.new( "fileopen.xpm" ) - fileOpen = Qt::ToolButton.new( Qt::IconSet.new(openIcon), tr("Open File"), nil, - self, SLOT('choose()'), fileTools, "open file" ) + openIcon = TQt::Pixmap.new( "fileopen.xpm" ) + fileOpen = TQt::ToolButton.new( TQt::IconSet.new(openIcon), tr("Open File"), nil, + self, TQ_SLOT('choose()'), fileTools, "open file" ) - saveIcon = Qt::Pixmap.new( "filesave.xpm" ) - fileSave = Qt::ToolButton.new( Qt::IconSet.new(saveIcon), tr("Save File"), nil, - self, SLOT('save()'), fileTools, "save file" ) + saveIcon = TQt::Pixmap.new( "filesave.xpm" ) + fileSave = TQt::ToolButton.new( TQt::IconSet.new(saveIcon), tr("Save File"), nil, + self, TQ_SLOT('save()'), fileTools, "save file" ) - printIcon = Qt::Pixmap.new( "fileprint.xpm" ) - filePrint = Qt::ToolButton.new( Qt::IconSet.new(printIcon), tr("Print File"), nil, - self, SLOT('print()'), fileTools, "print file" ) + printIcon = TQt::Pixmap.new( "fileprint.xpm" ) + filePrint = TQt::ToolButton.new( TQt::IconSet.new(printIcon), tr("Print File"), nil, + self, TQ_SLOT('print()'), fileTools, "print file" ) - Qt::WhatsThis.whatsThisButton( fileTools ) + TQt::WhatsThis.whatsThisButton( fileTools ) fileOpenText = tr('<p><img source="fileopen"> ' + "Click this button to open a <em>new file</em>. <br>" + "You can also select the <b>Open</b> command " + "from the <b>File</b> menu.</p>") - Qt::WhatsThis.add( fileOpen, fileOpenText ) + TQt::WhatsThis.add( fileOpen, fileOpenText ) - Qt::MimeSourceFactory.defaultFactory().setPixmap( "fileopen", openIcon ) + TQt::MimeSourceFactory.defaultFactory().setPixmap( "fileopen", openIcon ) fileSaveText = tr("<p>Click this button to save the file you " + "are editing. You will be prompted for a file name.\n" + "You can also select the <b>Save</b> command " + "from the <b>File</b> menu.</p>") - Qt::WhatsThis.add( fileSave, fileSaveText ) + TQt::WhatsThis.add( fileSave, fileSaveText ) filePrintText = tr("Click this button to print the file you " + "are editing.\n You can also select the Print " + "command from the File menu.") - Qt::WhatsThis.add( filePrint, filePrintText ) + TQt::WhatsThis.add( filePrint, filePrintText ) - file = Qt::PopupMenu.new( self ) + file = TQt::PopupMenu.new( self ) menuBar().insertItem( tr("&File"), file ) - file.insertItem( tr("&New"), self, SLOT('newDoc()'), Qt::KeySequence.new(CTRL+Key_N) ) + file.insertItem( tr("&New"), self, TQ_SLOT('newDoc()'), TQt::KeySequence.new(CTRL+Key_N) ) - id = file.insertItem( Qt::IconSet.new(openIcon), tr("&Open..."), - self, SLOT('choose()'), Qt::KeySequence.new(CTRL+Key_O) ) + id = file.insertItem( TQt::IconSet.new(openIcon), tr("&Open..."), + self, TQ_SLOT('choose()'), TQt::KeySequence.new(CTRL+Key_O) ) file.setWhatsThis( id, fileOpenText ) - id = file.insertItem( Qt::IconSet.new(saveIcon), tr("&Save"), - self, SLOT('save()'), Qt::KeySequence.new(CTRL+Key_S) ) + id = file.insertItem( TQt::IconSet.new(saveIcon), tr("&Save"), + self, TQ_SLOT('save()'), TQt::KeySequence.new(CTRL+Key_S) ) file.setWhatsThis( id, fileSaveText ) - id = file.insertItem( tr("Save &As..."), self, SLOT('saveAs()') ) + id = file.insertItem( tr("Save &As..."), self, TQ_SLOT('saveAs()') ) file.setWhatsThis( id, fileSaveText ) file.insertSeparator() - id = file.insertItem( Qt::IconSet.new(printIcon), tr("&Print..."), - self, SLOT('print()'), Qt::KeySequence.new(CTRL+Key_P) ) + id = file.insertItem( TQt::IconSet.new(printIcon), tr("&Print..."), + self, TQ_SLOT('print()'), TQt::KeySequence.new(CTRL+Key_P) ) file.setWhatsThis( id, filePrintText ) file.insertSeparator() - file.insertItem( tr("&Close"), self, SLOT('close()'), Qt::KeySequence.new(CTRL+Key_W) ) + file.insertItem( tr("&Close"), self, TQ_SLOT('close()'), TQt::KeySequence.new(CTRL+Key_W) ) - file.insertItem( tr("&Quit"), $tqApp, SLOT( 'closeAllWindows()' ), Qt::KeySequence.new(CTRL+Key_Q) ) + file.insertItem( tr("&Quit"), $tqApp, TQ_SLOT( 'closeAllWindows()' ), TQt::KeySequence.new(CTRL+Key_Q) ) menuBar().insertSeparator() - help = Qt::PopupMenu.new( self ) + help = TQt::PopupMenu.new( self ) menuBar().insertItem( tr("&Help"), help ) - help.insertItem( tr("&About"), self, SLOT('about()'), Qt::KeySequence.new(Key_F1) ) - help.insertItem( tr("About &Qt"), self, SLOT('aboutQt()') ) + help.insertItem( tr("&About"), self, TQ_SLOT('about()'), TQt::KeySequence.new(Key_F1) ) + help.insertItem( tr("About &Qt"), self, TQ_SLOT('aboutQt()') ) help.insertSeparator() - help.insertItem( tr("What's &This"), self, SLOT('whatsThis()'), Qt::KeySequence.new(SHIFT+Key_F1) ) + help.insertItem( tr("What's &This"), self, TQ_SLOT('whatsThis()'), TQt::KeySequence.new(SHIFT+Key_F1) ) - @e = Qt::TextEdit.new( self, "editor" ) + @e = TQt::TextEdit.new( self, "editor" ) @e.setFocus() setCentralWidget( @e ) statusBar().message( tr("Ready"), 2000 ) @@ -110,7 +110,7 @@ class %{APPNAMESC} < Qt::MainWindow end def choose() - fn = Qt::FileDialog.getOpenFileName( nil, nil, + fn = TQt::FileDialog.getOpenFileName( nil, nil, self) if !fn.nil? load( fn ) @@ -121,12 +121,12 @@ class %{APPNAMESC} < Qt::MainWindow def load( filename ) - f = Qt::File.new( filename ) - if !f.open( Qt::IO_ReadOnly ) + f = TQt::File.new( filename ) + if !f.open( TQt::IO_ReadOnly ) return end - ts = Qt::TextStream.new( f ) + ts = TQt::TextStream.new( f ) @e.setText( ts.read() ) @e.setModified( false ) setCaption( filename ) @@ -141,14 +141,14 @@ class %{APPNAMESC} < Qt::MainWindow end text = @e.text() - f = Qt::File.new( @filename ) - if !f.open( Qt::IO_WriteOnly ) + f = TQt::File.new( @filename ) + if !f.open( TQt::IO_WriteOnly ) statusBar().message( tr("Could not write to %s" % @filename), 2000 ) return end - t = Qt::TextStream.new( f ) + t = TQt::TextStream.new( f ) t << text f.close() @@ -161,7 +161,7 @@ class %{APPNAMESC} < Qt::MainWindow def saveAs() - fn = Qt::FileDialog.getSaveFileName( nil, nil, + fn = TQt::FileDialog.getSaveFileName( nil, nil, self ) if !fn.nil? @filename = fn @@ -173,13 +173,13 @@ class %{APPNAMESC} < Qt::MainWindow def print() - # ###### Rewrite to use Qt::SimpleRichText to print here as well + # ###### Rewrite to use TQt::SimpleRichText to print here as well margin = 10 pageNo = 1 if @printer.setup(self) # @printer dialog statusBar().message( tr("Printing...") ) - p = Qt::Painter.new + p = TQt::Painter.new if !p.begin( @printer ) # paint on @printer return end @@ -187,7 +187,7 @@ class %{APPNAMESC} < Qt::MainWindow p.setFont( @e.font() ) yPos = 0 # y-position for each line fm = p.fontMetrics() - metrics = Qt::PaintDeviceMetrics.new( @printer ) # need width/height + metrics = TQt::PaintDeviceMetrics.new( @printer ) # need width/height # of @printer surface for i in 0...@e.lines() do if margin + yPos > metrics.height() - margin @@ -220,7 +220,7 @@ class %{APPNAMESC} < Qt::MainWindow return end - case Qt::MessageBox.information( self, tr("Qt Application Example"), + case TQt::MessageBox.information( self, tr("Qt Application Example"), tr("Do you want to save the changes" + " to the document?"), tr("Yes"), tr("No"), tr("Cancel"), @@ -240,14 +240,14 @@ class %{APPNAMESC} < Qt::MainWindow private def about() - Qt::MessageBox.about( self, tr("Qt Application Example"), + TQt::MessageBox.about( self, tr("Qt Application Example"), tr("This example demonstrates simple use of " + - "Qt::MainWindow,\nQt::MenuBar and Qt::ToolBar.")) + "TQt::MainWindow,\nTQt::MenuBar and TQt::ToolBar.")) end def aboutQt() - Qt::MessageBox.aboutQt( self, tr("Qt Application Example") ) + TQt::MessageBox.aboutQt( self, tr("Qt Application Example") ) end end |