From a57b51348a0056a552568e0b70db51463f322f9c Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 9 Feb 2023 22:17:59 +0900 Subject: First part of About dialog. Signed-off-by: Michele Calgaro --- src/__TODO/AboutDialog.cpp | 169 --------------------------------------------- src/__TODO/AboutDialog.h | 54 --------------- src/__TODO/AboutDialog.ui | 87 ----------------------- src/__TODO/MainWindow.ui | 68 +----------------- 4 files changed, 1 insertion(+), 377 deletions(-) delete mode 100644 src/__TODO/AboutDialog.cpp delete mode 100644 src/__TODO/AboutDialog.h (limited to 'src/__TODO') diff --git a/src/__TODO/AboutDialog.cpp b/src/__TODO/AboutDialog.cpp deleted file mode 100644 index 3cbdf4f..0000000 --- a/src/__TODO/AboutDialog.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2012 by Thomas Schweitzer * - * thomas-schweitzer(at)arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License version 2.0 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program in the file LICENSE.GPL; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "AboutDialog.h" -#include "ui_AboutDialog.h" - -#include "UiGuiVersion.h" - -#include -#include -#include -#include -#include - -/*! - \class AboutDialog - \brief Displays a dialog window with information about UniversalIndentGUI -*/ - -/*! - \brief The constructor calls the setup function for the ui created by uic and adds - the GPL text to the text edit. - */ -AboutDialog::AboutDialog(TQWidget *parent, TQt::WindowFlags flags) : - TQDialog(parent, flags), _dialogForm(NULL), _timer(NULL) -{ - _dialogForm = new Ui::AboutDialog(); - _dialogForm->setupUi(this); - - _dialogForm->authorTextBrowser->setOpenExternalLinks(true); - _dialogForm->creditsTextBrowser->setOpenExternalLinks(true); - - TQString versionString = _dialogForm->versionTextBrowser->toHtml(); - versionString = - versionString.arg(PROGRAM_VERSION_STRING).arg(UiGuiVersion::getBuildRevision()).arg( - UiGuiVersion::getBuildDate()); - _dialogForm->versionTextBrowser->setHtml(versionString); - - _dialogForm->creditsTextBrowser->setHtml("" - "
 
" - "

Thanks go out to

" - "

Nelson Tai for Chinese translation, good ideas and always fast answers.


" - "

Sebastian Pipping for helping me bring UiGUI into the Debian repository and other good ideas.


" - "

Oleksandr for Ukrainian and Russian translation.


" - "

Erwan "leg" for French translation and the icon logo.


" - "

The Scintilla project for their great text editing component.


" - "

Riverbank for their Scintilla TQt wrapper TQScintilla.


" - "

The Artistic Style project.


" - "

The BCPP project.


" - "

The Cobol Beautifier project.


" - "

The CSSTidy project.


" - "

The Fortran 90 PPR project.


" - "

The GNU Indent project.


" - "

The GreatCode project.


" - "

The hindent project.


" - "

The HTB project.


" - "

The HTML Tidy project.


" - "

The JsDecoder project.


" - "

The JSPPP project.


" - "

The Perltidy project.


" - "

The PHP_Beautifier project.


" - "

The phpCB project.


" - "

The PHP Stylist project.


" - "

The pindent project.


" - "

The Pl/Sql tidy project.


" - "

The Ruby Beautifier project.


" - "

The Ruby Formatter project.


" - "

The Shell Indent project.


" - "

The Uncrustify project, specially Ben Gardner.


" - "

The VBSBeautifier project.


" - "

The XML Indent project.


" - "

Nirvash for the initial Japanese translation.


" - "

The Tango Project for their icons.


" - "

famfamfam for the flag icons.


" - "

Trolltech for their really great GUI framework .


" - "

My girlfriend (meanwhile also wife) for putting my head right and not sit all the time in front of my computer ;-)

