Exemple #1
0
void TorrentDialog::Search(wstring url, wstring title) {
  Feed* feed = Aggregator.Get(FEED_CATEGORY_LINK);
  if (!feed) return;

  MainDialog.navigation.SetCurrentPage(SIDEBAR_ITEM_FEEDS);
  MainDialog.edit.SetText(title);
  MainDialog.ChangeStatus(L"Searching torrents for \"" + title + L"\"...");

  Replace(url, L"%title%", title);
  feed->Check(url);
}
Exemple #2
0
void TorrentDialog::Search(std::wstring url, std::wstring title) {
  Feed* feed = Aggregator.Get(kFeedCategoryLink);
  if (!feed)
    return;

  DlgMain.navigation.SetCurrentPage(kSidebarItemFeeds);
  DlgMain.edit.SetText(title);
  DlgMain.ChangeStatus(L"Searching torrents for \"" + title + L"\"...");

  Replace(url, L"%title%", title);
  feed->Check(url);
}
Exemple #3
0
BOOL TorrentDialog::OnCommand(WPARAM wParam, LPARAM lParam) {
  Feed* feed = Aggregator.Get(kFeedCategoryLink);
  if (!feed)
    return 0;

  // Toolbar
  switch (LOWORD(wParam)) {
    // Check new torrents
    case 100: {
      DlgMain.edit.SetText(L"");
      feed->Check(Settings[taiga::kTorrent_Discovery_Source]);
      /**
      #ifdef _DEBUG
      feed->Load();
      feed->ExamineData();
      RefreshList();
      #endif
      /**/
      return TRUE;
    }
    // Download marked torrents
    case 101: {
      feed->Download(-1);
      return TRUE;
    }
    // Discard marked torrents
    case 102: {
      for (int i = 0; i < list_.GetItemCount(); i++) {
        if (list_.GetCheckState(i) == TRUE) {
          FeedItem* feed_item = reinterpret_cast<FeedItem*>(list_.GetItemParam(i));
          if (feed_item) {
            feed_item->state = kFeedItemDiscardedNormal;
            list_.SetCheckState(i, FALSE);
            Aggregator.file_archive.push_back(feed_item->title);
          }
        }
      }
      return TRUE;
    }
    // Settings
    case 103: {
      ShowDlgSettings(kSettingsSectionTorrents, kSettingsPageTorrentsDiscovery);
      return TRUE;
    }
  }

  return FALSE;
}
Exemple #4
0
BOOL TorrentDialog::OnCommand(WPARAM wParam, LPARAM lParam) {
  Feed* feed = Aggregator.Get(FEED_CATEGORY_LINK);
  if (!feed) return 0;
  
  // Toolbar
  switch (LOWORD(wParam)) {
    // Check new torrents
    case 100: {
      MainDialog.edit.SetText(L"");
      feed->Check(Settings.RSS.Torrent.source);
      /**
      #ifdef _DEBUG
      feed->Load();
      feed->ExamineData();
      RefreshList();
      #endif
      /**/
      return TRUE;
    }
    // Download marked torrents
    case 101: {
      feed->Download(-1);
      return TRUE;
    }
    // Discard marked torrents
    case 102: {
      for (int i = 0; i < list_.GetItemCount(); i++) {
        if (list_.GetCheckState(i) == TRUE) {
          FeedItem* feed_item = reinterpret_cast<FeedItem*>(list_.GetItemParam(i));
          if (feed_item) {
            feed_item->state = FEEDITEM_DISCARDED_NORMAL;
            list_.SetCheckState(i, FALSE);
            Aggregator.file_archive.push_back(feed_item->title);
          }
        }
      }
      return TRUE;
    }
    // Settings
    case 103: {
      ExecuteAction(L"Settings", SECTION_TORRENTS, PAGE_TORRENTS_DISCOVERY);
      return TRUE;
    }
  }

  return FALSE;
}