50 |
50 |
51 public: |
51 public: |
52 SelWeaponWidget(int numItems, QWidget* parent=0); |
52 SelWeaponWidget(int numItems, QWidget* parent=0); |
53 QString getWeaponsString(const QString& name) const; |
53 QString getWeaponsString(const QString& name) const; |
54 QStringList getWeaponNames() const; |
54 QStringList getWeaponNames() const; |
|
55 void deletionDone(); |
55 |
56 |
56 public slots: |
57 public slots: |
57 void setDefault(); |
58 void setDefault(); |
58 void setWeapons(const QString& ammo); |
59 void setWeapons(const QString& ammo); |
59 //sets the name of the current set |
60 //sets the name of the current set |
60 void setWeaponsName(const QString& name); |
61 void setWeaponsName(const QString& name); |
|
62 void switchWeapons(const QString& name); |
61 void deleteWeaponsName(); |
63 void deleteWeaponsName(); |
62 void newWeaponsName(); |
64 void newWeaponsName(); |
63 void save(); |
65 void save(); |
64 void copy(); |
66 void copy(); |
65 |
67 |
66 signals: |
68 signals: |
67 void weaponsChanged(); |
69 void weaponsDeleted(QString weaponsName); |
68 void weaponsDeleted(); |
70 void weaponsAdded(QString weaponsName, QString ammo); |
|
71 void weaponsEdited(QString oldWeaponsName, QString newWeaponsName, QString ammo); |
69 |
72 |
70 private: |
73 private: |
71 //the name of the current weapon set |
74 //the name of the current weapon set |
72 QString curWeaponsName; |
75 QString curWeaponsName; |
|
76 //set to true while an entry is deleted. Used to avoid duplicate saving due to combobox change |
|
77 bool isDeleting = false; |
73 |
78 |
74 QLineEdit* m_name; |
79 QLineEdit* m_name; |
75 |
80 |
76 //storage for all the weapons sets |
81 //storage for all the weapons sets |
77 QSettings* wconf; |
82 QSettings* wconf; |