1 /* Copyright 2013-2019 MultiMC Contributors
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <QDialog>
19 #include <QModelIndex>
20 #include <memory>
21 
22 class BaseInstance;
23 class PackIgnoreProxy;
24 typedef std::shared_ptr<BaseInstance> InstancePtr;
25 
26 namespace Ui
27 {
28 class ExportInstanceDialog;
29 }
30 
31 class ExportInstanceDialog : public QDialog
32 {
33     Q_OBJECT
34 
35 public:
36     explicit ExportInstanceDialog(InstancePtr instance, QWidget *parent = 0);
37     ~ExportInstanceDialog();
38 
39     virtual void done(int result);
40 
41 private:
42     bool doExport();
43     void loadPackIgnore();
44     void savePackIgnore();
45     QString ignoreFileName();
46 
47 private:
48     Ui::ExportInstanceDialog *ui;
49     InstancePtr m_instance;
50     PackIgnoreProxy * proxyModel;
51 
52 private slots:
53     void rowsInserted(QModelIndex parent, int top, int bottom);
54 };
55