File indexing completed on 2024-05-19 04:48:46

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Rick W. Chen <stuffcorpse@archlinux.us>                           *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef AMAROK_SCRIPTSCONFIG_H
0018 #define AMAROK_SCRIPTSCONFIG_H
0019 
0020 #include "configdialog/ConfigDialogBase.h"
0021 
0022 #include <QStringList>
0023 
0024 
0025 class KArchiveDirectory;
0026 class KArchiveFile;
0027 class ScriptSelector;
0028 class QPushButton;
0029 class QVBoxLayout;
0030 
0031 /**
0032   * A widget that allows configuration of scripts
0033   */
0034 class ScriptsConfig : public ConfigDialogBase
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     explicit ScriptsConfig( Amarok2ConfigDialog *parent );
0040     ~ScriptsConfig() override;
0041 
0042     void updateSettings() override;
0043     bool hasChanged() override;
0044     bool isDefault() override;
0045 
0046 public Q_SLOTS:
0047     void slotConfigChanged( bool changed );
0048 
0049 private Q_SLOTS:
0050     void slotManageScripts();
0051     void installLocalScript();
0052     void slotReloadScriptSelector();
0053     void slotUpdateScripts();
0054     void slotUninstallScript();
0055     void restoreScrollBar();
0056 
0057 private:
0058     const KArchiveFile *findSpecFile( const KArchiveDirectory *dir ) const;
0059 
0060     bool m_configChanged;
0061     ScriptSelector *m_selector;
0062     QTimer *m_timer;
0063     QVBoxLayout *m_verticalLayout;
0064     QPushButton *m_uninstallButton;
0065     QObject *m_parent;
0066     ScriptSelector *m_oldSelector;
0067 };
0068 
0069 #endif // AMAROK_SCRIPTSCONFIG_H