1 Index: src/dird/ua_update.c
2 ===================================================================
3 --- src/dird/ua_update.c (revision 5406)
4 +++ src/dird/ua_update.c (working copy)
9 +static void update_all_vols(UAContext *ua)
16 + memset(&pr, 0, sizeof(pr));
17 + memset(&mr, 0, sizeof(mr));
19 + if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
20 + ua->error_msg(_("Error obtaining pool ids. ERR=%s\n"), db_strerror(ua->db));
24 + for (i=0; i<num_pools; i++) {
26 + if (!db_get_pool_record(ua->jcr, ua->db, &pr)) { /* ***FIXME*** use acl? */
27 + ua->warning_msg(_("Updating all pools, but skipped PoolId=%d. ERR=%s\n"), db_strerror(ua->db));
31 + set_pool_dbr_defaults_in_media_dbr(&mr, &pr);
32 + mr.PoolId = pr.PoolId;
34 + if (!db_update_media_defaults(ua->jcr, ua->db, &mr)) {
35 + ua->error_msg(_("Error updating Volume records: ERR=%s"), db_strerror(ua->db));
37 + ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"),
45 static void update_volenabled(UAContext *ua, char *val, MEDIA_DBR *mr)
47 mr->Enabled = get_enabled(ua, val);
49 for (i=0; kw[i]; i++) {
53 if ((j=find_arg_with_value(ua, kw[i])) > 0) {
54 /* If all from pool don't select a media record */
55 if (i != AllFromPool && !select_media_dbr(ua, &mr)) {
60 + /* Allow user to simply update all volumes */
61 + if (find_arg(ua, NT_("allvolume")) > 0) {
62 + update_all_vols(ua);
67 start_prompt(ua, _("Parameters to modify:\n"));
68 add_prompt(ua, _("Volume Status")); /* 0 */
70 add_prompt(ua, _("Pool")); /* 10 */
71 add_prompt(ua, _("Volume from Pool")); /* 11 */
72 add_prompt(ua, _("All Volumes from Pool")); /* 12 */
73 - add_prompt(ua, _("Enabled")), /* 13 */
74 - add_prompt(ua, _("RecyclePool")), /* 14 */
75 - add_prompt(ua, _("Done")); /* 15 */
76 + add_prompt(ua, _("Volumes from all Pools")); /* 13 */
77 + add_prompt(ua, _("Enabled")), /* 14 */
78 + add_prompt(ua, _("RecyclePool")), /* 15 */
79 + add_prompt(ua, _("Done")); /* 16 */
80 i = do_prompt(ua, "", _("Select parameter to modify"), NULL, 0);
82 - /* For All Volumes from Pool and Done, we don't need a Volume record */
83 - if (i != 12 && i != 15) {
84 + /* For All Volumes, All Volumes from Pool, and Done, we don't need
85 + * a Volume record */
86 + if ( i != 12 && i != 13 && i != 16) {
87 if (!select_media_dbr(ua, &mr)) { /* Get Volume record */
94 + update_all_vols(ua);
98 ua->info_msg(_("Current Enabled is: %d\n"), mr.Enabled);
99 if (!get_cmd(ua, _("Enter new Enabled: "))) {
102 update_volenabled(ua, ua->cmd, &mr);
107 memset(&pr, 0, sizeof(POOL_DBR));
108 pr.PoolId = mr.RecyclePoolId;
109 if (db_get_pool_record(ua->jcr, ua->db, &pr)) {
110 Index: src/qt-console/medialist/medialist.h
111 ===================================================================
112 --- src/qt-console/medialist/medialist.h (revision 5406)
113 +++ src/qt-console/medialist/medialist.h (working copy)
116 void relabelVolume();
117 void allVolumesFromPool();
119 void volumeFromPool();
122 Index: src/qt-console/medialist/medialist.ui
123 ===================================================================
124 --- src/qt-console/medialist/medialist.ui (revision 5406)
125 +++ src/qt-console/medialist/medialist.ui (working copy)
127 <string>Update all Volumes From Pool</string>
130 + <action name="actionAllVolumes" >
131 + <property name="icon" >
132 + <iconset resource="../main.qrc" >:/images/cartridge-edit.png</iconset>
134 + <property name="text" >
135 + <string>Update all Volumes from Pool</string>
137 + <property name="iconText" >
138 + <string>Update all Volumes from Pool</string>
140 + <property name="toolTip" >
141 + <string>Update all Volumes from Pool</string>
143 + <property name="statusTip" >
144 + <string>Update all Volumes from Pool</string>
147 <action name="actionVolumeFromPool" >
148 <property name="icon" >
149 <iconset resource="../main.qrc" >:/images/cartridge-edit.png</iconset>
150 Index: src/qt-console/medialist/medialist.cpp
151 ===================================================================
152 --- src/qt-console/medialist/medialist.cpp (revision 5406)
153 +++ src/qt-console/medialist/medialist.cpp (working copy)
155 /* connect to the action specific to this pages class */
156 connect(actionRefreshMediaList, SIGNAL(triggered()), this,
157 SLOT(populateTree()));
158 + connect(actionAllVolumes, SIGNAL(triggered()), this, SLOT(allVolumes()));
159 connect(actionAllVolumesFromPool, SIGNAL(triggered()), this, SLOT(allVolumesFromPool()));
160 connect(actionVolumeFromPool, SIGNAL(triggered()), this, SLOT(volumeFromPool()));
166 +void MediaList::allVolumes()
168 + QString cmd = "update volume allvolume";
169 + consoleCommand(cmd);
174 * Called from the signal of the context sensitive menu to purge!