Migrate subversion plugin to extended PathChooser

This commit is contained in:
goro
2008-12-05 18:51:07 +01:00
parent 502449e32b
commit 881610dfd2
5 changed files with 144 additions and 49 deletions

View File

@@ -54,9 +54,23 @@ class QWORKBENCH_UTILS_EXPORT PathChooser : public QWidget
Q_PROPERTY(QString path READ path WRITE setPath DESIGNABLE true)
public:
static const char * const browseButtonLabel;
explicit PathChooser(QWidget *parent = 0);
virtual ~PathChooser();
enum Kind {
Directory,
File,
Command,
// ,Any
};
// Default is <Directory>
void setExpectedKind(Kind expected);
void setPromptDialogTitle(const QString &title);
bool isValid() const;
QString errorMessage() const;
@@ -65,11 +79,15 @@ public:
// Returns the suggested label title when used in a form layout
static QString label();
static bool validatePath(const QString &path, QString *errorMessage = 0);
bool validatePath(const QString &path, QString *errorMessage = 0);
// Return the home directory, which needs some fixing under Windows.
static QString homePath();
private:
// Returns overridden title or the one from <title>
QString makeDialogTitle(const QString &title);
signals:
void validChanged();
void changed();