" - ""); - - _scrollDirection = 1; - _scrollSpeed = 100; - _timer = new TQTimer(this); - connect(_timer, SIGNAL(timeout()), this, SLOT(scroll())); - connect(this, SIGNAL(accepted()), _timer, SLOT(stop())); -} - -/*! - \brief Catches language change events and retranslates all needed widgets. - */ -void AboutDialog::changeEvent(TQEvent *event) -{ - if (event->type() == TQEvent::LanguageChange) - { - _dialogForm->retranslateUi(this); - - TQString versionString = _dialogForm->versionTextBrowser->toHtml(); - versionString = - versionString.arg(PROGRAM_VERSION_STRING).arg(UiGuiVersion::getBuildRevision()).arg( - UiGuiVersion::getBuildDate()); - _dialogForm->versionTextBrowser->setHtml(versionString); - } - else - { - TQWidget::changeEvent(event); - } -} - -/*! - \brief Reimplements the dialog execution function to init the credits scroller. - */ -int AboutDialog::exec() -{ - //creditsTextBrowser->verticalScrollBar()->setValue(0); - _timer->start(_scrollSpeed); - return TQDialog::exec(); -} - -/*! - \brief This slot is called each _timer timeout to scroll the credits textbrowser. - Also changes the scroll direction and speed when reaching the start or end. - */ -void AboutDialog::scroll() -{ - TQScrollBar *scrollBar = _dialogForm->creditsTextBrowser->verticalScrollBar(); - scrollBar->setValue(scrollBar->value() + _scrollDirection); - - if (scrollBar->value() == scrollBar->maximum()) - { - // Toggle scroll direction and change scroll speed; - _scrollDirection = -1; - _scrollSpeed = 5; - _timer->stop(); - _timer->start(_scrollSpeed); - } - else if (scrollBar->value() == scrollBar->minimum()) - { - // Toggle scroll direction and change scroll speed; - _scrollDirection = 1; - _scrollSpeed = 100; - _timer->stop(); - _timer->start(_scrollSpeed); - } - - _dialogForm->creditsTextBrowser->update(); -} - -/*! - \brief Shows the about dialog and also starts the credits scroller. - */ -void AboutDialog::show() -{ - _timer->start(_scrollSpeed); - TQDialog::show(); -} diff --git a/src/__TODO/AboutDialog.h b/src/__TODO/AboutDialog.h deleted file mode 100644 index c849f7b..0000000 --- a/src/__TODO/AboutDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2012 by Thomas Schweitzer * - * thomas-schweitzer(at)arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License version 2.0 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program in the file LICENSE.GPL; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include - -namespace Ui -{ - class AboutDialog; -} - - -class AboutDialog : public TQDialog -{ - Q_OBJECT - - public: - AboutDialog(TQWidget *parent = NULL, TQt::WindowFlags flags = 0); - - public slots: - int exec(); - void show(); - - private slots: - void scroll(); - - private: - void changeEvent(TQEvent *event); - - Ui::AboutDialog *_dialogForm; - int _scrollDirection; - int _scrollSpeed; - TQTimer *_timer; -}; - -#endif // ABOUTDIALOG_H diff --git a/src/__TODO/AboutDialog.ui b/src/__TODO/AboutDialog.ui index dbc2b8c..3415427 100755 --- a/src/__TODO/AboutDialog.ui +++ b/src/__TODO/AboutDialog.ui @@ -2,69 +2,19 @@ AboutDialog - - - 0 - 0 - 588 - 512 - - - - - 0 - 0 - - - - - 588 - 333 - - - - About UniversalIndentGUI - :/mainWindow/info.png:/mainWindow/info.png - - 0 - TQFrame#frame { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #FFFF60, stop:0.5 #D8C304, stop:1 #FFFF60 ); border: 2px solid #A89C57; border-radius: 4px;} - - TQFrame::StyledPanel - - - - 0 - 0 - - - - - 570 - 87 - - - - - 570 - 87 - - - - - :/aboutDialog/banner.png @@ -166,27 +116,8 @@ p, li { white-space: pre-wrap; } - - TQPushButton#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #DCB28A, stop:0.5 #B8784B, stop:1 #DCB28A ); border: 2px solid #A89C57; border-radius: 4px;} TQPushButton:hover#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #B8784B, stop:0.5 #DCB28A, stop:1 #B8784B ); } TQPushButton:pressed#okButton{ border: 2px solid #D8CB75 } - - - OK - - - - - TQt::Horizontal - - - - 40 - 20 - - - - @@ -197,22 +128,4 @@ p, li { white-space: pre-wrap; } - - - okButton - clicked() - AboutDialog - accept() - - - 278 - 253 - - - 96 - 254 - - - - diff --git a/src/__TODO/MainWindow.ui b/src/__TODO/MainWindow.ui index 9ac95b1..73200d1 100755 --- a/src/__TODO/MainWindow.ui +++ b/src/__TODO/MainWindow.ui @@ -5,26 +5,7 @@ MainWindowUi - - - - 6 - - - 0 - - - - - 0 - - - 2 - - - - - + @@ -66,52 +47,5 @@ - - - TQt::PreventContextMenu - - - Main Toolbar - - - TQt::Horizontal - - - - 16 - 16 - - - - TQt::ToolButtonTextBesideIcon - - - TopToolBarArea - - - false - - - - - - - - actionExit - triggered() - MainWindowUi - close() - - - -1 - -1 - - - 399 - 299 - - - - -- cgit v1.2.1