AppearanceSettings::AppearanceSettings(QWidget* parent, Qt::WFlags fl) : QDialog(parent, fl), m_isStatusView(false) { initUi(); loadThemes(); loadColorSchemes(); loadSavedTheme(); connect(qApp, SIGNAL(appMessage(QString,QByteArray)), this, SLOT(receiveAppMessage(QString,QByteArray))); QMenu *menu = QSoftMenuBar::menuFor(this); menu->addAction(QIcon(":icon/Note"), tr("Add to current profile"), this, SLOT(pushSettingStatus())); menu->addAction(QIcon(":image/homescreen/homescreen"), tr("Homescreen Settings..."), this, SLOT(openHomescreenSettings())); setWindowTitle(tr("Appearance")); }
// AppearanceSettings ---------------------------------------------------- AppearanceSettings::AppearanceSettings( QWidget* parent, Qt::WFlags fl ) : QDialog(parent, fl), mIsStatusView(false), mIsFromActiveProfile(false) { setupUi(); readThemeSettings(); readColorSchemeSettings(); // Populate the first combo box (theme). populate(); // Select the theme to populate the other combo boxes. // Note that they are not connected yet, so no preview is requested. themeSelected(mActiveThemeIndex); // Connect the combo boxes. connect( mThemeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(themeSelected(int)) ); connect( mColorCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(colorSelected(int)) ); connect( mBgCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(backgroundSelected(QString)) ); connect( mLabelCkBox, SIGNAL(toggled(bool)), this, SLOT(labelToggled(bool)) ); connect( qApp, SIGNAL(appMessage(QString,QByteArray)), this, SLOT(receive(QString,QByteArray)) ); // Re-select the theme to request the previews. themeSelected(mActiveThemeIndex); QSoftMenuBar::menuFor( this )->addAction ( QIcon( ":icon/Note" ), tr( "Add to current profile" ), this, SLOT(pushSettingStatus()) ); QSoftMenuBar::menuFor( this )->addAction ( QIcon( ":image/homescreen/homescreen" ), tr( "Homescreen Settings..." ), this, SLOT(openHomescreenSettings()) ); }