示例#1
0
void Creator::LoadCalibration(const QString & input)
{
	InputList::_lastDirectory = input;
	ui.calibrationLabel->setText(input);
	ui.compareLabel->setText("");
	std::string title = FindTitle(input.toStdString().c_str());
	QString calSettingsFile = QApplication::applicationDirPath() + title.c_str() + CCalibrationExt;
	QSettings calSettings(calSettingsFile, QSettings::IniFormat);
	_capturer.Load(input);
	if (calSettings.status() == QSettings::NoError)
	{
		QVariant v;
		v = calSettings.value("k1");
		ui.k1->setValue(v.toDouble());
		v = calSettings.value("k2");
		ui.k2->setValue(v.toDouble());
		v = calSettings.value("k3");
		ui.k3->setValue(v.toDouble());

		v = calSettings.value("f");
		ui.focusValue->setValue(v.toDouble());

		v = calSettings.value("px");
		ui.principalXValue->setValue(v.toDouble());

		v = calSettings.value("py");
		ui.principalYValue->setValue(v.toDouble());
	}
}
示例#2
0
HRESULT URLParser::Parse(std::wstring& wstrURL, std::vector<KEY_VAL_PAIR>& v_pairKeyVal)
{
    HRESULT hr = S_OK;
    std::wstring wstrOutFileName;
    std::wstring wstrVideoURL;
    
    hr = m_objContentDownloader.DownloadURL(wstrURL, wstrOutFileName);
    if(S_OK != hr)
    {
        return hr;
    }
    // Open URL
    m_objFileHelper.OpenFile(wstrOutFileName);
    // Find Title
    FindTitle(v_pairKeyVal);
    // Get Video URLs
    hr = ParseVideoURL(wstrURL, wstrVideoURL);
    if(S_OK != hr)
    {
        return hr;
    }
    // Download Video URL
    hr = m_objContentDownloader.DownloadURL(wstrVideoURL, wstrOutFileName);
    if(S_OK != hr)
    {
        return hr;
    }
    m_objFileHelper.OpenFile(wstrOutFileName);
    PopulateMetaData(v_pairKeyVal);
    return hr;
}
示例#3
0
void Creator::SaveCalibration()
{
	QString input = ui.calibrationLabel->text();
	std::string title = FindTitle(input.toStdString().c_str());
	QString calSettingsFile = QApplication::applicationDirPath() + title.c_str() + CCalibrationExt;
	QSettings calSettings(calSettingsFile, QSettings::IniFormat);
	if (calSettings.status() == QSettings::NoError)
	{
		calSettings.setValue("k1",ui.k1->value());
		calSettings.setValue("k2",ui.k2->value());
		calSettings.setValue("k3",ui.k3->value());
		calSettings.setValue("f", ui.focusValue->value());
		calSettings.setValue("px",ui.principalXValue->value());
		calSettings.setValue("py",ui.principalYValue->value());
	}
	calSettings.sync();
}
bool DlgObjProperties::changed(const std::string& propTitle) const
{
	PropertyEditorList::const_iterator i = std::find_if(m_props.begin(), m_props.end(), refbind2nd(FindTitle(), propTitle));
	if (i == m_props.end())
		return false;

	return (*i)->changed();
}
示例#5
0
文件: commands.cpp 项目: Akscan/QtWeb
QString MenuCommands::Get(int ind, What w) const
{
    int cur = 0;

    if (cur++ == ind)
        return (w == Key ? FileKey() : (w == Title? FileTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? NewWinKey() : (w == Title? NewWinTitle() : GetStr(NewWinShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OpenFileKey() : (w == Title? OpenFileTitle() : GetStr(OpenFileShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OpenLocKey() : (w == Title? OpenLocTitle() : GetStr(OpenLocShortcuts())));

    if (cur++ == ind)
        return (w == Key ? SaveAsKey() : (w == Title? SaveAsTitle() : GetStr(SaveAsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? SavePdfKey() : (w == Title? SavePdfTitle() : GetStr(SavePdfShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ImportKey() : (w == Title? ImportTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? ImportIEKey() : (w == Title? ImportIETitle() : GetStr(ImportIEShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ImportFFKey() : (w == Title? ImportFFTitle() : GetStr(ImportFFShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ImportHtmlKey() : (w == Title? ImportHtmlTitle() : GetStr(ImportHtmlShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ImportXmlKey() : (w == Title? ImportXmlTitle() : GetStr(ImportXmlShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ExportKey() : (w == Title? ExportTitle() : GetStr(ExportShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PrintKey() : (w == Title? PrintTitle() : GetStr(PrintShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PreviewKey() : (w == Title? PreviewTitle() : GetStr(PreviewShortcuts())));

    if (cur++ == ind)
        return (w == Key ? QuitKey() : (w == Title? QuitTitle() : GetStr(QuitShortcuts())));

    if (cur++ == ind)
        return (w == Key ? EditKey() : (w == Title? EditTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? UndoKey() : (w == Title? UndoTitle() : GetStr(UndoShortcuts())));

    if (cur++ == ind)
        return (w == Key ? RedoKey() : (w == Title? RedoTitle() : GetStr(RedoShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CutKey() : (w == Title? CutTitle() : GetStr(CutShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CopyKey() : (w == Title? CopyTitle() : GetStr(CopyShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PasteKey() : (w == Title? PasteTitle() : GetStr(PasteShortcuts())));

    if (cur++ == ind)
        return (w == Key ? FindKey() : (w == Title? FindTitle() : GetStr(FindShortcuts())));

    if (cur++ == ind)
        return (w == Key ? NextKey() : (w == Title? NextTitle() : GetStr(NextShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PrevKey() : (w == Title? PrevTitle() : GetStr(PrevShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PrefsKey() : (w == Title? PrefsTitle() : GetStr(PrefsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ViewKey() : (w == Title? ViewTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? AppStylesKey() : (w == Title? AppStylesTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? StatusKey() : (w == Title? StatusTitle() : GetStr(StatusShortcuts())));

    if (cur++ == ind)
        return (w == Key ? MenuKey() : (w == Title? MenuTitle() : GetStr(MenuShortcuts())));

    if (cur++ == ind)
        return (w == Key ? TabKey() : (w == Title? TabTitle() : GetStr(TabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? NavKey() : (w == Title? NavTitle() : GetStr(NavShortcuts())));

    if (cur++ == ind)
        return (w == Key ? BooksKey() : (w == Title? BooksTitle() : GetStr(BooksShortcuts())));

//  if (cur++ == ind)
//      return (w == Key ? Key() : (w == Title? Title() : GetStr(Shortcuts())));

    if (cur++ == ind)
        return (w == Key ? StopKey() : (w == Title? StopTitle() : GetStr(StopShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ReloadKey() : (w == Title? ReloadTitle() : GetStr(ReloadShortcuts())));

    if (cur++ == ind)
        return (w == Key ? LargerKey() : (w == Title? LargerTitle() : GetStr(LargerShortcuts())));

    if (cur++ == ind)
        return (w == Key ? NormalKey() : (w == Title? NormalTitle() : GetStr(NormalShortcuts())));

    if (cur++ == ind)
        return (w == Key ? SmallerKey() : (w == Title? SmallerTitle() : GetStr(SmallerShortcuts())));

    if (cur++ == ind)
        return (w == Key ? TextOnlyKey() : (w == Title? TextOnlyTitle() : GetStr(TextOnlyShortcuts())));

    if (cur++ == ind)
        return (w == Key ? EncodeKey() : (w == Title? EncodeTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? SourceKey() : (w == Title? SourceTitle() : GetStr(SourceShortcuts())));

    if (cur++ == ind)
        return (w == Key ? FullKey() : (w == Title? FullTitle() : GetStr(FullShortcuts())));

    if (cur++ == ind)
        return (w == Key ? HistoryKey() : (w == Title? HistoryTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? BackKey() : (w == Title? BackTitle() : GetStr(BackShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ForwKey() : (w == Title? ForwTitle() : GetStr(ForwShortcuts())));

    if (cur++ == ind)
        return (w == Key ? HomeKey() : (w == Title? HomeTitle() : GetStr(HomeShortcuts())));

    if (cur++ == ind)
        return (w == Key ? LastTabKey() : (w == Title? LastTabTitle() : GetStr(LastTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? LastTabsKey() : (w == Title? LastTabsTitle() : GetStr(LastTabsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? SessionKey() : (w == Title? SessionTitle() : GetStr(SessionShortcuts())));

    if (cur++ == ind)
        return (w == Key ? AllHistKey() : (w == Title? AllHistTitle() : GetStr(AllHistShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ClearKey() : (w == Title? ClearTitle() : GetStr(ClearShortcuts())));

    if (cur++ == ind)
        return (w == Key ? BookmarksKey() : (w == Title? BookmarksTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? AllBooksKey() : (w == Title? AllBooksTitle() : GetStr(AllBooksShortcuts())));

    if (cur++ == ind)
        return (w == Key ? AddBookKey() : (w == Title? AddBookTitle() : GetStr(AddBookShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? PrivacyKey() : (w == Title? PrivacyTitle() : ""));
    
    if (cur++ == ind)
        return (w == Key ? PrivateKey() : (w == Title? PrivateTitle() : GetStr(PrivateShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? JavaScriptKey() : (w == Title? JavaScriptTitle() : GetStr(JavaScriptShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? ImagesKey() : (w == Title? ImagesTitle() : GetStr(ImagesShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? CookiesKey() : (w == Title? CookiesTitle() : GetStr(CookiesShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? PlugInsKey() : (w == Title? PlugInsTitle() : GetStr(PlugInsShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? AgentKey() : (w == Title? AgentTitle() : GetStr(AgentShortcuts())));
    
    if (cur++ == ind)
        return (w == Key ? PopUpsKey() : (w == Title? PopUpsTitle() : GetStr(PopUpsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ProxyKey() : (w == Title? ProxyTitle() : GetStr(ProxyShortcuts())));

    if (cur++ == ind)
        return (w == Key ? EmptyKey() : (w == Title? EmptyTitle() : GetStr(EmptyShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ResetKey() : (w == Title? ResetTitle() : GetStr(ResetShortcuts())));

    if (cur++ == ind)
        return (w == Key ? FullResetKey() : (w == Title? FullResetTitle() : GetStr(FullResetShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ToolsKey() : (w == Title? ToolsTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? CompatKey() : (w == Title? CompatTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? SearchKey() : (w == Title? SearchTitle() : GetStr(SearchShortcuts())));

    if (cur++ == ind)
        return (w == Key ? KeyboardKey() : (w == Title? KeyboardTitle() : GetStr(KeyboardShortcuts())));

    if (cur++ == ind)
        return (w == Key ? InspectorKey() : (w == Title? InspectorTitle() : GetStr(InspectorShortcuts())));

    if (cur++ == ind)
        return (w == Key ? InspectKey() : (w == Title? InspectTitle() : GetStr(InspectShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OptionsKey() : (w == Title? OptionsTitle() : GetStr(OptionsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? WindowKey() : (w == Title? WindowTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? NextTabKey() : (w == Title? NextTabTitle() : GetStr(NextTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? PrevTabKey() : (w == Title? PrevTabTitle() : GetStr(PrevTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? NewTabKey() : (w == Title? NewTabTitle() : GetStr(NewTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CloseTabKey() : (w == Title? CloseTabTitle() : GetStr(CloseTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CloseOtherKey() : (w == Title? CloseOtherTitle() : GetStr(CloseOtherShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CloneTabKey() : (w == Title? CloneTabTitle() : GetStr(CloneTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ReloadTabKey() : (w == Title? ReloadTabTitle() : GetStr(ReloadTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? ReloadAllKey() : (w == Title? ReloadAllTitle() : GetStr(ReloadAllShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OpenNewTabKey() : (w == Title? OpenNewTabTitle() : GetStr(OpenNewTabShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OpenAdBlockKey() : (w == Title? OpenAdBlockTitle() : GetStr(OpenAdBlockShortcuts())));

    if (cur++ == ind)
        return (w == Key ? SwapFocusKey() : (w == Title? SwapFocusTitle() : GetStr(SwapFocusShortcuts())));

    if (cur++ == ind)
        return (w == Key ? CopyAddrKey() : (w == Title? CopyAddrTitle() : ""));

    if (cur++ == ind)
        return (w == Key ? DownsKey() : (w == Title? DownsTitle() : GetStr(DownsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? TorrentsKey() : (w == Title? TorrentsTitle() : GetStr(TorrentsShortcuts())));

    if (cur++ == ind)
        return (w == Key ? HelpKey() : (w == Title? HelpTitle() : GetStr(HelpShortcuts())));

    if (cur++ == ind)
        return (w == Key ? OnlineKey() : (w == Title? OnlineTitle() : GetStr(OnlineShortcuts())));

    if (cur++ == ind)
        return (w == Key ? UpdatesKey() : (w == Title? UpdatesTitle() : GetStr(UpdatesShortcuts())));

    if (cur++ == ind)
        return (w == Key ? AboutKey() : (w == Title? AboutTitle() : GetStr(AboutShortcuts())));

    return "";
}
示例#6
0
void RenameHTML (void)
{
 char ch;

 int i;
 struct ffblk ffblk;
 int done;

 unsigned files_renamed = 0;

 done = findfirst("*.htm*",&ffblk,0);
// done = findfirst("f:\\zzz\\*.htm*",&ffblk,0);
 printf ("\n\r");

 while (!done)
 {
  Text.resize(0);
  FileName.resize(0);
  PageName.resize(0);
  DestName.resize(0);
  TitleName.resize(0);
  H1Name.resize(0);
  H2Name.resize(0);
  H3Name.resize(0);

//  FileName += "f:\\zzz\\";
  FileName += ffblk.ff_name;

  if (LoadFromFile (FileName) == -1)
  {
   done = findnext(&ffblk);
   continue;
  }

  if (Text.length() < 2) continue;

//  DestName += "f:\\zzz\\";

  FindTitle (TTB,TTE);
  TitleName  += Result;

  FindTitle (H1B,H1E);
  H1Name     += Result;

  FindTitle (H2B,H2E);
  H2Name     += Result;

  FindTitle (H3B,H3E);
  H3Name     += Result;

  if (TitleName.length() + H1Name.length() + H2Name.length() + H3Name.length() > 5)
  {

   if (TitleName.length() > 1) PageName += TitleName;
   if (H1Name.length() > 1)    PageName += '-'+H1Name;
   if (H2Name.length() > 1)    PageName += '-'+H2Name;
   if (H3Name.length() > 1)    PageName += '-'+H3Name;

/*
   printf ("\n\r------------------------------------------\n\r");
   printf ("Original File Name : %s\n\r",FileName.c_str());

   if (TitleName.length() > 1)
   {
    printf ("Title : %s\n\r\n\r",TitleName.c_str());
    PageName += TitleName;
   }

   if (H1Name.length() > 1)
   {
    printf ("Header 1 : %s\n\r",H1Name.c_str());
    printf ("to include press [ Enter ]\n\r");
    ch = getch();
    if (ch == '\xd') PageName += '-'+H1Name;
    else
    if (ch == 0) getch();
   }

   if (H2Name.length() > 1)
   {
    printf ("Header 2 : %s\n\r",H2Name.c_str());
    printf ("to include press [ Enter ]\n\r");
    ch = getch();
    if (ch == '\xd') PageName += '-'+H2Name;
    else
    if (ch == 0) getch();
   }

   if (H3Name.length() > 1)
   {
    printf ("Header 3 : %s\n\r",H3Name.c_str());
    printf ("to include press [ Enter ]\n\r");
    ch = getch();
    if (ch == '\xd') PageName += '-'+H3Name;
    else
    if (ch == 0) getch();
   }
*/
   if (PageName.length() > 240) PageName.resize(240);

   KillNotAllowed (PageName);
   DestName += PageName + ".hhttmmll";

//   printf ("New File Name      : %s\n\r",DestName.c_str());
//   printf ("----------------------------------------------\n\r");

   if (rename (FileName.c_str(),DestName.c_str()) == -1)
    printf ("Cannot rename \n\r'%s' to \n\r'%s' \n\r",FileName.c_str(),DestName.c_str());
   else
   ++files_renamed;
  }
  done = findnext(&ffblk);
 }
 printf ("\n\r[%d] file(s) renamed",files_renamed);
}