Changeset 6303 for trunk/qt4-gui/src/dialogs
- Timestamp:
- 06/14/08 12:18:55 (5 months ago)
- Location:
- trunk/qt4-gui/src/dialogs
- Files:
-
- 2 modified
-
editgrpdlg.cpp (modified) (9 diffs)
-
editgrpdlg.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/dialogs/editgrpdlg.cpp
r6296 r6303 25 25 #include <QGridLayout> 26 26 #include <QGroupBox> 27 #include <QHBoxLayout>28 27 #include <QLabel> 29 28 #include <QLineEdit> … … 36 35 37 36 #include "core/licqgui.h" 38 #include "core/mainwin.h"39 37 #include "core/messagebox.h" 40 38 #include "core/signalmanager.h" … … 42 40 #include "helpers/licqstrings.h" 43 41 #include "helpers/support.h" 44 45 #include "widgets/infofield.h"46 42 47 43 using namespace LicqQtGui; … … 60 56 QGridLayout* glay = new QGridLayout(grpGroups); 61 57 lstGroups = new QListWidget(grpGroups); 62 glay->addWidget(lstGroups, 0, 0 , 1, 2);58 glay->addWidget(lstGroups, 0, 0); 63 59 64 60 QVBoxLayout* vlay = new QVBoxLayout(); … … 73 69 BUTTON(btnDown, tr("Shift Down"), slot_down); 74 70 BUTTON(btnEdit, tr("Edit Name"), slot_edit); 75 BUTTON(btnNewUser, tr("Set New Users"), slot_newuser);76 71 #undef BUTTON 77 72 78 73 btnEdit->setToolTip(tr("Edit group name (hit enter to save).")); 79 btnNewUser->setToolTip( 80 tr("The group to which new users will be automatically added.\n" 81 "All new users will be in the local system group New Users,\n" 82 "but for server side storage will also be stored in the specified group.")); 83 84 glay->addLayout(vlay, 0, 2); 85 86 glay->addWidget(new QLabel(tr("New User:"), grpGroups), 1, 0); 87 nfoNewUser = new InfoField(true); 88 nfoNewUser->setToolTip(btnNewUser->toolTip()); 89 glay->addWidget(nfoNewUser, 1, 1, 1, 2); 74 75 glay->addLayout(vlay, 0, 1); 90 76 91 77 edtName = new QLineEdit(grpGroups); 92 78 edtName->setEnabled(false); 93 79 connect(edtName, SIGNAL(returnPressed()), SLOT(slot_editok())); 94 glay->addWidget(edtName, 2, 0, 1, 2);80 glay->addWidget(edtName, 1, 0); 95 81 96 82 btnSave = new QPushButton(tr("&Save")); … … 98 84 btnSave->setToolTip(tr("Save the name of a group being modified.")); 99 85 connect(btnSave, SIGNAL(clicked()), SLOT(slot_editok())); 100 glay->addWidget(btnSave, 2, 2);86 glay->addWidget(btnSave, 1, 1); 101 87 102 88 QDialogButtonBox* buttons = new QDialogButtonBox(); … … 137 123 lstGroups->clear(); 138 124 139 const QString allUsers = LicqStrings::getSystemGroupName(GROUP_ALL_USERS);140 QListWidgetItem* item = new QListWidgetItem(allUsers, lstGroups);141 item->setData(Qt::UserRole, 0);142 143 if (gUserManager.NewUserGroup() == GROUP_ALL_USERS)144 nfoNewUser->setText(allUsers);145 146 125 FOR_EACH_GROUP_START_SORTED(LOCK_R) 147 126 { 148 127 QString name = QString::fromLocal8Bit(pGroup->name().c_str()); 149 item = new QListWidgetItem(name, lstGroups);128 QListWidgetItem* item = new QListWidgetItem(name, lstGroups); 150 129 item->setData(Qt::UserRole, pGroup->id()); 151 152 if (gUserManager.NewUserGroup() == pGroup->id())153 nfoNewUser->setText(name);154 130 } 155 131 FOR_EACH_GROUP_END … … 187 163 edtName->setText(tr("noname")); 188 164 edtName->setFocus(); 165 edtName->selectAll(); 189 166 btnEdit->setText(tr("Cancel")); 190 167 disconnect(btnEdit, SIGNAL(clicked()), this, SLOT(slot_edit())); … … 237 214 { 238 215 moveGroup(1); 239 }240 241 void EditGrpDlg::slot_newuser()242 {243 gUserManager.SetNewUserGroup(currentGroupId());244 RefreshList();245 216 } 246 217 -
trunk/qt4-gui/src/dialogs/editgrpdlg.h
r6296 r6303 32 32 namespace LicqQtGui 33 33 { 34 class InfoField;35 36 34 class EditGrpDlg : public QDialog 37 35 { … … 71 69 QPushButton* btnDone; 72 70 QPushButton* btnEdit; 73 QPushButton* btnNewUser;74 71 QPushButton* btnSave; 75 72 76 73 QLineEdit* edtName; 77 InfoField* nfoNewUser;78 74 79 75 unsigned short myEditGroupId; … … 90 86 void slot_editok(); 91 87 void slot_editcancel(); 92 void slot_newuser();93 88 }; 94 89
