Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * |
| 9 | * Copyright (C) 2007 by Dominik Wenger |
Dominik Riebeling | 1dc307a | 2007-08-23 22:11:50 +0000 | [diff] [blame] | 10 | * $Id$ |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | |
| 23 | #ifndef AUTODETECTION_H_ |
| 24 | #define AUTODETECTION_H_ |
| 25 | |
Dominik Riebeling | ee09cb7 | 2008-02-10 18:25:49 +0000 | [diff] [blame] | 26 | #include <QtCore> |
Dominik Wenger | 1363881 | 2008-04-03 20:05:13 +0000 | [diff] [blame] | 27 | #include "rbsettings.h" |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 28 | |
Dominik Riebeling | 1152a12 | 2007-08-23 15:24:28 +0000 | [diff] [blame] | 29 | #include "../ipodpatcher/ipodpatcher.h" |
| 30 | #include "../sansapatcher/sansapatcher.h" |
Dominik Riebeling | 1152a12 | 2007-08-23 15:24:28 +0000 | [diff] [blame] | 31 | |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 32 | class Autodetection :public QObject |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | public: |
| 37 | Autodetection(QObject* parent=0); |
Dominik Riebeling | 3f65a70 | 2008-05-22 17:51:35 +0000 | [diff] [blame] | 38 | |
Dominik Wenger | 1363881 | 2008-04-03 20:05:13 +0000 | [diff] [blame] | 39 | void setSettings(RbSettings* sett) {settings = sett;} |
Dominik Riebeling | 3f65a70 | 2008-05-22 17:51:35 +0000 | [diff] [blame] | 40 | |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 41 | bool detect(); |
Antoine Cellerier | 1464c9b | 2007-09-15 22:57:07 +0000 | [diff] [blame] | 42 | |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 43 | QString getDevice() {return m_device;} |
| 44 | QString getMountPoint() {return m_mountpoint;} |
Dominik Riebeling | fc25266 | 2007-09-14 20:52:38 +0000 | [diff] [blame] | 45 | QString errdev(void) { return m_errdev; } |
Dominik Riebeling | 229c64b | 2008-04-05 21:48:54 +0000 | [diff] [blame] | 46 | QString incompatdev(void) { return m_incompat; } |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 47 | |
| 48 | private: |
Dominik Riebeling | 1152a12 | 2007-08-23 15:24:28 +0000 | [diff] [blame] | 49 | QStringList getMountpoints(void); |
| 50 | QString resolveMountPoint(QString); |
Dominik Riebeling | fc25266 | 2007-09-14 20:52:38 +0000 | [diff] [blame] | 51 | bool detectUsb(void); |
Dominik Riebeling | ddbb751 | 2007-09-27 08:50:47 +0000 | [diff] [blame] | 52 | bool detectAjbrec(QString); |
Antoine Cellerier | 1464c9b | 2007-09-15 22:57:07 +0000 | [diff] [blame] | 53 | |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 54 | QString m_device; |
| 55 | QString m_mountpoint; |
Dominik Riebeling | fc25266 | 2007-09-14 20:52:38 +0000 | [diff] [blame] | 56 | QString m_errdev; |
Dominik Riebeling | 229c64b | 2008-04-05 21:48:54 +0000 | [diff] [blame] | 57 | QString m_incompat; |
Dominik Riebeling | ddbb751 | 2007-09-27 08:50:47 +0000 | [diff] [blame] | 58 | QList<int> m_usbconid; |
Dominik Wenger | 1363881 | 2008-04-03 20:05:13 +0000 | [diff] [blame] | 59 | RbSettings* settings; |
Dominik Wenger | 421411b | 2007-08-05 19:48:04 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | |
| 63 | #endif /*AUTODETECTION_H_*/ |