当前位置: 首页>>代码示例>>Python>>正文


Python Settings.currentSettings方法代码示例

本文整理汇总了Python中Settings.Settings.currentSettings方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.currentSettings方法的具体用法?Python Settings.currentSettings怎么用?Python Settings.currentSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings.Settings的用法示例。


在下文中一共展示了Settings.currentSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import currentSettings [as 别名]
  def start(self, tray):
    startDB = DB();
    settings = Settings(startDB);
    settings = settings.currentSettings();

    FeedBox.FeedBox.setTheme(settings['theme']); 
    
    if(settings['startMinimalized']):
      tray.minimalization();
    if(settings['startup']):
      self.updateAllFeeds();
开发者ID:michal-at-git,项目名称:rss-dragonfly,代码行数:13,代码来源:rss-dragonfly.py

示例2: rss_dragonfly

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import currentSettings [as 别名]
class rss_dragonfly(Window):
  selected = False;
  def __init__(self, parent=None):
    super(rss_dragonfly, self).__init__(parent);
    self.drawWindow();
    
    self.database = DB();
    self.feedList = FeedList(self.feedListWidget, self.database);
    self.addFeedPopup = AddFeedDialog();
    self.editFeedDialog = EditFeedDialog();
    self.aboutDialog = AboutDialog();
    self.settings = Settings(self.database);
    self.settingsDialog = SettingsDialog(self.settings.currentSettings());

    
    self.connect(self.aboutAction, SIGNAL("triggered()"), self.aboutDialog.exec_);
    self.connect(self.importAction, SIGNAL("triggered()"), self.fromFile);
    self.connect(self.settingsAction, SIGNAL("triggered()"), self.displaySettings);
    
    self.connect(self.settingsDialog.saveButton, SIGNAL("clicked()"), self.saveSettings);

    
    self.connect(self.goButton, SIGNAL("clicked()"), self.readFromAddrBar);
    

    self.connect(self.addressInput, SIGNAL("returnPressed()"), self.readFromAddrBar);
    
    self.connect(self.quitAction, SIGNAL("triggered()"), self.quit)
    
    self.connect(self.addNewFeedButton, SIGNAL("clicked()"), self.addFeedPopup.exec_)
   

    self.feedListWidget.itemActivated.connect(self.listItemSelected);
    
    self.feedListWidget.setContextMenuPolicy(Qt.CustomContextMenu);
    self.connect(self.feedListWidget, SIGNAL("customContextMenuRequested(const QPoint &)"), self.listMenu);
    

    self.connect(self.reloadFeedsButton, SIGNAL("clicked()"), self.updateAllFeeds);
    
    # context menu form list
    self.connect(self.updateItemAction, SIGNAL("triggered()"), self.updateSelectedFeed);
    self.connect(self.deleteItemAction, SIGNAL("triggered()"), self.rmFeed);
    self.connect(self.editItemAction, SIGNAL("triggered()"), self.editFeed);
    self.connect(self.checkUpdatesAction, SIGNAL("triggered()"), self.checkForUpdates);
    
    self.connect(self.rmFeedButton, SIGNAL("clicked()"), self.rmFeed)
    self.connect(self.saveFromAddrButton, SIGNAL("clicked()"), self.saveOpened);
    
    #popUp
    
    #popUp signals:
    self.connect(self.addFeedPopup.send, SIGNAL("clicked()"), self.addFeed);
    self.connect(self.addFeedPopup.cancel, SIGNAL("clicked()"), self.cancel);
    self.connect(self.aboutDialog.closeButton, SIGNAL("clicked()"), self.aboutDialog.close);
    self.connect(self.editItemAction, SIGNAL("clicked()"), self.editFeed);
    self.connect(self.editFeedDialog.save, SIGNAL("clicked()"), self.editFeedSubmit);
    
    

    
    self.rmFeedButton.setDisabled(True);
    self.saveFromAddrButton.setDisabled(True);
    
  def start(self, tray):
    startDB = DB();
    settings = Settings(startDB);
    settings = settings.currentSettings();

    FeedBox.FeedBox.setTheme(settings['theme']); 
    
    if(settings['startMinimalized']):
      tray.minimalization();
    if(settings['startup']):
      self.updateAllFeeds();


  def listMenu(self, point):
    currentItem = self.feedListWidget.currentItem()
    if currentItem:
      self.selected = self.feedListWidget.indexFromItem(currentItem).row()
      #self.listItemSelected(currentItem)
      self.listItemMenu.exec_(QCursor.pos());
    
  def readFromAddrBar(self):
    if len(str(self.addressInput.text())) > 1:
      if self.selected != False:
	
	self.selected = False;
      
      source = Source();
      source = source.fromURL(str(self.addressInput.text()));
      if(source != False):
	try:
	  feed = Feed(source);  
	  self.rssContentView.setHtml(unicode(FeedBox.FeedBox.showFeeds(feed.feedTitle, feed.toHTML())));
	  self.updateTitle(str(feed.feedTitle).replace("'", "'"));
	  self.rmFeedButton.setEnabled(False);
	  #self.reloadOneFeedButton.setEnabled(False);
	  self.saveFromAddrButton.setEnabled(True);
#.........这里部分代码省略.........
开发者ID:michal-at-git,项目名称:rss-dragonfly,代码行数:103,代码来源:rss-dragonfly.py


注:本文中的Settings.Settings.currentSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。