40 int iVerticalIndent = 2;
41 SetBounds(
C4Rect(0, 0, iWidth, iIconSize+2*iVerticalIndent));
45 pLabel =
new C4GUI::Label(szFilename, iIconSize + IconLabelSpacing,iVerticalIndent,
ALeft);
48 AddElement(pFileIcon); AddElement(pLabel);
57 void C4Network2ResDlg::ListItem::Update(
const C4Network2Res *pByRes)
64 progress.
Format(
"%d%%", iProgress);
66 pProgress->SetText(progress.
getData());
70 pProgress->SetToolTip(
LoadResStr(
"IDS_NET_RESPROGRESS_DESC"));
71 AddElement(pProgress);
74 else if (pProgress) {
delete pProgress; pProgress=
nullptr; }
88 void C4Network2ResDlg::ListItem::OnButtonSave(
C4GUI::Control *pButton)
90 LocalSaveResource(
false);
93 void C4Network2ResDlg::ListItem::OnButtonSaveConfirm(
C4GUI::Element *pNull)
95 LocalSaveResource(
true);
98 void C4Network2ResDlg::ListItem::LocalSaveResource(
bool fDoOverwrite)
103 const char *szResFile = pRes->
getFile();
126 GetScreen()->ShowMessage(strErrCopyFile.getData(), strErrCopyFile.getData(),
C4GUI::Ico_Error);
140 bool C4Network2ResDlg::ListItem::IsSavePossible()
143 bool fCanSave =
false;
145 if (!pRes)
return false;
193 while (pItem && (pItem->GetResID() < iResID))
195 pNext =
static_cast<ListItem *
>(pItem->GetNext());
196 delete pItem; pItem =
pNext;
199 if (pItem && pItem->GetResID() == iResID)
202 pItem =
static_cast<ListItem *
>(pItem->GetNext());
211 pNext =
static_cast<ListItem *
>(pItem->GetNext());
212 delete pItem; pItem =
pNext;
C4Application Application
C4GraphicsResource GraphicsResource
bool C4Group_CopyItem(const char *source, const char *target, bool no_sorting, bool reset_attributes)
const char * LoadResStr(const char *id)
StdStrBuf FormatString(const char *szFmt,...)
char * GetFilename(char *szPath)
bool ItemExists(const char *szItemName)
const char * AtUserDataPath(const char *filename)
bool InsertElement(Element *pChild, Element *pInsertBefore, int32_t iIndent=0)
bool AddElement(Element *pChild, int32_t iIndent=0)
ScrollWindow * pClientWindow
C4Network2ResList ResList
const char * getFileName() const
C4Network2ResDlg(const C4Rect &rcBounds, bool fActive)
const char * getFile() const
const C4Network2ResCore & getCore() const
int32_t getPresentPercent() const
C4Network2ResType getType() const
C4Network2Res::Ref getRefRes(int32_t iResID)
C4Network2Res::Ref getRefNextRes(int32_t iResID)
int GetLineHeight() const
void Remove(StdSchedulerProc *pProc)
void Add(StdSchedulerProc *pProc)
const char * getData() const
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O