Ejemplo n.º 1
0
void UpdateDlg::UninstallFile()
{
    UpdateStatus(_("Please wait..."));
    UpdateRec* rec = GetRecFromListView();
    if (!rec)
    {
        wxMessageBox(_("No file selected!"), _("Error"), wxICON_ERROR);
        UpdateStatus(_("Ready"), 0, 0);
        return;
    }
    wxYield();

    DevPakInstaller inst;
    if (inst.Uninstall(GetPackagePath() + rec->entry))
    {
        wxMessageBox(_("DevPak uninstalled"), _("Message"), wxICON_INFORMATION);

        // refresh installed_version
        rec->installed_version.Clear();
        rec->installed = false;
        SetListColumnText(-1, 2, rec->installed_version);
    }
    else
    {
        wxMessageBox(_("DevPak was not uninstalled.\nStatus:\n") + inst.GetStatus(), _("Error"), wxICON_ERROR);
    }
}
Ejemplo n.º 2
0
void UpdateDlg::InstallFile()
{
    UpdateStatus(_("Please wait..."));
    UpdateRec* rec = GetRecFromListView();
    if (!rec)
    {
        wxMessageBox(_("No file selected!"), _("Error"), wxICON_ERROR);
        UpdateStatus(_("Ready"), 0, 0);
        return;
    }
    wxYield();

    if (rec->title == _T("WebUpdate Mirrors list"))
    {
        InstallMirrors(GetPackagePath() + rec->local_file);
        rec->installed = true;
        ApplyFilter();
        UpdateStatus(_("Ready"), 0, 0);
        return;
    }
    else if (!rec->installable)
    {
        UpdateStatus(_("Ready"), 0, 0);
        return;
    }

    if (!CreateDirRecursively(GetPackagePath()))
    {
        UpdateStatus(_("Ready"), 0, 0);
        wxMessageBox(_("Can't create directory ") + GetPackagePath(), _("Error"), wxICON_ERROR);
        return;
    }

    wxArrayString files;
    DevPakInstaller inst;
    if (inst.Install(rec->name, GetPackagePath() + rec->local_file, GetBasePath(), &files))
    {
//        wxFileName fname(GetPackagePath() + rec->local_file);
//        fname.SetExt("entry");
//        fname.SetName(rec->title);
//        CreateEntryFile(rec, fname.GetFullPath(), files);
        CreateEntryFile(rec, GetPackagePath() + rec->entry, files);
        wxMessageBox(_("DevPak installed"), _("Message"), wxICON_INFORMATION);

        // refresh installed_version
        rec->installed = true;
        rec->installed_version = rec->version;
        SetListColumnText(-1, 2, rec->installed_version);
    }
    else
    {
        wxMessageBox(_("DevPak was not installed.\nStatus:\n") + inst.GetStatus(), _("Error"), wxICON_ERROR);
    }
    UpdateStatus(_("Ready"), 0, 0);
}
Ejemplo n.º 3
0
static void ApplySearchDatesLanguage(HWND hwnd){
	wchar_t			szBuffer[256];
	LVCOLUMNW		lvc = {0};

	GetPrivateProfileStringW(S_OPTIONS, L"1045", L"Search by dates", szBuffer, 256, g_NotePaths.CurrLanguagePath);
	SetWindowTextW(hwnd, szBuffer);
	SetDlgCtlText(hwnd, IDC_ST_RESULTS, g_NotePaths.CurrLanguagePath, L"Search results");
	SetDlgCtlText(hwnd, IDC_CMD_FIND, g_NotePaths.CurrLanguagePath, L"Find");
	SetDlgCtlText(hwnd, IDCANCEL, g_NotePaths.CurrLanguagePath, L"Cancel");
	SetDlgCtlText(hwnd, IDC_ST_SEARCH_FROM, g_NotePaths.CurrLanguagePath, L"From");
	SetDlgCtlText(hwnd, IDC_ST_SEARCH_TO, g_NotePaths.CurrLanguagePath, L"To");

	lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;
	lvc.cchTextMax = 256;
	lvc.pszText = szBuffer;
	SetListColumnText(hwnd, IDC_LST_RESULTS, 0, L"0", m_cols[0], g_NotePaths.CurrLanguagePath);
	SetListColumnText(hwnd, IDC_LST_RESULTS, 1, L"19", m_cols[1], g_NotePaths.CurrLanguagePath);
	SetListColumnText(hwnd, IDC_LST_RESULTS, 2, L"2", m_cols[2], g_NotePaths.CurrLanguagePath);
	SetListColumnText(hwnd, IDC_LST_RESULTS, 3, L"16", m_cols[3], g_NotePaths.CurrLanguagePath);
	SetListColumnText(hwnd, IDC_LST_RESULTS, 4, L"18", m_cols[4], g_NotePaths.CurrLanguagePath);
	SetListColumnText(hwnd, IDC_LST_RESULTS, 5, L"13", m_cols[5], g_NotePaths.CurrLanguagePath);
	ApplySearchDatesChecksLanguage(GetDlgItem(hwnd, IDC_TVW_SEARCH_DATES), g_NotePaths.CurrLanguagePath);
}