1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
Index: src/tools.cpp
===================================================================
RCS file: /cvsroot/arson/arson/src/tools.cpp,v
retrieving revision 1.1
diff -u -3 -p -r1.1 tools.cpp
--- src/tools.cpp 18 Sep 2002 23:20:56 -0000 1.1
+++ src/tools.cpp 2 Nov 2002 06:41:01 -0000
@@ -310,7 +310,8 @@ const QString ArsonCdImageFile::exts[Ars
};
ArsonCdImageFile::ArsonCdImageFile (const QString &filename)
- : m_file(filename), m_type(Unknown) { }
+ : m_file(filename), m_type(Unknown)
+{ }
int ArsonCdImageFile::imgFormat (void)
{
@@ -365,7 +366,18 @@ bool ArsonCdImageFile::write (void)
void arsonWriteImg (const char *fn)
{
- ArsonCdImageFile img (fn);
+ QString file (fn);
+
+ if (!fn)
+ {
+ ArsonFileFilter filter (ArsonCdImageFile::exts, ArsonCdImageFile::Max);
+ file = KFileDialog::getOpenFileName(QString::null, filter.toString());
+
+ if (file.isEmpty())
+ return;
+ }
+
+ ArsonCdImageFile img (file);
if (img.imgFormat() == ArsonCdImageFile::Unknown)
arsonErrorMsg(
Index: src/tools.h
===================================================================
RCS file: /cvsroot/arson/arson/src/tools.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 tools.h
--- src/tools.h 18 Sep 2002 23:20:56 -0000 1.1
+++ src/tools.h 2 Nov 2002 06:41:01 -0000
@@ -51,16 +51,17 @@ public:
Dir,
};
- ArsonCdImageFile (const QString &filename = QString::null);
+ ArsonCdImageFile (const QString &filename);
const QString &filename (void) const { return m_file; }
+ void setFilename (const char *name) { m_file = name; }
int imgFormat (void);
bool write (void);
-private:
const static QString exts[Max];
-
+
+private:
QString m_file;
int m_type;
};
|