1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 20:52:56 +03:00

Cleaned up BrowseDialog class: removed unused methods and fields, restricted access where possible.

This commit is contained in:
Maarten ter Huurne 2010-06-19 04:08:55 +02:00
parent 3efa602af0
commit ad22a909a3
2 changed files with 10 additions and 20 deletions

View File

@ -215,8 +215,6 @@ void BrowseDialog::paint()
offsetY = gmenu2x->skinConfInt["topBarHeight"]+1; offsetY = gmenu2x->skinConfInt["topBarHeight"]+1;
beforeFileList();
//Files & Directories //Files & Directories
gmenu2x->s->setClipRect(clipRect); gmenu2x->s->setClipRect(clipRect);
for (i = firstElement; i < lastElement; i++) { for (i = firstElement; i < lastElement; i++) {

View File

@ -34,6 +34,16 @@ using std::vector;
class BrowseDialog : protected Dialog { class BrowseDialog : protected Dialog {
protected: protected:
BrowseDialog(GMenu2X *gmenu2x, const string &title, const string &subtitle);
void setPath(const string &path) {
fl->setPath(path);
}
FileLister *fl;
unsigned int selected;
private:
enum Action { enum Action {
ACT_NONE, ACT_NONE,
ACT_SELECT, ACT_SELECT,
@ -46,28 +56,11 @@ protected:
ACT_CONFIRM, ACT_CONFIRM,
}; };
BrowseDialog(GMenu2X *gmenu2x, const string &title, const string &subtitle);
virtual void beforeFileList() {};
virtual void onChangeDir() {};
void setPath(const string &path) {
fl->setPath(path);
onChangeDir();
}
FileLister *fl;
unsigned int selected;
private:
int selRow;
bool close, result; bool close, result;
string title; string title;
string subtitle; string subtitle;
IconButton *btnUp, *btnEnter, *btnConfirm;
SDL_Rect clipRect; SDL_Rect clipRect;
SDL_Rect touchRect; SDL_Rect touchRect;
@ -92,7 +85,6 @@ private:
void confirm(); void confirm();
public: public:
bool exec(); bool exec();
const std::string &getPath() const std::string &getPath()