About::About(QWidget *parent) : QWidget(parent) { this->setWindowTitle( tr("About") ); this->setWindowIcon( SMasterIcons::icon(QSize(48,48),"help-about.png") ); list_widget = new QListWidget(); list_widget->setIconSize( QSize(48,48) ); list_widget->setGridSize( QSize( 128 , 92 ) ); list_widget->setViewMode( QListView::IconMode ); about_widget = new QWidget(); app_info_widget = new AppInfoWidget(); back_button = new QPushButton( SMasterIcons::icon(QSize(48,48),"go-previous.png") , tr("Back") ); about_panel_layout = new QHBoxLayout(); about_panel_layout->addSpacerItem( new QSpacerItem( 2 , 4 , QSizePolicy::Expanding , QSizePolicy::Minimum ) ); about_panel_layout->addWidget( back_button ); about_layout = new QVBoxLayout( about_widget ); about_layout->addWidget( app_info_widget ); about_layout->addLayout( about_panel_layout ); about_layout->setContentsMargins( 0 , 0 , 0 , 0 ); stacked_widget = new QStackedWidget(); stacked_widget->addWidget( list_widget ); stacked_widget->addWidget(about_widget ); base_layout = new QHBoxLayout( this ); base_layout->addWidget( stacked_widget ); connect( list_widget , SIGNAL(itemDoubleClicked(QListWidgetItem*)) , this , SLOT(showItem(QListWidgetItem*)) ); connect( back_button , SIGNAL(clicked()) , this , SLOT(showFirstPage()) ); }
_actionGroupWidgets.insert(_protocolAction, protocolWidget); _actionGroupWidgets.insert(generalAction, generalSettings); _actionGroupWidgets.insert(networkAction, networkSettings); connect(_actionGroup, SIGNAL(triggered(QAction*)), SLOT(slotSwitchPage(QAction*))); connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState*)), this, SLOT(accountAdded(AccountState*))); connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState*)), this, SLOT(accountRemoved(AccountState*))); foreach (auto ai , AccountManager::instance()->accounts()) { accountAdded(ai.data()); } QTimer::singleShot(1, this, SLOT(showFirstPage())); QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close); connect(closeButton, SIGNAL(clicked()), SLOT(accept())); QAction *showLogWindow = new QAction(this); showLogWindow->setShortcut(QKeySequence("F12")); connect(showLogWindow, SIGNAL(triggered()), gui, SLOT(slotToggleLogBrowser())); addAction(showLogWindow); customizeStyle(); ConfigFile cfg; cfg.restoreGeometry(this); }