]> Softwares of Agnibho - medscript.git/commitdiff
Index action in toolbar
authorAgnibho Mondal <mondal@agnibho.com>
Wed, 8 Nov 2023 17:57:34 +0000 (23:27 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Wed, 8 Nov 2023 17:57:34 +0000 (23:27 +0530)
resource/icon_index.svg [new file with mode: 0644]
window.py

diff --git a/resource/icon_index.svg b/resource/icon_index.svg
new file mode 100644 (file)
index 0000000..ec371d8
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   id="svg1468"
+   sodipodi:docname="icon_index.svg"
+   viewBox="0 0 187.5 187.5"
+   sodipodi:version="0.32"
+   version="1.0"
+   y="0"
+   x="0"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     pagecolor="#ffffff"
+     inkscape:zoom="1.8346667"
+     inkscape:window-x="0"
+     borderopacity="1.0"
+     inkscape:current-layer="svg1468"
+     inkscape:cx="94.022527"
+     inkscape:cy="93.749998"
+     inkscape:window-y="0"
+     inkscape:window-height="1080"
+     inkscape:pageopacity="0.0"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:window-maximized="0" />
+  <g
+     id="layer1"
+     transform="matrix(1.6412809,0,0,1.2689922,-56.853431,-21.872642)">
+    <g
+       id="g2298"
+       transform="matrix(0.78306,0,0,0.78306,-447.41,-120.69)">
+      <rect
+         id="rect2296"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.75;stroke-linecap:round;stroke-linejoin:round"
+         height="146"
+         width="110"
+         y="180.36"
+         x="648" />
+      <rect
+         id="rect2294"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.75;stroke-linecap:round;stroke-linejoin:round"
+         height="146"
+         width="110"
+         y="198.36"
+         x="634" />
+      <rect
+         id="rect2280"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.75;stroke-linecap:round;stroke-linejoin:round"
+         height="146"
+         width="110"
+         y="214.36"
+         x="620" />
+      <path
+         id="path2282"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,258.36 h 77.5" />
+      <path
+         id="path2284"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,278.36 h 77.5" />
+      <path
+         id="path2286"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,298.36 h 77.5" />
+      <path
+         id="path2288"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,318.36 h 77.5" />
+      <path
+         id="path2290"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,338.36 h 77.5" />
+      <path
+         id="path2292"
+         style="fill:none;stroke:#000000;stroke-width:2.6135"
+         d="m 636.25,238.36 h 77.5" />
+    </g>
+  </g>
+  <metadata
+     id="metadata1">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>Paper 4 icon</dc:title>
+        <dc:date>2006-12-26T00:00:00</dc:date>
+        <dc:description />
+        <dc:source>https://openclipart.org/detail/24793/-by--24793</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Anonymous</dc:title>
+          </cc:Agent>
+        </dc:creator>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
index fa5f29c5cc6995136bd149949a180abf0a5341c3..e149d20104984e8bab6ac237534a5613a08f1693 100644 (file)
--- a/window.py
+++ b/window.py
@@ -124,7 +124,7 @@ class MainWindow(QMainWindow):
         self.unrenderbox.show(self.prescription).exec()
 
     def cmd_render(self):
-        self.refresh()
+        self.update_instance()
         if(self.save_state==md5(self.prescription.get_json().encode()).hexdigest()):
             try:
                 target=self.renderer.render(self.current_file.directory.name)
@@ -138,7 +138,7 @@ class MainWindow(QMainWindow):
            QMessageBox.information(self, "Save first", "Please save the file before rendering.")
 
     def cmd_sign(self):
-        self.refresh()
+        self.update_instance()
         if(self.save_state==md5(self.prescription.get_json().encode()).hexdigest()):
             ok=True #password, ok=QInputDialog.getText(self, "Enter password", "Private key password", QLineEdit.EchoMode.Password)
             if(ok):
@@ -519,6 +519,7 @@ class MainWindow(QMainWindow):
         self.setGeometry(100, 100, 600, 400)
         self.setWindowIcon(QIcon(os.path.join(config["resource"], "icon_medscript.ico")))
 
+        icon_index=QIcon(os.path.join(config["resource"], "icon_index.svg"))
         icon_open=QIcon(os.path.join(config["resource"], "icon_open.svg"))
         icon_save=QIcon(os.path.join(config["resource"], "icon_save.svg"))
         icon_render=QIcon(os.path.join(config["resource"], "icon_render.svg"))
@@ -588,6 +589,8 @@ class MainWindow(QMainWindow):
         action_index=QAction("Show Index", self)
         action_index.triggered.connect(self.cmd_index)
         action_index.setShortcut("Ctrl+I")
+        action_index2=QAction(icon_index, "Index", self)
+        action_index2.triggered.connect(self.cmd_index)
         action_update=QAction("Check Update", self)
         action_update.triggered.connect(self.cmd_update)
         action_about=QAction("About MedScript", self)
@@ -642,6 +645,7 @@ class MainWindow(QMainWindow):
 
         toolbar=QToolBar("Main Toolbar", floatable=False, movable=False)
         toolbar.setIconSize(QSize(16, 16))
+        toolbar.addAction(action_index2)
         toolbar.addAction(action_open2)
         toolbar.addAction(action_save2)
         toolbar.addAction(action_refresh2)