void MythNews::ShowEditDialog(bool edit) { QMutexLocker locker(&m_lock); NewsSite *site = NULL; if (edit) { MythUIButtonListItem *siteListItem = m_sitesList->GetItemCurrent(); if (!siteListItem || siteListItem->GetData().isNull()) return; site = qVariantValue<NewsSite*>(siteListItem->GetData()); } MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); MythNewsEditor *mythnewseditor = new MythNewsEditor(site, edit, mainStack, "mythnewseditor"); if (mythnewseditor->Create()) { connect(mythnewseditor, SIGNAL(Exiting()), SLOT(loadSites())); mainStack->AddScreen(mythnewseditor); } else delete mythnewseditor; }
MainWindow::MainWindow(QWidget* parent, const char* name, WFlags fl) // : KMainWindow(parent, name, fl), m_debuggerSettings(0), m_browserSettings(0) : KParts::MainWindow(parent, name, fl), m_debuggerSettings(0), m_browserSettings(0) { if(!name) { setName("MainWindow"); } setupStatusBar(); m_debugger_manager = new DebuggerManager(this); createWidgets(); setupActions(); createGUI(0); resize( QSize(633, 533).expandedTo(minimumSizeHint()) ); clearWState(WState_Polished); m_debugger_manager->init(); connect(kapp, SIGNAL(aboutToQuit()), this, SLOT(slotClose())); connect(ProtoeditorSettings::self(), SIGNAL(sigSettingsChanged()), this, SLOT(slotSettingsChanged())); loadSites(); stateChanged("init"); }
bool MythNews::Create(void) { QMutexLocker locker(&m_lock); bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("news-ui.xml", "news", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_sitesList, "siteslist", &err); UIUtilE::Assign(this, m_articlesList, "articleslist", &err); UIUtilE::Assign(this, m_titleText, "title", &err); UIUtilE::Assign(this, m_descText, "description", &err); // these are all optional UIUtilW::Assign(this, m_nositesText, "nosites", &err); UIUtilW::Assign(this, m_updatedText, "updated", &err); UIUtilW::Assign(this, m_thumbnailImage, "thumbnail", &err); UIUtilW::Assign(this, m_enclosureImage, "enclosures", &err); UIUtilW::Assign(this, m_downloadImage, "download", &err); UIUtilW::Assign(this, m_podcastImage, "ispodcast", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'news'"); return false; } if (m_nositesText) { m_nositesText->SetText(tr("You haven't configured MythNews to use any sites.")); m_nositesText->Hide(); } BuildFocusList(); SetFocusWidget(m_sitesList); loadSites(); updateInfoView(m_sitesList->GetItemFirst()); connect(m_sitesList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT( slotSiteSelected(MythUIButtonListItem*))); connect(m_articlesList, SIGNAL(itemSelected( MythUIButtonListItem*)), this, SLOT( updateInfoView(MythUIButtonListItem*))); connect(m_articlesList, SIGNAL(itemClicked( MythUIButtonListItem*)), this, SLOT( slotViewArticle(MythUIButtonListItem*))); return true; }
void MythNews::ShowFeedManager() { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); MythNewsConfig *mythnewsconfig = new MythNewsConfig(mainStack, "mythnewsconfig"); if (mythnewsconfig->Create()) { connect(mythnewsconfig, SIGNAL(Exiting()), SLOT(loadSites())); mainStack->AddScreen(mythnewsconfig); } else delete mythnewsconfig; }
void MythNews::deleteNewsSite(void) { QMutexLocker locker(&m_lock); MythUIButtonListItem *siteUIItem = m_sitesList->GetItemCurrent(); if (siteUIItem && !siteUIItem->GetData().isNull()) { NewsSite *site = qVariantValue<NewsSite*>(siteUIItem->GetData()); if (site) { removeFromDB(site->name()); loadSites(); } } }
ProtoeditorSettings::ProtoeditorSettings() : QObject(), KConfigSkeleton( QString::fromLatin1( "protoeditorrc" ) ) { KConfigSkeleton::ItemString *itemCurrentSite; itemCurrentSite = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "CurrentSite" ), m_currentSiteName); addItem( itemCurrentSite, QString::fromLatin1( "CurrentSite" ) ); readConfig(); //-- m_phpSettings = new PHPSettings(); m_extApptSettings = new ExtAppSettings(); //load all Sites loadSites(); }
void MainWindow::slotSettingsChanged() { loadSites(); }