summaryrefslogtreecommitdiff
path: root/src/pmchart/openviewdialog.h
blob: 861fd34ef804a90e71d3fc856f29747fe571ef31 (plain)
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
66
67
68
69
70
71
72
73
/*
 * Copyright (c) 2007, Aconex.  All Rights Reserved.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */
#ifndef OPENVIEWDIALOG_H
#define OPENVIEWDIALOG_H

#include "ui_openviewdialog.h"
#include <QtGui/QDirModel>

class OpenViewDialog : public QDialog, public Ui::OpenViewDialog
{
    Q_OBJECT

public:
    OpenViewDialog(QWidget* parent);
    ~OpenViewDialog();

    void reset();
    void sourceAdd();

    static bool openView(const char *);
    static void globals(int *w, int *h, int *pts, int *x, int *y);

public slots:
    virtual void parentToolButton_clicked();
    virtual void userToolButton_clicked(bool);
    virtual void systemToolButton_clicked(bool);
    virtual void pathComboBox_currentIndexChanged(QString);
    virtual void dirListView_selectionChanged();
    virtual void dirListView_activated(const QModelIndex &);

    virtual void sourceComboBox_currentIndexChanged(int);
    virtual void sourcePushButton_clicked();
    virtual void openPushButton_clicked();

private:
    struct {
	QString	userDir;
	QString	systemDir;
	bool archiveSource;
	QDirModel *dirModel;
	QModelIndex dirIndex;
	QCompleter *completer;
    } my;

    void setPath(const QString &);
    void setPath(const QModelIndex &);
    void setPathUi(const QString &);

    void setupComboBoxes(bool);
    int setupLiveComboBoxes();
    int setupArchiveComboBoxes();

    void hostAdd();
    void archiveAdd();

    bool useLiveContext(QString);
    bool useArchiveContext(QString);
    bool useComboBoxContext(bool);
    bool openViewFiles(const QStringList &);
};

#endif	// OPENVIEWDIALOG_H