Changeset 142 in tspsg-svn


Ignore:
Timestamp:
Oct 5, 2010, 9:44:54 PM (7 years ago)
Author:
laleppa
Message:

+ Added Online Support... and Report a Bug... menu entries.

  • Some insignificant adjustments to the code.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.pri

    r141 r142  
    3535#       l10n.path = $$PREFIX/share/TSPSG/l10n
    3636        docs.path = $$PREFIX/share/doc/TSPSG-$$VERSION
    37         apps.files = resources/tspsg.desktop
    38         apps.path = $$PREFIX/share/applications/
     37        desktop.files = resources/tspsg.desktop
     38        desktop.path = $$PREFIX/share/applications
    3939        icon.files = resources/tspsg.png
    4040        icon.path = $$PREFIX/share/pixmaps
    41         INSTALLS += apps icon
     41        INSTALLS += desktop icon
    4242}
    4343
  • trunk/resources/desktop.qrc

    r138 r142  
    55        <file>icons/l10n/flag-ua.png</file>
    66        <file>icons/128x128/application-exit.png</file>
     7        <file>icons/128x128/applications-internet.png</file>
    78        <file>icons/128x128/configure-toolbars.png</file>
    89        <file>icons/128x128/dialog-cancel.png</file>
     
    2425        <file>icons/128x128/preferences-desktop-theme.png</file>
    2526        <file>icons/128x128/preferences-system.png</file>
     27        <file>icons/128x128/tools-report-bug.png</file>
    2628        <file>icons/128x128/qtlogo.png</file>
    2729        <file>icons/128x128/roll.png</file>
  • trunk/src/mainwindow.cpp

    r141 r142  
    8787        connect(actionSettingsStyleSystem, SIGNAL(triggered(bool)), SLOT(actionSettingsStyleSystemTriggered(bool)));
    8888        connect(groupSettingsStyleList, SIGNAL(triggered(QAction*)), SLOT(groupSettingsStyleListTriggered(QAction*)));
     89        connect(actionHelpOnlineSupport, SIGNAL(triggered()), SLOT(actionHelpOnlineSupportTriggered()));
     90        connect(actionHelpReportBug, SIGNAL(triggered()), SLOT(actionHelpReportBugTriggered()));
    8991        connect(actionHelpAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    9092        connect(actionHelpAbout, SIGNAL(triggered()), SLOT(actionHelpAboutTriggered()));
     
    288290                        svg.setFileName(fi.path() + "/" + img);
    289291                        svg.setTitle(tr("Solution Graph"));
    290                         svg.setDescription(tr("Generated with %1").arg(QApplication::applicationName()));
     292                        svg.setDescription(tr("Generated with %1").arg(QCoreApplication::applicationName()));
    291293QPainter p;
    292294                        p.begin(&svg);
     
    304306                        if (pic.supportsOption(QImageIOHandler::Description)) {
    305307                                pic.setText("Title", "Solution Graph");
    306                                 pic.setText("Software", QApplication::applicationName());
     308                                pic.setText("Software", QCoreApplication::applicationName());
    307309                        }
    308310                        if (format == "png")
     
    365367        if (checked) {
    366368                settings->remove("Language");
    367                 QMessageBox::information(this, tr("Language change"), tr("Language will be autodetected on the next %1 start.").arg(QApplication::applicationName()));
     369                QMessageBox::information(this, tr("Language change"), tr("Language will be autodetected on the next %1 start.").arg(QCoreApplication::applicationName()));
    368370        } else
    369371                settings->setValue("Language", groupSettingsLanguageList->checkedAction()->data().toString());
     
    404406        if (checked) {
    405407                settings->remove("Style");
    406                 QMessageBox::information(this, tr("Style Change"), tr("To apply the default style you need to restart %1.").arg(QApplication::applicationName()));
     408                QMessageBox::information(this, tr("Style Change"), tr("To apply the default style you need to restart %1.").arg(QCoreApplication::applicationName()));
    407409        } else {
    408410                settings->setValue("Style", groupSettingsStyleList->checkedAction()->text());
     
    452454
    453455QString title;
    454         title += QString("<b>%1</b><br>").arg(QApplication::applicationName());
    455         title += QString("%1: <b>%2</b><br>").arg(tr("Version"), QApplication::applicationVersion());
     456        title += QString("<b>%1</b><br>").arg(QCoreApplication::applicationName());
     457        title += QString("%1: <b>%2</b><br>").arg(tr("Version"), QCoreApplication::applicationVersion());
    456458#ifndef HANDHELD
    457         title += QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b><br>").arg(QDate::currentDate().toString("yyyy"), QApplication::organizationDomain(), QApplication::organizationName());
     459        title += QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b><br>").arg(QDate::currentDate().toString("yyyy"), QCoreApplication::organizationDomain(), QCoreApplication::organizationName());
    458460#endif // HANDHELD
    459461        title += QString("<b><a href=\"http://tspsg.info/\">http://tspsg.info/</a></b>");
     
    505507        f.open(QIODevice::ReadOnly);
    506508
    507 QString translation = QApplication::translate("--------", "AUTHORS %1", "Please, provide translator credits here. %1 will be replaced with VERSION");
     509QString translation = QCoreApplication::translate("--------", "AUTHORS %1", "Please, provide translator credits here. %1 will be replaced with VERSION");
    508510        if ((translation != "AUTHORS %1") && (translation.contains("%1"))) {
    509 QString about = QApplication::translate("--------", "VERSION", "Please, provide your translation version here.");
     511QString about = QCoreApplication::translate("--------", "VERSION", "Please, provide your translation version here.");
    510512                if (about != "VERSION")
    511513                        translation = translation.arg(about);
     
    516518        *lblTitle = new QLabel(dlg);
    517519#ifdef HANDHELD
    518 QLabel *lblSubTitle = new QLabel(QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b>").arg(QDate::currentDate().toString("yyyy"), QApplication::organizationDomain(), QApplication::organizationName()), dlg);
     520QLabel *lblSubTitle = new QLabel(QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b>").arg(QDate::currentDate().toString("yyyy"), QCoreApplication::organizationDomain(), QCoreApplication::organizationName()), dlg);
    519521#endif // HANDHELD
    520522QTabWidget *tabs = new QTabWidget(dlg);
     
    596598
    597599        dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
    598         dlg->setWindowTitle(tr("About %1").arg(QApplication::applicationName()));
     600        dlg->setWindowTitle(tr("About %1").arg(QCoreApplication::applicationName()));
    599601        dlg->setWindowIcon(GET_ICON("help-about"));
    600602        dlg->setLayout(vb);
     
    654656QPushButton *cancel = new QPushButton(&pd);
    655657        cancel->setIcon(GET_ICON("dialog-cancel"));
    656         cancel->setText(QApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
     658        cancel->setText(QCoreApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
    657659        pd.setCancelButton(cancel);
    658660        pd.setMaximum(n);
     
    713715                        tl->SetProgressState(winId(), TBPF_INDETERMINATE);
    714716#endif
    715                 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     717                QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    716718
    717719#ifndef QT_NO_CONCURRENT
    718720QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
    719721                while (!f.isFinished()) {
    720                         QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     722                        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    721723                }
    722724#else
     
    795797                        pd.setCancelButton(NULL);
    796798                        pd.show();
    797                         QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     799                        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    798800#ifdef Q_WS_WIN32
    799801                        if (tl != NULL)
     
    803805QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
    804806                        while (!f.isFinished()) {
    805                                 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     807                                QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    806808                        }
    807809#else
     
    927929        pd.setMaximum(0);
    928930        pd.setCancelButton(NULL);
    929         QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     931        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    930932#ifdef Q_WS_WIN32
    931933        if (tl != NULL)
     
    935937QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
    936938        while (!f.isFinished()) {
    937                 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     939                QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
    938940        }
    939941#else
     
    13891391                                cur.insertText(isInteger(matrix.at(r).at(c)) ? QString("%1").arg(matrix.at(r).at(c)) : QString("%1").arg(matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()));
    13901392                }
    1391                 QApplication::processEvents();
     1393                QCoreApplication::processEvents();
    13921394        }
    13931395        cur.movePosition(QTextCursor::End);
     
    14171419                        }
    14181420                }
    1419                 QApplication::processEvents();
     1421                QCoreApplication::processEvents();
    14201422        }
    14211423
     
    14381440#ifndef QT_NO_STATUSTIP
    14391441        actionFilePrintPreview->setStatusTip(tr("Preview current solution results before printing"));
     1442#endif // QT_NO_STATUSTIP
     1443#ifndef QT_NO_STATUSTIP
     1444        actionFileExit->setStatusTip(tr("Exit %1").arg(QCoreApplication::applicationName()));
    14401445#endif // QT_NO_STATUSTIP
    14411446
     
    14571462#endif // HANDHELD
    14581463
     1464#ifndef QT_NO_STATUSTIP
     1465        actionHelpReportBug->setStatusTip(tr("Report about a bug in %1").arg(QCoreApplication::applicationName()));
     1466#endif // QT_NO_STATUSTIP
    14591467        if (actionHelpCheck4Updates != NULL) {
    14601468                actionHelpCheck4Updates->setText(tr("Check for &Updates..."));
    14611469#ifndef QT_NO_STATUSTIP
    1462                 actionHelpCheck4Updates->setStatusTip(tr("Check for %1 updates").arg(QApplication::applicationName()));
     1470                actionHelpCheck4Updates->setStatusTip(tr("Check for %1 updates").arg(QCoreApplication::applicationName()));
    14631471#endif // QT_NO_STATUSTIP
    14641472        }
     1473#ifndef QT_NO_STATUSTIP
     1474        actionHelpAbout->setStatusTip(tr("About %1").arg(QCoreApplication::applicationName()));
     1475#endif // QT_NO_STATUSTIP
    14651476}
    14661477
     
    14971508{
    14981509        this->fileName = fileName;
    1499         setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(QApplication::applicationName()));
     1510        setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(QCoreApplication::applicationName()));
    15001511}
    15011512
     
    15271538        actionHelpContents->setIcon(GET_ICON("help-contents"));
    15281539        actionHelpContextual->setIcon(GET_ICON("help-contextual"));
     1540        actionHelpOnlineSupport->setIcon(GET_ICON("applications-internet"));
     1541        actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
    15291542        actionHelpAbout->setIcon(GET_ICON("help-about"));
    15301543        actionHelpAboutQt->setIcon(QIcon(":/images/icons/"ICON_SIZE"/qtlogo."ICON_FORMAT));
     
    16721685#endif // Q_WS_WIN32
    16731686}
     1687
     1688void MainWindow::actionHelpOnlineSupportTriggered()
     1689{
     1690        QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/support"));
     1691}
     1692
     1693void MainWindow::actionHelpReportBugTriggered()
     1694{
     1695        QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/bugtracker"));
     1696}
  • trunk/src/mainwindow.h

    r141 r142  
    7474        void actionSettingsToolbarsConfigureTriggered();
    7575#endif // HANDHELD
     76        void actionHelpOnlineSupportTriggered();
     77        void actionHelpReportBugTriggered();
    7678        void actionHelpCheck4UpdatesTriggered();
    7779        void actionHelpAboutTriggered();
  • trunk/ui/mainwindow.ui

    r138 r142  
    299299    <addaction name="actionHelpContextual"/>
    300300    <addaction name="separator"/>
     301    <addaction name="actionHelpOnlineSupport"/>
     302    <addaction name="actionHelpReportBug"/>
     303    <addaction name="separator"/>
    301304    <addaction name="actionHelpAboutQt"/>
    302305    <addaction name="actionHelpAbout"/>
     
    409412    <string>&amp;About TSPSG...</string>
    410413   </property>
    411    <property name="statusTip">
    412     <string>About application</string>
    413    </property>
    414414  </action>
    415415  <action name="actionFileExit">
    416416   <property name="text">
    417417    <string>E&amp;xit</string>
    418    </property>
    419    <property name="statusTip">
    420     <string>Exit application</string>
    421418   </property>
    422419  </action>
     
    503500   <property name="statusTip">
    504501    <string>Automatically choose the most appropriate style</string>
     502   </property>
     503  </action>
     504  <action name="actionHelpOnlineSupport">
     505   <property name="text">
     506    <string>Online &amp;Support...</string>
     507   </property>
     508   <property name="statusTip">
     509    <string>Get support online</string>
     510   </property>
     511  </action>
     512  <action name="actionHelpReportBug">
     513   <property name="text">
     514    <string>Report a &amp;Bug...</string>
    505515   </property>
    506516  </action>
Note: See TracChangeset for help on using the changeset viewer.