File indexing completed on 2024-04-21 04:35:57

0001 /***************************************************************************
0002 *   Copyright 2007 Niko Sams <niko.sams@gmail.com>                        *
0003 *                                                                         *
0004 *   This program is free software; you can redistribute it and/or modify  *
0005 *   it under the terms of the GNU General Public License as published by  *
0006 *   the Free Software Foundation; either version 2 of the License, or     *
0007 *   (at your option) any later version.                                   *
0008 *                                                                         *
0009 ***************************************************************************/
0010 
0011 #ifndef PROFILESFILETREE_H
0012 #define PROFILESFILETREE_H
0013 
0014 #include <QWidget>
0015 #include <kfileitem.h>
0016 
0017 class QMenu;
0018 class QModelIndex;
0019 class QComboBox;
0020 class QLabel;
0021 class QUrl;
0022 
0023 class KDirOperator;
0024 class KFileItem;
0025 
0026 class UploadPlugin;
0027 class AllProfilesModel;
0028 class UploadProfileDlg;
0029 
0030 /**
0031  * The Profiles-File-Tree Dock
0032  *
0033  * A ComboBox to select the profile and a KFileTreeView below.
0034  */
0035 class ProfilesFileTree : public QWidget
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040     ProfilesFileTree( UploadPlugin* plugin, QWidget *parent = nullptr );
0041 
0042     /**
0043      * Sets the Model for this widget
0044      */
0045     void setModel(AllProfilesModel* model);
0046 
0047 private Q_SLOTS:
0048     /**
0049      * Open the Url in the editor
0050      */
0051     void openUrl(const QUrl& url);
0052 
0053     /**
0054      * Slot called when current profile has changed, sets the new root-url for
0055      * the tree
0056      */
0057     void profileIndexChanged(int index);
0058 
0059     /**
0060      * Slot called when data of the profile has changed, sets the new root url
0061      * (if changed)
0062      */
0063     void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
0064 
0065     /**
0066      * Modify the current profile
0067      */
0068     void modifyProfile();
0069 
0070     void fileSelected(const KFileItem& item);
0071     void urlEntered();
0072     void contextMenuAboutToShow(KFileItem,QMenu*);
0073     void copyUrl();
0074     void browseUrl();
0075 
0076 private:
0077     UploadPlugin* m_plugin;
0078     AllProfilesModel* m_profilesModel;
0079 
0080     QComboBox* m_profilesCombo;
0081     QLabel* m_pleaseSelectLabel;
0082     KDirOperator* m_tree;
0083     UploadProfileDlg* m_editProfileDlg;
0084 };
0085 
0086 
0087 #endif
0088 // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on