void MapSourceGoogle::onOptionsOpened() { onOptionsChanged(Options::node(OPV_MAP_SOURCE_GOOGLE_VERSION_MAP)); onOptionsChanged(Options::node(OPV_MAP_SOURCE_GOOGLE_VERSION_SATELLITE)); onOptionsChanged(Options::node(OPV_MAP_SOURCE_GOOGLE_VERSION_TERRAIN_R)); onOptionsChanged(Options::node(OPV_MAP_SOURCE_GOOGLE_VERSION_TERRAIN_T)); }
EditWidget::EditWidget(IMessageWidgets *AMessageWidgets, IMessageWindow *AWindow, QWidget *AParent) : QWidget(AParent) { ui.setupUi(this); ui.medEditor->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); FWindow = AWindow; FMessageWidgets = AMessageWidgets; FBufferPos = -1; FSendEnabled = true; FEditEnabled = true; setRichTextEnabled(false); QToolBar *toolBar = new QToolBar; toolBar->setMovable(false); toolBar->setFloatable(false); toolBar->setIconSize(QSize(16,16)); toolBar->layout()->setMargin(0); toolBar->setStyleSheet("QToolBar { border: none; }"); toolBar->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); FEditToolBar = new ToolBarChanger(toolBar); FEditToolBar->setMinimizeWidth(true); FEditToolBar->setSeparatorsVisible(false); connect(FEditToolBar,SIGNAL(itemRemoved(QAction *)),SLOT(onUpdateEditToolBarVisibility())); connect(FEditToolBar,SIGNAL(itemInserted(QAction *, QAction *, Action *, QWidget *, int)),SLOT(onUpdateEditToolBarVisibility())); ui.wdtSendToolBar->setLayout(new QHBoxLayout); ui.wdtSendToolBar->layout()->setMargin(0); ui.wdtSendToolBar->layout()->addWidget(toolBar); FSendAction = new Action(toolBar); FSendAction->setToolTip(tr("Send")); FSendAction->setIcon(RSR_STORAGE_MENUICONS,MNI_MESSAGEWIDGETS_SEND); connect(FSendAction,SIGNAL(triggered(bool)),SLOT(onSendActionTriggered(bool))); FEditToolBar->insertAction(FSendAction,TBG_MWEWTB_SENDMESSAGE); ui.medEditor->installEventFilter(this); ui.medEditor->setContextMenuPolicy(Qt::CustomContextMenu); Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITNEXTMESSAGE,ui.medEditor); Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITPREVMESSAGE,ui.medEditor); connect(ui.medEditor,SIGNAL(createDataRequest(QMimeData *)),SLOT(onEditorCreateDataRequest(QMimeData *))); connect(ui.medEditor,SIGNAL(canInsertDataRequest(const QMimeData *, bool &)), SLOT(onEditorCanInsertDataRequest(const QMimeData *, bool &))); connect(ui.medEditor,SIGNAL(insertDataRequest(const QMimeData *, QTextDocument *)), SLOT(onEditorInsertDataRequest(const QMimeData *, QTextDocument *))); connect(ui.medEditor->document(),SIGNAL(contentsChange(int,int,int)),SLOT(onEditorContentsChanged(int,int,int))); connect(ui.medEditor,SIGNAL(customContextMenuRequested(const QPoint &)),SLOT(onEditorCustomContextMenuRequested(const QPoint &))); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORAUTORESIZE)); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORMINIMUMLINES)); connect(Options::instance(),SIGNAL(optionsChanged(const OptionsNode &)),SLOT(onOptionsChanged(const OptionsNode &))); connect(Shortcuts::instance(),SIGNAL(shortcutUpdated(const QString &)),SLOT(onShortcutUpdated(const QString &))); connect(Shortcuts::instance(),SIGNAL(shortcutActivated(const QString &, QWidget *)),SLOT(onShortcutActivated(const QString &, QWidget *))); onUpdateEditToolBarVisibility(); }
void UserTuneHandler::onOptionsOpened() { onOptionsChanged(Options::node(OPV_USERTUNE_SHOW_ROSTER_LABEL)); onOptionsChanged(Options::node(OPV_USERTUNE_TAG_FORMAT)); #ifdef READ_WRITE_TUNE onOptionsChanged(Options::node(OPV_USERTUNE_ALLOW_SEND_MUSIC_INFO)); onOptionsChanged(Options::node(OPV_USERTUNE_NOT_ALLOW_SEND_URL_INFO)); onOptionsChanged(Options::node(OPV_USERTUNE_PLAYER_VER)); #endif }
void MainWindowPlugin::onOptionsOpened() { FMinimizeNotifyId = -1; // Enable minimize notify FOpenAction->setVisible(true); updateTitle(); QString ns = FMainWindowBorder ? QString::null : QString("system-border"); if (!mainWindowTopWidget()->restoreGeometry(Options::fileValue("mainwindow.geometry",ns).toByteArray())) mainWindowTopWidget()->setGeometry(WidgetManager::alignGeometry(QSize(300,550),mainWindowTopWidget(),Qt::AlignRight | Qt::AlignTop)); onOptionsChanged(Options::node(OPV_MAINWINDOW_STAYONTOP)); onOptionsChanged(Options::node(OPV_MAINWINDOW_MINIMIZETOTRAY_W7)); }
void MainWindowPlugin::onOptionsOpened() { QWidget *widget = FMainWindowBorder ? (QWidget*)FMainWindowBorder : (QWidget*)FMainWindow; widget->resize(Options::node(OPV_MAINWINDOW_SIZE).value().toSize()); widget->move(Options::node(OPV_MAINWINDOW_POSITION).value().toPoint()); FOpenAction->setVisible(true); onOptionsChanged(Options::node(OPV_MAINWINDOW_STAYONTOP)); onOptionsChanged(Options::node(OPV_MAINWINDOW_MINIMIZETOTRAY_W7)); if (Options::node(OPV_MAINWINDOW_SHOW).value().toBool()) showMainWindow(); #ifdef Q_WS_WIN else if ((QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7) && !Options::node(OPV_MAINWINDOW_MINIMIZETOTRAY_W7).value().toBool()) widget->showMinimized(); #endif updateTitle(); }
bool UserTuneHandler::initSettings() { Options::setDefaultValue(OPV_USERTUNE_SHOW_ROSTER_LABEL,true); Options::setDefaultValue(OPV_USERTUNE_ALLOW_SEND_MUSIC_INFO,true); Options::setDefaultValue(OPV_USERTUNE_NOT_ALLOW_SEND_URL_INFO,false); Options::setDefaultValue(OPV_USERTUNE_TAG_FORMAT,QLatin1String("%T - %A - %S")); #ifdef READ_WRITE_TUNE Options::setDefaultValue(OPV_USERTUNE_PLAYER_NAME,QLatin1String("amarok")); Options::setDefaultValue(OPV_USERTUNE_PLAYER_VER,FetcherVer::mprisV1); #else // TODO: сделать для windows Options::setDefaultValue(OPV_USERTUNE_PLAYER_NAME,QLatin1String("")); Options::setDefaultValue(OPV_USERTUNE_PLAYER_VER,FetcherVer::fetcherNone); #endif if (FOptionsManager) { IOptionsDialogNode dnode = { ONO_USERTUNE, OPN_USERTUNE, MNI_USERTUNE_MUSIC, tr("User Tune") }; FOptionsManager->insertOptionsDialogNode(dnode); FOptionsManager->insertOptionsDialogHolder(this); } onOptionsChanged(Options::node(OPV_USERTUNE_SHOW_ROSTER_LABEL)); return true; }
EditWidget::EditWidget(IMessageWidgets *AMessageWidgets, const Jid& AStreamJid, const Jid &AContactJid) { ui.setupUi(this); ui.medEditor->setAcceptRichText(true); ui.medEditor->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); QVBoxLayout *vlayout = new QVBoxLayout; vlayout->setMargin(1); vlayout->addWidget(ui.tlbSend,0,Qt::AlignBottom); QHBoxLayout *hlayout = new QHBoxLayout; hlayout->addStretch(); hlayout->setContentsMargins(2, 2, 20, 2); hlayout->addLayout(vlayout); ui.medEditor->setLayout(hlayout); ui.medEditor->setAcceptRichText(false); ui.medEditor->installEventFilter(this); ui.medEditor->setLineWrapMode(QTextEdit::FixedPixelWidth); FMessageWidgets = AMessageWidgets; FStreamJid = AStreamJid; FContactJid = AContactJid; FBufferPos = -1; FSendShortcut = new QShortcut(ui.medEditor); FSendShortcut->setContext(Qt::WidgetShortcut); connect(FSendShortcut,SIGNAL(activated()),SLOT(onShortcutActivated())); connect(ui.tlbSend,SIGNAL(clicked(bool)),SLOT(onSendButtonCliked(bool))); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORAUTORESIZE)); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORMINIMUMLINES)); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORMAXIMUMLINES)); onOptionsChanged(Options::node(OPV_MESSAGES_EDITORSENDKEY)); connect(Options::instance(),SIGNAL(optionsChanged(const OptionsNode &)),SLOT(onOptionsChanged(const OptionsNode &))); }
bool MapSourceGoogle::initConnections(IPluginManager *APluginManager, int &AInitOrder) { Q_UNUSED(AInitOrder) IPlugin *plugin = APluginManager->pluginInterface("IOptionsManager").value(0,NULL); if (plugin) FOptionsManager = qobject_cast<IOptionsManager *>(plugin->instance()); plugin = APluginManager->pluginInterface("IMap").value(0,NULL); if (plugin) FMap = qobject_cast<IMap *>(plugin->instance()); connect(Options::instance(), SIGNAL(optionsOpened()), SLOT(onOptionsOpened())); connect(Options::instance(), SIGNAL(optionsChanged(OptionsNode)), SLOT(onOptionsChanged(OptionsNode))); return true; }
void MapSourceYandex::onOptionsOpened() { onOptionsChanged(Options::node(OPV_MAP_SOURCE_YANDEX_VERSION_SATELLITE)); onOptionsChanged(Options::node(OPV_MAP_SOURCE_YANDEX_VERSION_SCHEME)); }
void TuneListenerFile::onOptionsOpened() { onOptionsChanged(Options::node(OPV_TUNE_LISTENER_FILE_NAME)); onOptionsChanged(Options::node(OPV_TUNE_LISTENER_FILE_FORMAT)); }