Changeset 14398


Ignore:
Timestamp:
Dec 25, 2014, 7:39:45 PM (8 years ago)
Author:
mikedld
Message:

Rework about dialog in Qt client to load from .ui

Location:
trunk/qt
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/CMakeLists.txt

    r14396 r14398  
    102102
    103103tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
     104    about.ui
    104105    details.ui
    105106    mainwin.ui
  • trunk/qt/about.cc

    r14394 r14398  
    3232  myLicenseDialog (new LicenseDialog (this))
    3333{
    34   setWindowTitle (tr ("About Transmission"));
    35   QLabel * l;
    36   QVBoxLayout * v = new QVBoxLayout (this);
     34  ui.setupUi (this);
    3735
    38   l = new QLabel;
    39   l->setPixmap (QApplication::windowIcon ().pixmap (48));
    40   l->setAlignment (Qt::AlignCenter);
    41   v->addWidget (l);
    42 
    43   QFont f (font ());
    44   f.setWeight (QFont::Bold);
    45   f.setPointSize (int (f.pointSize () * 1.2));
    46   l = new QLabel (tr ("<big>Transmission %1</big>").arg (QString::fromUtf8 (LONG_VERSION_STRING)));
    47   l->setAlignment (Qt::AlignCenter);
    48   l->setFont (f);
    49   l->setMargin (8);
    50   v->addWidget (l);
    51 
    52   l = new QLabel (tr ("A fast and easy BitTorrent client"));
    53   l->setStyleSheet (QString::fromUtf8 ("text-align: center"));
    54   l->setAlignment (Qt::AlignCenter);
    55   v->addWidget (l);
    56 
    57   l = new QLabel (tr ("Copyright (c) The Transmission Project"));
    58   l->setAlignment (Qt::AlignCenter);
    59   v->addWidget (l);
    60 
    61   l = new QLabel (QString::fromUtf8 ("<a href=\"http://www.transmissionbt.com/\">http://www.transmissionbt.com/</a>"));
    62   l->setOpenExternalLinks (true);
    63   l->setAlignment (Qt::AlignCenter);
    64   v->addWidget (l);
    65 
    66   v->addSpacing (HIG::PAD_BIG);
     36  ui.iconLabel->setPixmap (QApplication::windowIcon ().pixmap (48));
     37  ui.titleLabel->setText (tr ("<big><b>Transmission %1</b></big>").arg (QString::fromUtf8 (LONG_VERSION_STRING)));
    6738
    6839  QPushButton * b;
    69   QDialogButtonBox * box = new QDialogButtonBox;
    7040
    7141  b = new QPushButton (tr ("C&redits"), this);
    72   box->addButton (b, QDialogButtonBox::ActionRole);
     42  ui.dialogButtons->addButton (b, QDialogButtonBox::ActionRole);
    7343  connect (b, SIGNAL (clicked ()), this, SLOT (showCredits ()));
    7444
    7545  b = new QPushButton (tr ("&License"), this);
    76   box->addButton (b, QDialogButtonBox::ActionRole);
     46  ui.dialogButtons->addButton (b, QDialogButtonBox::ActionRole);
    7747  connect (b, SIGNAL (clicked ()), myLicenseDialog, SLOT (show ()));
    7848
    79   box->addButton (QDialogButtonBox::Close);
    80   box->setCenterButtons (true);
    81   v->addWidget (box);
    82   connect (box, SIGNAL (rejected ()), this, SLOT (hide ()));
     49  ui.dialogButtons->button (QDialogButtonBox::Close)->setDefault (true);
    8350}
    8451
  • trunk/qt/about.h

    r14241 r14398  
    1313#include <QDialog>
    1414
     15#include "ui_about.h"
     16
    1517class AboutDialog: public QDialog
    1618{
    1719    Q_OBJECT
    1820
    19   private:
    20     QDialog * myLicenseDialog;
    21 
    2221  public:
    2322    AboutDialog (QWidget * parent = 0);
    2423    ~AboutDialog () {}
    25     QWidget * createAboutTab ();
    26     QWidget * createAuthorsTab ();
    27     QWidget * createLicenseTab ();
    2824
    2925  public slots:
    3026    void showCredits ();
    3127
     28  private:
     29    QDialog * myLicenseDialog;
     30    Ui::AboutDialog ui;
    3231};
    3332
  • trunk/qt/qtr.pro

    r14393 r14398  
    4747                translations/transmission_uk.ts
    4848
    49 FORMS += details.ui \
     49FORMS += about.ui \
     50         details.ui \
    5051         mainwin.ui \
    5152         session-dialog.ui \
Note: See TracChangeset for help on using the changeset viewer.