1 /**************************************************************************
2 *   Copyright (C) 2005-2020 by Oleksandr Shneyder                         *
3 *                              <o.shneyder@phoca-gmbh.de>                 *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 *   This program is distributed in the hope that it will be useful,       *
10 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12 *   GNU General Public License for more details.                          *
13 *                                                                         *
14 *   You should have received a copy of the GNU General Public License     *
15 *   along with this program.  If not, see <https://www.gnu.org/licenses/>. *
16 ***************************************************************************/
17 
18 #ifndef CUPSPRINTERSETTINGSDIALOG_H
19 #define CUPSPRINTERSETTINGSDIALOG_H
20 #include "x2goclientconfig.h"
21 #ifndef Q_OS_WIN
22 #include <QDialog>
23 #include "ui_cupsprintsettingsdialog.h"
24 
25 /**
26 	@author Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
27 */
28 class CUPSPrint;
29 class CUPSPrinterSettingsDialog : public QDialog
30 {
31 		Q_OBJECT
32 	public:
33 		enum tabs{GENERAL,PPD};
34 		CUPSPrinterSettingsDialog ( QString prnName,
35 		                            CUPSPrint*  cupsObject,
36 		                            QWidget * parent=0l,
37 		                            Qt::WindowFlags flags =0 );
38 		~CUPSPrinterSettingsDialog();
39 	private:
40 		CUPSPrint* m_cups;
41 		Ui::CupsPrinterSettingsDialog ui;
42 		QString printer;
43 	private:
44 		void setCbBox ( QComboBox* cb, QString optionKeyword );
45 		void setPPDTab();
46 		bool setNewValue ( const QString& option,
47 		                   const QString& value );
48 		void changeFromCbBox ( const QString& opt, int id );
49 		void changeGeneralOption ( const QString&  option,
50 		                           const QString& val );
51 	private slots:
52 		void slot_optionSelected ( QTreeWidgetItem * current,
53 					   QTreeWidgetItem * previous );
54 		void slot_valueSelected ( QTreeWidgetItem * current,
55 					  QTreeWidgetItem * previous );
56 		void slot_reloadValues();
57 		void slot_changePSize ( int ind );
58 		void slot_changePType ( int ind );
59 		void slot_changeISlot ( int ind );
60 		void slot_changeDuplex();
61 		void setGeneralTab();
62 		void slot_restoreDefaults();
63 		void slot_saveOptions();
64 		void slot_ok();
65 
66 };
67 
68 #endif
69 #endif
70