~ubuntu-branches/ubuntu/maverick/asc/maverick

« back to all changes in this revision

Viewing changes to source/dialogs/fileselector.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Eddy Petrișor, Gonéri Le Bouder, Cyril Brulebois, Barry deFreese
  • Date: 2008-01-08 19:54:18 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080108195418-n19fc4eobhhqxcy5
Tags: 2.0.1.0-1
[ Eddy Petrișor ]
* fixed Homepage semifield

[ Gonéri Le Bouder ]
* add a watchfile
* move homepage from the description to the new Homepage field

[ Cyril Brulebois ]
* Added Vcs-Svn and Vcs-Browser fields in the control file.

[ Barry deFreese ]
* Fix make-clean lintian warning
* New upstream release
* Bump debhelper build-dep to match compat
* Add desktop file
* Update watch file for new upstream naming
* Remove nostrip check from rules
* Bump Standards Version to 3.7.3
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
     This file is part of Advanced Strategic Command; http://www.asc-hq.de
 
3
     Copyright (C) 1994-1999  Martin Bickel  and  Marc Schellenberger
 
4
 
 
5
     This program is free software; you can redistribute it and/or modify
 
6
     it under the terms of the GNU General Public License as published by
 
7
     the Free Software Foundation; either version 2 of the License, or
 
8
     (at your option) any later version.
 
9
 
 
10
     This program is distributed in the hope that it will be useful,
 
11
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
     GNU General Public License for more details.
 
14
 
 
15
     You should have received a copy of the GNU General Public License
 
16
     along with this program; see the file COPYING. If not, write to the 
 
17
     Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 
18
     Boston, MA  02111-1307  USA
 
19
*/
 
20
 
 
21
#ifndef FILESELECTOR_H
 
22
#define FILESELECTOR_H
 
23
 
 
24
#include "selectionwindow.h"
 
25
#include "../paradialog.h"
 
26
 
 
27
class FileInfo;
 
28
class FileSelectionItemFactory;
 
29
 
 
30
class FileSelectionWindow : public ASC_PG_Dialog {
 
31
      ASCString filename;
 
32
      ASCString wildcard;
 
33
      bool saveFile;
 
34
      FileSelectionItemFactory* factory;
 
35
 
 
36
   protected:
 
37
      void fileNameSelected( const ASCString& filename );
 
38
      void fileNameEntered( ASCString filename );
 
39
   public:
 
40
      FileSelectionWindow( PG_Widget *parent, const PG_Rect &r, const ASCString& fileWildcard, bool save );
 
41
      ASCString getFilename() { return filename; };
 
42
};
 
43
 
 
44
 
 
45
class FileSelectionItemFactory: public SelectionItemFactory  {
 
46
   protected:
 
47
      typedef deallocating_vector<FileInfo*> Items;
 
48
      Items::iterator it;
 
49
 
 
50
   private:      
 
51
      Items items;
 
52
      
 
53
   public:
 
54
      FileSelectionItemFactory( const ASCString& wildcard );
 
55
      
 
56
      static bool comp ( const FileInfo* i1, const FileInfo* i2 );
 
57
 
 
58
      void restart();
 
59
 
 
60
      int getLevel( const ASCString& name );
 
61
      
 
62
      SelectionWidget* spawnNextItem( PG_Widget* parent, const PG_Point& pos );
 
63
      
 
64
      SigC::Signal1<void,const ASCString& > filenameSelectedMouse;
 
65
      SigC::Signal1<void,const ASCString& > filenameSelectedKeyb;
 
66
      SigC::Signal1<void,const ASCString& > filenameMarked;
 
67
      
 
68
      void itemMarked( const SelectionWidget* widget );
 
69
      
 
70
      void itemSelected( const SelectionWidget* widget, bool mouse );
 
71
};
 
72
 
 
73
extern ASCString  selectFile( const ASCString& ext, bool load );
 
74
 
 
75
#endif
 
76