]> git.sur5r.net Git - bacula/bacula/commitdiff
First cut label dialog
authorKern Sibbald <kern@sibbald.com>
Sat, 3 May 2003 10:39:34 +0000 (10:39 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 3 May 2003 10:39:34 +0000 (10:39 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@482 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/console.glade
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_label.c
bacula/src/dird/ua_select.c
bacula/src/version.h

index 9b3ed3aa0ffca8654fa0093d1b38cb8960a1cd9d..71a9eab4dc58a3a94a1bf2a5dbd863fdd013c058 100644 (file)
          <label>Restore</label>
          <stock_pixmap>GNOME_STOCK_PIXMAP_REVERT</stock_pixmap>
        </widget>
+
+       <widget>
+         <class>GtkButton</class>
+         <child_name>Toolbar:button</child_name>
+         <name>label_button</name>
+         <signal>
+           <name>clicked</name>
+           <handler>on_label_button_clicked</handler>
+           <last_modification_time>Sat, 03 May 2003 08:57:51 GMT</last_modification_time>
+         </signal>
+         <label>Label</label>
+         <stock_pixmap>GNOME_STOCK_PIXMAP_SAVE_AS</stock_pixmap>
+       </widget>
       </widget>
     </widget>
 
   </widget>
 </widget>
 
+<widget>
+  <class>GtkDialog</class>
+  <name>label_dialog</name>
+  <title>Label a Volume</title>
+  <type>GTK_WINDOW_TOPLEVEL</type>
+  <position>GTK_WIN_POS_CENTER</position>
+  <modal>True</modal>
+  <allow_shrink>False</allow_shrink>
+  <allow_grow>False</allow_grow>
+  <auto_shrink>True</auto_shrink>
+
+  <widget>
+    <class>GtkVBox</class>
+    <child_name>Dialog:vbox</child_name>
+    <name>dialog-vbox9</name>
+    <homogeneous>False</homogeneous>
+    <spacing>0</spacing>
+
+    <widget>
+      <class>GtkHBox</class>
+      <child_name>Dialog:action_area</child_name>
+      <name>dialog-action_area8</name>
+      <border_width>10</border_width>
+      <homogeneous>True</homogeneous>
+      <spacing>5</spacing>
+      <child>
+       <padding>0</padding>
+       <expand>False</expand>
+       <fill>True</fill>
+       <pack>GTK_PACK_END</pack>
+      </child>
+
+      <widget>
+       <class>GtkHButtonBox</class>
+       <name>hbuttonbox3</name>
+       <layout_style>GTK_BUTTONBOX_END</layout_style>
+       <spacing>8</spacing>
+       <child_min_width>85</child_min_width>
+       <child_min_height>27</child_min_height>
+       <child_ipad_x>7</child_ipad_x>
+       <child_ipad_y>0</child_ipad_y>
+       <child>
+         <padding>0</padding>
+         <expand>True</expand>
+         <fill>True</fill>
+       </child>
+
+       <widget>
+         <class>GtkButton</class>
+         <name>label_ok</name>
+         <can_default>True</can_default>
+         <can_focus>True</can_focus>
+         <signal>
+           <name>clicked</name>
+           <handler>on_label_ok_clicked</handler>
+           <last_modification_time>Sat, 03 May 2003 09:58:59 GMT</last_modification_time>
+         </signal>
+         <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+         <relief>GTK_RELIEF_NORMAL</relief>
+       </widget>
+
+       <widget>
+         <class>GtkButton</class>
+         <name>label_cancel</name>
+         <can_default>True</can_default>
+         <can_focus>True</can_focus>
+         <signal>
+           <name>clicked</name>
+           <handler>on_label_cancel_clicked</handler>
+           <last_modification_time>Sat, 03 May 2003 10:00:11 GMT</last_modification_time>
+         </signal>
+         <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+         <relief>GTK_RELIEF_NORMAL</relief>
+       </widget>
+      </widget>
+    </widget>
+
+    <widget>
+      <class>GtkVBox</class>
+      <name>vbox16</name>
+      <homogeneous>False</homogeneous>
+      <spacing>0</spacing>
+      <child>
+       <padding>0</padding>
+       <expand>False</expand>
+       <fill>True</fill>
+      </child>
+
+      <widget>
+       <class>GtkLabel</class>
+       <name>label106</name>
+       <label>Label a Volume</label>
+       <justify>GTK_JUSTIFY_CENTER</justify>
+       <wrap>False</wrap>
+       <xalign>0.5</xalign>
+       <yalign>0.5</yalign>
+       <xpad>0</xpad>
+       <ypad>9</ypad>
+       <child>
+         <padding>0</padding>
+         <expand>False</expand>
+         <fill>False</fill>
+       </child>
+      </widget>
+
+      <widget>
+       <class>GtkHBox</class>
+       <name>hbox45</name>
+       <border_width>5</border_width>
+       <homogeneous>False</homogeneous>
+       <spacing>0</spacing>
+       <child>
+         <padding>0</padding>
+         <expand>False</expand>
+         <fill>True</fill>
+       </child>
+
+       <widget>
+         <class>GtkLabel</class>
+         <name>label107</name>
+         <width>70</width>
+         <label>Storage:</label>
+         <justify>GTK_JUSTIFY_CENTER</justify>
+         <wrap>False</wrap>
+         <xalign>0.15</xalign>
+         <yalign>0.5</yalign>
+         <xpad>0</xpad>
+         <ypad>0</ypad>
+         <child>
+           <padding>0</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+       </widget>
+
+       <widget>
+         <class>GtkCombo</class>
+         <name>label_combo_storage</name>
+         <value_in_list>True</value_in_list>
+         <ok_if_empty>False</ok_if_empty>
+         <case_sensitive>False</case_sensitive>
+         <use_arrows>True</use_arrows>
+         <use_arrows_always>False</use_arrows_always>
+         <items>
+</items>
+         <child>
+           <padding>15</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+
+         <widget>
+           <class>GtkEntry</class>
+           <child_name>GtkCombo:entry</child_name>
+           <name>entry26</name>
+           <can_focus>True</can_focus>
+           <editable>False</editable>
+           <text_visible>True</text_visible>
+           <text_max_length>0</text_max_length>
+           <text></text>
+         </widget>
+       </widget>
+
+       <widget>
+         <class>Placeholder</class>
+       </widget>
+      </widget>
+
+      <widget>
+       <class>GtkHBox</class>
+       <name>hbox46</name>
+       <border_width>5</border_width>
+       <homogeneous>False</homogeneous>
+       <spacing>0</spacing>
+       <child>
+         <padding>0</padding>
+         <expand>False</expand>
+         <fill>True</fill>
+       </child>
+
+       <widget>
+         <class>GtkLabel</class>
+         <name>label109</name>
+         <width>70</width>
+         <label>Pool:</label>
+         <justify>GTK_JUSTIFY_LEFT</justify>
+         <wrap>False</wrap>
+         <xalign>0.12</xalign>
+         <yalign>0.5</yalign>
+         <xpad>0</xpad>
+         <ypad>0</ypad>
+         <child>
+           <padding>0</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+       </widget>
+
+       <widget>
+         <class>GtkCombo</class>
+         <name>label_combo_pool</name>
+         <value_in_list>True</value_in_list>
+         <ok_if_empty>False</ok_if_empty>
+         <case_sensitive>False</case_sensitive>
+         <use_arrows>True</use_arrows>
+         <use_arrows_always>False</use_arrows_always>
+         <items>
+</items>
+         <child>
+           <padding>14</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+
+         <widget>
+           <class>GtkEntry</class>
+           <child_name>GtkCombo:entry</child_name>
+           <name>entry27</name>
+           <can_focus>True</can_focus>
+           <editable>False</editable>
+           <text_visible>True</text_visible>
+           <text_max_length>0</text_max_length>
+           <text></text>
+         </widget>
+       </widget>
+
+       <widget>
+         <class>Placeholder</class>
+       </widget>
+      </widget>
+
+      <widget>
+       <class>GtkHBox</class>
+       <name>hbox47</name>
+       <border_width>5</border_width>
+       <homogeneous>False</homogeneous>
+       <spacing>0</spacing>
+       <child>
+         <padding>0</padding>
+         <expand>False</expand>
+         <fill>True</fill>
+       </child>
+
+       <widget>
+         <class>GtkLabel</class>
+         <name>label111</name>
+         <width>70</width>
+         <label>Volume Name:</label>
+         <justify>GTK_JUSTIFY_LEFT</justify>
+         <wrap>False</wrap>
+         <xalign>0.18</xalign>
+         <yalign>0.5</yalign>
+         <xpad>0</xpad>
+         <ypad>0</ypad>
+         <child>
+           <padding>0</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+       </widget>
+
+       <widget>
+         <class>GtkEntry</class>
+         <name>label_entry_volume</name>
+         <can_focus>True</can_focus>
+         <editable>True</editable>
+         <text_visible>True</text_visible>
+         <text_max_length>0</text_max_length>
+         <text></text>
+         <child>
+           <padding>0</padding>
+           <expand>True</expand>
+           <fill>True</fill>
+         </child>
+       </widget>
+
+       <widget>
+         <class>Placeholder</class>
+       </widget>
+      </widget>
+
+      <widget>
+       <class>GtkLabel</class>
+       <name>label113</name>
+       <label>   </label>
+       <justify>GTK_JUSTIFY_CENTER</justify>
+       <wrap>False</wrap>
+       <xalign>0.5</xalign>
+       <yalign>0.5</yalign>
+       <xpad>0</xpad>
+       <ypad>0</ypad>
+       <child>
+         <padding>0</padding>
+         <expand>False</expand>
+         <fill>False</fill>
+       </child>
+      </widget>
+    </widget>
+  </widget>
+</widget>
+
 </GTK-Interface>
index 2e5128acfaa7dc798c1e0d3d6fae940200310176..3381a6063e35ca77dc10142feeba5b9487baef35 100644 (file)
@@ -241,11 +241,11 @@ static int addcmd(UAContext *ua, char *cmd)
    }
 getVolName:
    if (num == 0) {
-      if (!get_cmd(ua, _("Enter Volume name: "))) {
+      if (!get_cmd(ua, _("Enter Volume name: ")) || ua->cmd[0] == '.') {
         return 1;
       }
    } else {
-      if (!get_cmd(ua, _("Enter base volume name: "))) {
+      if (!get_cmd(ua, _("Enter base volume name: ")) || ua->cmd[0] == '.') {
         return 1;
       }
    }
@@ -284,7 +284,7 @@ getVolName:
    }
 
    if (store && store->autochanger) {
-      if (!get_cmd(ua, _("Enter slot (0 for none): "))) {
+      if (!get_cmd(ua, _("Enter slot (0 for none): ")) || ua->cmd[0] == '.') {
         return 1;
       }
       slot = atoi(ua->cmd);
index 7c1b1ac31474158008e4385853c0c539444916f3..554dc7cc33bd6c7ed4adf0c8bc4153ef7be6f038 100644 (file)
@@ -205,7 +205,7 @@ checkVol:
 
    /* Get a new Volume name */
    for ( ;; ) {
-      if (!get_cmd(ua, _("Enter new Volume name: "))) {
+      if (!get_cmd(ua, _("Enter new Volume name: ")) || ua->cmd[0] == '.') {
         return 1;
       }
 checkName:
@@ -226,7 +226,7 @@ checkName:
    /* If autochanger, request slot */
    if (store->autochanger) {
       for ( ;; ) {
-         if (!get_cmd(ua, _("Enter slot (0 for none): "))) {
+         if (!get_cmd(ua, _("Enter slot (0 for none): ")) || ua->cmd[0] == '.') {
            return 1;
         }
         mr.Slot = atoi(ua->cmd);
index da1d99f07d5ee1678ca9d7daafb8e878d3f63732..c34ccc4657fc5eea14faa0e271f0ee630d2b0ea6 100644 (file)
@@ -366,26 +366,12 @@ int select_client_dbr(UAContext *ua, CLIENT_DBR *cr)
  */
 int get_pool_dbr(UAContext *ua, POOL_DBR *pr)
 {
-   int i;
-
    if (pr->Name[0]) {                /* If name already supplied */
       if (db_get_pool_record(ua->jcr, ua->db, pr)) {
         return pr->PoolId;
       }
       bsendmsg(ua, _("Could not find Pool %s: ERR=%s"), pr->Name, db_strerror(ua->db));
    }
-   for (i=1; i<ua->argc; i++) {
-      if (strcasecmp(ua->argk[i], _("pool")) == 0 && ua->argv[i]) {
-        bstrncpy(pr->Name, ua->argv[i], sizeof(pr->Name));
-        if (!db_get_pool_record(ua->jcr, ua->db, pr)) {
-            bsendmsg(ua, _("Could not find Pool %s: ERR=%s"), ua->argv[i],
-                    db_strerror(ua->db));
-           pr->PoolId = 0;
-           break;
-        }
-        return pr->PoolId;
-      }
-   }
    if (!select_pool_dbr(ua, pr)) {  /* try once more */
       return 0;
    }
@@ -402,6 +388,18 @@ int select_pool_dbr(UAContext *ua, POOL_DBR *pr)
    int num_pools, i;
    uint32_t *ids; 
 
+   for (i=1; i<ua->argc; i++) {
+      if (strcasecmp(ua->argk[i], _("pool")) == 0 && ua->argv[i]) {
+        bstrncpy(pr->Name, ua->argv[i], sizeof(pr->Name));
+        if (!db_get_pool_record(ua->jcr, ua->db, pr)) {
+            bsendmsg(ua, _("Could not find Pool %s: ERR=%s"), ua->argv[i],
+                    db_strerror(ua->db));
+           pr->PoolId = 0;
+           break;
+        }
+        return 1;
+      }
+   }
 
    pr->PoolId = 0;
    if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
index 6816566400a351641f61c88ed95b7bd1ce9aa8e0..843cd4e46752b7fcbc87e83c3deb268134ca0176 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.30a"
 #define VSTRING "1"
-#define BDATE   "02 May 2003"
-#define LSMDATE "02May03"
+#define BDATE   "03 May 2003"
+#define LSMDATE "03May03"
 
 /* Debug flags */
 #define DEBUG 1