summaryrefslogtreecommitdiff
path: root/src/pmchart/saveviewdialog.h
blob: 8ad81a218f64c46ad73583f2b75d2bbd83657895 (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
/*
 * Copyright (c) 2014 Red Hat.
 * 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 SAVEVIEWDIALOG_H
#define SAVEVIEWDIALOG_H

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

class Chart;

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

public:
    SaveViewDialog(QWidget* parent);
    ~SaveViewDialog();
    void reset(bool);

    static void saveChart(FILE *, Chart *, bool);
    static bool saveView(QString, bool, bool, bool, bool);
    static void setGlobals(int w, int h, int pts, int x, int y);

public slots:
    virtual void parentToolButton_clicked();
    virtual void userToolButton_clicked(bool);
    virtual void pathComboBox_currentIndexChanged(QString);

    virtual void dirListView_selectionChanged();
    virtual void dirListView_activated(const QModelIndex &);

    virtual void preserveHostCheckBox_toggled(bool);
    virtual void preserveSizeCheckBox_toggled(bool);
    virtual void savePushButton_clicked();

private:
    struct {
	QString userDir;
	bool hostDynamic;	// on-the-fly or explicit-hostnames-in-view
	bool sizeDynamic;	// on-the-fly or explicit-geometry-in-view
	QDirModel *dirModel;
	QModelIndex dirIndex;
	QCompleter *completer;
    } my;

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

    bool saveViewFile(const QString &);
};

#endif	// SAVEVIEWDIALOG_H