diff options
author | myheroyuki <myheroyuki@outlook.com> | 2023-04-11 14:45:04 +0300 |
---|---|---|
committer | myheroyuki <myheroyuki@outlook.com> | 2023-04-11 14:45:04 +0300 |
commit | e9f137dddbab60e737dc6231b695f840c3c4208c (patch) | |
tree | d83b73ca6fe8adfc74612e438224fb0e1f992391 | |
parent | fb903bd8088b47ca50a7e36ccdcb7bc28155a8b0 (diff) |
Improvements to mpchanger page
-rw-r--r-- | data/ui/remmina_main.glade | 425 | ||||
-rw-r--r-- | data/ui/remmina_mpc.glade | 511 | ||||
-rw-r--r-- | src/remmina_main.c | 5 | ||||
-rw-r--r-- | src/remmina_main.h | 1 | ||||
-rw-r--r-- | src/remmina_mpchange.c | 120 |
5 files changed, 400 insertions, 662 deletions
diff --git a/data/ui/remmina_main.glade b/data/ui/remmina_main.glade index 89ea1d339..e34b7dd42 100644 --- a/data/ui/remmina_main.glade +++ b/data/ui/remmina_main.glade @@ -1,305 +1,193 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 - -Remmina - The GTK+ Remmina Remote Desktop Client -Copyright © 2014-2022 Antenore Gatta, Giovanni Panozzo -Copyright © 2022-2023 Antenore Gatta, Giovanni Panozzo, Hiroyuki Tanaka - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ---> <interface domain="remmina"> - <requires lib="gtk+" version="4.0"/> - <!-- interface-license-type gplv2 --> - <!-- interface-name Remmina --> - <!-- interface-description The GTK+ Remmina Remote Desktop Client --> - <!-- interface-copyright Antenore Gatta, Giovanni Panozzo 2014-2020 --> + <requires lib="gtk" version="4.0"/> <object class="GtkEntryCompletion" id="entrycompletion"> - <property name="inline-completion">True</property> - <property name="inline-selection">True</property> + <property name="inline-completion">1</property> + <property name="inline-selection">1</property> </object> <object class="GtkWindow" id="RemminaMain"> - <property name="can-focus">False</property> <property name="icon-name">org.remmina.Remmina</property> - <!-- <signal name="delete-event" handler="remmina_main_on_delete_event" swapped="no"/> --> <signal name="destroy" handler="remmina_main_on_destroy_event" swapped="no"/> - <!-- <signal name="drag-data-received" handler="remmina_main_on_drag_data_received" swapped="no"/> --> <signal name="show" handler="remmina_main_on_show" swapped="no"/> - <!-- <signal name="window-state-event" handler="remmina_main_on_window_state_event" swapped="no"/> --> - <child> + <property name="child"> <object class="GtkBox" id="box_main"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="orientation">vertical</property> <child> <object class="GtkSearchBar" id="search_bar"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="search-mode-enabled">True</property> - <child> + <property name="search-mode-enabled">1</property> + <property name="child"> <object class="GtkBox" id="box_quick_connect"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="valign">baseline</property> - <property name="hexpand">True</property> + <property name="hexpand">1</property> <child> <object class="GtkComboBoxText" id="combo_quick_connect_protocol"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Select the protocol to use with the quick connect bar.</property> + <property name="tooltip-text" translatable="1">Select the protocol to use with the quick connect bar.</property> <property name="active">0</property> </object> - <!-- <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> --> </child> <child> <object class="GtkEntry" id="entry_quick_connect_server"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <!-- <property name="has-focus">True</property> --> - <!-- <property name="is-focus">True</property> --> - <!-- <property name="can-default">True</property> --> - <!-- <property name="has-default">True</property> --> - <property name="receives-default">True</property> - <property name="tooltip-text" translatable="yes">Search string or server name/IP address for “Quick Connect”</property> - <property name="hexpand">True</property> + <property name="focusable">1</property> + <property name="receives-default">1</property> + <property name="tooltip-text" translatable="1">Search string or server name/IP address for “Quick Connect”</property> + <property name="hexpand">1</property> <property name="width-chars">61</property> <property name="secondary-icon-name">edit-clear</property> - <property name="primary-icon-tooltip-text" translatable="yes">Server name or IP address</property> - <property name="secondary-icon-tooltip-text" translatable="yes">Clear</property> - <property name="primary-icon-tooltip-markup" translatable="yes">Server name or IP address</property> - <property name="secondary-icon-tooltip-markup" translatable="yes">Clear</property> + <property name="primary-icon-tooltip-text" translatable="1">Server name or IP address</property> + <property name="secondary-icon-tooltip-text" translatable="1">Clear</property> + <property name="primary-icon-tooltip-markup" translatable="1">Server name or IP address</property> + <property name="secondary-icon-tooltip-markup" translatable="1">Clear</property> <property name="completion">entrycompletion</property> <property name="input-hints">GTK_INPUT_HINT_WORD_COMPLETION | GTK_INPUT_HINT_NONE</property> <signal name="activate" handler="remmina_main_quickconnect_on_click" swapped="no"/> <signal name="changed" handler="remmina_main_quick_search_on_changed" swapped="no"/> - <!-- <signal name="focus-in-event" handler="remmina_main_quick_search_enter" swapped="no"/> --> <signal name="icon-press" handler="remmina_main_quick_search_on_icon_press" swapped="no"/> - <!-- <signal name="insert-at-cursor" handler="remmina_main_load_files_cb" swapped="no"/> --> - <!-- <accelerator key="f" signal="grab-focus" modifiers="GDK_CONTROL_MASK"/> --> </object> - <!-- <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> --> </child> <child> - <object class="GtkSeparator" id="separator2"> - <property name="visible">True</property> - <property name="can-focus">False</property> - </object> - <!-- <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> --> + <object class="GtkSeparator" id="separator2"/> </child> </object> - </child> + </property> </object> - <!-- <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> --> </child> <child> - <menu id='menu_bar_options'> + <menu id="menu_bar_options"> <section> <item> - <attribute name='label' translatable='yes'>_Preferences</attribute> - <attribute name='action'>app.preferences</attribute> + <attribute name="label" translatable="yes">_Preferences</attribute> + <attribute name="action">app.preferences</attribute> </item> <item> - <attribute name='label' translatable='yes'>Multi password changer</attribute> - <attribute name='action'>app.mpchange</attribute> + <attribute name="label" translatable="yes">Multi password changer</attribute> + <attribute name="action">app.mpchange</attribute> </item> <item> - <attribute name='label' translatable='yes'>Debugging</attribute> - <attribute name='action'>app.debug</attribute> + <attribute name="label" translatable="yes">Debugging</attribute> + <attribute name="action">app.debug</attribute> </item> <item> - <attribute name='label' translatable='yes'>Import</attribute> - <attribute name='action'>app.import</attribute> + <attribute name="label" translatable="yes">Import</attribute> + <attribute name="action">app.import</attribute> </item> <item> - <attribute name='label' translatable='yes'>Export</attribute> - <attribute name='action'>app.export</attribute> + <attribute name="label" translatable="yes">Export</attribute> + <attribute name="action">app.export</attribute> </item> <item> - <attribute name='label' translatable='yes'>Plugins</attribute> - <attribute name='action'>app.plugins</attribute> + <attribute name="label" translatable="yes">Plugins</attribute> + <attribute name="action">app.plugins</attribute> </item> </section> <section> <item> - <attribute name='label' translatable='yes'>Make Remmina your default remote desktop client</attribute> - <attribute name='action'>app.default</attribute> + <attribute name="label" translatable="yes">Make Remmina your default remote desktop client</attribute> + <attribute name="action">app.default</attribute> </item> </section> <section> <item> - <attribute name='label' translatable='yes'>Homepage</attribute> - <attribute name='action'>app.homepage</attribute> + <attribute name="label" translatable="yes">Homepage</attribute> + <attribute name="action">app.homepage</attribute> </item> <item> - <attribute name='label' translatable='yes'>Donations</attribute> - <attribute name='action'>app.donations</attribute> + <attribute name="label" translatable="yes">Donations</attribute> + <attribute name="action">app.donations</attribute> </item> <item> - <attribute name='label' translatable='yes'>Wiki</attribute> - <attribute name='action'>app.wiki</attribute> + <attribute name="label" translatable="yes">Wiki</attribute> + <attribute name="action">app.wiki</attribute> </item> <item> - <attribute name='label' translatable='yes'>Community</attribute> - <attribute name='action'>app.community</attribute> + <attribute name="label" translatable="yes">Community</attribute> + <attribute name="action">app.community</attribute> </item> </section> <section> <item> - <attribute name='label' translatable='yes'>About</attribute> - <attribute name='action'>app.about</attribute> + <attribute name="label" translatable="yes">About</attribute> + <attribute name="action">app.about</attribute> </item> <item> - <attribute name='label' translatable='yes'>_Quit</attribute> - <attribute name='action'>app.quit</attribute> + <attribute name="label" translatable="yes">_Quit</attribute> + <attribute name="action">app.quit</attribute> </item> </section> </menu> </child> - <child> <object class="GtkPopoverMenu" id="menubar_main"> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> - <child> + <property name="child"> <object class="GtkPopover"> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> - <!-- <property name="label">Popup menu</property> --> <child type="submenu"> <object class="GtkPopover" id="menu_popup"> - <!-- <property name="visible">True</property> --> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> - <child> + <property name="child"> <object class="GtkButton" id="menuitem_popup_connect"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.connect</property> - <property name="label" translatable="yes">Connect</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Connect</property> + <property name="use-underline">1</property> </object> - </child> + </property> <child> - <object class="GtkSeparator" id="separatormenuitem1"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> - </object> + <object class="GtkSeparator" id="separatormenuitem1"/> </child> <child> <object class="GtkButton" id="menuitem_popup_copy"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.copy</property> - <property name="label" translatable="yes">Copy</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Copy</property> + <property name="use-underline">1</property> </object> </child> <child> <object class="GtkButton" id="menuitem_popup_edit"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.edit</property> - <property name="label" translatable="yes">Edit</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Edit</property> + <property name="use-underline">1</property> </object> </child> <child> <object class="GtkButton" id="menuitem_popup_delete"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.delete</property> - <property name="label" translatable="yes">Delete</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Delete</property> + <property name="use-underline">1</property> </object> </child> <child> <object class="GtkButton" id="menuitem_popup_externaltools"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.exttools</property> - <property name="label" translatable="yes">Tools</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Tools</property> + <property name="use-underline">1</property> </object> </child> <child> <object class="GtkButton" id="menuitem_popup_collapse"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.collapse</property> - <property name="label" translatable="yes">Collapse all</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Collapse all</property> + <property name="use-underline">1</property> </object> </child> <child> <object class="GtkButton" id="menuitem_popup_expand"> - <property name="visible">True</property> - <!-- <property name="app-paintable">True</property> --> - <property name="can-focus">False</property> <property name="action-name">main.expand</property> - <property name="label" translatable="yes">Expand all</property> - <property name="use-underline">True</property> + <property name="label" translatable="1">Expand all</property> + <property name="use-underline">1</property> </object> </child> </object> </child> </object> - </child> - + </property> </object> - <!-- <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> --> </child> <child> <object class="GtkScrolledWindow" id="scrolled_files_list"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="vexpand">True</property> - <child> + <property name="focusable">1</property> + <property name="vexpand">1</property> + <property name="child"> <object class="GtkTreeView" id="tree_files_list"> - <property name="visible">True</property> - <property name="can-focus">True</property> + <property name="focusable">1</property> <property name="search-column">3</property> <property name="enable-grid-lines">both</property> - <!-- <signal name="button-press-event" handler="remmina_main_file_list_on_button_press" swapped="no"/> --> - <!-- <signal name="key-press-event" handler="remmina_main_file_list_on_key_press" swapped="no"/> --> <signal name="row-activated" handler="remmina_main_file_list_on_row_activated" swapped="no"/> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection3"> @@ -307,56 +195,48 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </object> </child> <child> - <menu id='menu_bar_connection_click'> + <menu id="menu_bar_connection_click"> <section> <item> - <attribute name='label' translatable='yes'>Connect</attribute> - <attribute name='action'>main.connect</attribute> + <attribute name="label" translatable="yes">Connect</attribute> + <attribute name="action">main.connect</attribute> </item> </section> <section> <item> - <attribute name='label' translatable='yes'>Copy</attribute> - <attribute name='action'>main.copy</attribute> + <attribute name="label" translatable="yes">Copy</attribute> + <attribute name="action">main.copy</attribute> </item> <item> - <attribute name='label' translatable='yes'>Edit</attribute> - <attribute name='action'>main.edit</attribute> + <attribute name="label" translatable="yes">Edit</attribute> + <attribute name="action">main.edit</attribute> </item> <item> - <attribute name='label' translatable='yes'>Delete</attribute> - <attribute name='action'>app.delete</attribute> + <attribute name="label" translatable="yes">Delete</attribute> + <attribute name="action">app.delete</attribute> </item> <item> - <attribute name='label' translatable='yes'>Tools</attribute> - <attribute name='action'>app.exttools</attribute> + <attribute name="label" translatable="yes">Tools</attribute> + <attribute name="action">app.exttools</attribute> </item> <item> - <attribute name='label' translatable='yes'>Collapse all</attribute> - <attribute name='action'>app.collapse</attribute> + <attribute name="label" translatable="yes">Collapse all</attribute> + <attribute name="action">app.collapse</attribute> </item> <item> - <attribute name='label' translatable='yes'>Expand all</attribute> - <attribute name='action'>app.expand</attribute> + <attribute name="label" translatable="yes">Expand all</attribute> + <attribute name="action">app.expand</attribute> </item> </section> </menu> </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_name"> - <property name="resizable">True</property> + <property name="resizable">1</property> <property name="spacing">12</property> - <property name="title" translatable="yes">Name</property> - <property name="clickable">True</property> + <property name="title" translatable="1">Name</property> + <property name="clickable">1</property> <property name="sort-column-id">1</property> - <!-- <child> - <object class="GtkCellRendererPixbuf" id="renderer_files_list_icon"> - <property name="stock_size">4</property> - </object> - <attributes> - <attribute name="icon-name">0</attribute> - </attributes> - </child> --> <child> <object class="GtkCellRendererText" id="renderer_files_list_name"/> <attributes> @@ -367,9 +247,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_group"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Group</property> - <property name="clickable">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Group</property> + <property name="clickable">1</property> <property name="sort-column-id">2</property> <child> <object class="GtkCellRendererText" id="renderer_files_list_group"/> @@ -381,10 +261,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_labels"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Labels</property> - <property name="clickable">True</property> - <property name="sort-indicator">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Labels</property> + <property name="clickable">1</property> + <property name="sort-indicator">1</property> <property name="sort-order">descending</property> <property name="sort-column-id">7</property> <child> @@ -397,9 +277,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_server"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Server</property> - <property name="clickable">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Server</property> + <property name="clickable">1</property> <property name="sort-column-id">3</property> <child> <object class="GtkCellRendererText" id="renderer_files_list_server"/> @@ -411,9 +291,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_notes"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Notes</property> - <property name="clickable">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Notes</property> + <property name="clickable">1</property> <property name="sort-column-id">8</property> <child> <object class="GtkCellRendererText" id="renderer_files_list_notes"/> @@ -425,9 +305,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_plugin"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Plugin</property> - <property name="clickable">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Plugin</property> + <property name="clickable">1</property> <property name="sort-column-id">4</property> <child> <object class="GtkCellRendererText" id="renderer_files_list_plugin"/> @@ -439,10 +319,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </child> <child> <object class="GtkTreeViewColumn" id="column_files_list_date"> - <property name="resizable">True</property> - <property name="title" translatable="yes">Last used</property> - <property name="clickable">True</property> - <property name="sort-indicator">True</property> + <property name="resizable">1</property> + <property name="title" translatable="1">Last used</property> + <property name="clickable">1</property> + <property name="sort-indicator">1</property> <property name="sort-order">descending</property> <property name="sort-column-id">5</property> <signal name="clicked" handler="remmina_main_on_date_column_sort_clicked" swapped="no"/> @@ -455,123 +335,74 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </object> </child> </object> - </child> + </property> </object> - <!-- <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> --> </child> <child> <object class="GtkStatusbar" id="statusbar_main"> - <property name="visible">True</property> - <property name="can-focus">True</property> + <property name="focusable">1</property> </object> - <!-- <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> --> </child> </object> - </child> + </property> <child type="titlebar"> <object class="GtkHeaderBar" id="main_headerbar"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <!-- <property name="title">Remmina - Remote Desktop Client</property> --> - <!-- <property name="has-subtitle">False</property> --> - <!-- <property name="spacing">10</property> --> - <!-- <property name="show-close-button">True</property> --> <child> <object class="GtkButton" id="button_new"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="tooltip-text" translatable="yes">New connection profile</property> + <property name="focusable">1</property> + <property name="receives-default">1</property> + <property name="tooltip-text" translatable="1">New connection profile</property> <property name="halign">start</property> <property name="action-name">main.new</property> <child> <object class="GtkImage" id="image_new"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Add a new connection profile</property> + <property name="tooltip-text" translatable="1">Add a new connection profile</property> <property name="icon-name">document-new-symbolic</property> - <property name="icon_size">1</property> + <property name="icon_size">normal</property> </object> </child> </object> </child> <child> <object class="GtkToggleButton" id="search_toggle"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="tooltip-text" translatable="yes">Show search bar</property> + <property name="focusable">1</property> + <property name="tooltip-text" translatable="1">Show search bar</property> <property name="action-name">main.search</property> - <property name="active">True</property> + <property name="active">1</property> <child> <object class="GtkImage" id="find_toggle_image"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Hide or show the search bar</property> + <property name="tooltip-text" translatable="1">Hide or show the search bar</property> <property name="icon-name">edit-find-symbolic</property> </object> </child> </object> - <!-- <packing> - <property name="position">1</property> - </packing> --> </child> - <child> + <child type="end"> <object class="GtkMenuButton" id="menu_header_button"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <!-- <property name="use-popover">True</property> --> + <property name="focusable">1</property> + <property name="receives-default">1</property> <child> <object class="GtkImage" id="image_menu"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Remmina main menu</property> + <property name="tooltip-text" translatable="1">Remmina main menu</property> <property name="icon-name">open-menu-symbolic</property> - <property name="icon_size">1</property> + <property name="icon_size">normal</property> </object> </child> - <!-- <child internal-child="accessible"> - <object class="AtkObject" id="menu_header_button-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Actions</property> - </object> - </child> --> - <!-- <accelerator key="F10" signal="activate"/> --> </object> - <!-- <packing> - <property name="pack-type">end</property> - <property name="position">3</property> - </packing> --> </child> - <child> + <child type="end"> <object class="GtkToggleButton" id="view_toggle_button"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="tooltip-text" translatable="yes">Toggle view</property> + <property name="focusable">1</property> + <property name="tooltip-text" translatable="1">Toggle view</property> <signal name="toggled" handler="remmina_main_on_view_toggle" swapped="no"/> <child> <object class="GtkImage" id="view_toggle_icon"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Switch from grouped to list view</property> + <property name="tooltip-text" translatable="1">Switch from grouped to list view</property> <property name="icon-name">view-list-symbolic</property> - <property name="use-fallback">True</property> + <property name="use-fallback">1</property> </object> </child> </object> - <!-- <packing> - <property name="pack-type">end</property> - <property name="position">4</property> - </packing> --> </child> </object> </child> diff --git a/data/ui/remmina_mpc.glade b/data/ui/remmina_mpc.glade index e4f18092c..0d90b2da8 100644 --- a/data/ui/remmina_mpc.glade +++ b/data/ui/remmina_mpc.glade @@ -1,506 +1,361 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.40.0 --> <interface> - <requires lib="gtk+" version="3.20"/> + <requires lib="gtk" version="4.0"/> <object class="GtkDialog" id="MPCDialog"> - <property name="can-focus">False</property> - <property name="modal">True</property> + <property name="modal">1</property> <child> <object class="GtkBox" id="dialog-vbox1"> - <property name="can-focus">False</property> + <property name="visible">1</property> <property name="orientation">vertical</property> - <child internal-child="action_area"> - <object class="GtkBox" id="dialog-action_area1"> - <property name="can-focus">False</property> - <!-- <property name="layout-style">end</property> --> - <child> - <object class="GtkButton" id="btnDoChange"> - <property name="label" translatable="yes">Change</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <!-- <property name="can-default">True</property> --> - <property name="receives-default">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="btnCancelChange"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <!-- <property name="can-default">True</property> --> - <property name="has-default">True</property> - <property name="receives-default">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">5</property> - </packing> - </child> <child> - <object class="GtkSeparator"> - <property name="visible">True</property> - <property name="can-focus">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> + <object class="GtkSeparator"/> </child> <child> <object class="GtkBox"> - <property name="visible">True</property> - <property name="can-focus">False</property> <child> <object class="GtkFrame"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="label-xalign">0.5</property> - <property name="shadow-type">none</property> - <child> + <!-- <child> <object class="GtkAlignment"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="left-padding">12</property> + <property name="left-padding">12</property> --> <child> - <!-- n-columns=2 n-rows=3 --> <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="margin-top">8</property> - <property name="column-homogeneous">True</property> + <property name="column-homogeneous">1</property> <child> <object class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Group</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Group</property> <property name="justify">right</property> + <layout> + <property name="column">0</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkSearchEntry" id="groupEntry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="primary-icon-name">edit-find-symbolic</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <!-- <property name="primary-icon-name">edit-find-symbolic</property> <property name="primary-icon-activatable">False</property> - <property name="primary-icon-sensitive">False</property> + <property name="primary-icon-sensitive">False</property> --> + <layout> + <property name="column">1</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Username</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Username</property> <property name="justify">right</property> + <layout> + <property name="column">0</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> </child> <child> <object class="GtkSearchEntry" id="usernameEntry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="primary-icon-name">edit-find-symbolic</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <!-- <property name="primary-icon-name">edit-find-symbolic</property> <property name="primary-icon-activatable">False</property> - <property name="primary-icon-sensitive">False</property> + <property name="primary-icon-sensitive">False</property> --> + <layout> + <property name="column">1</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> </child> <child> <object class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Domain</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Domain</property> + <layout> + <property name="column">0</property> + <property name="row">2</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">2</property> - </packing> </child> <child> <object class="GtkSearchEntry" id="domainEntry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="primary-icon-name">edit-find-symbolic</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <!-- <property name="primary-icon-name">edit-find-symbolic</property> <property name="primary-icon-activatable">False</property> - <property name="primary-icon-sensitive">False</property> + <property name="primary-icon-sensitive">False</property> --> + <layout> + <property name="column">1</property> + <property name="row">2</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">2</property> - </packing> </child> </object> </child> - </object> - </child> + <!-- </object> + </child> --> <child type="label"> <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes">Selection criteria</property> + <property name="label" translatable="1">Selection criteria</property> <attributes> - <attribute name="weight" value="bold"/> + <attribute name="weight" value="bold"></attribute> </attributes> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkFrame"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="label-xalign">0.5</property> - <property name="shadow-type">none</property> - <child> + <!-- <child> <object class="GtkAlignment"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="left-padding">12</property> + <property name="left-padding">12</property> --> <child> - <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="margin-top">8</property> - <property name="column-homogeneous">True</property> + <property name="column-homogeneous">1</property> <child> <object class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Password</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Password</property> + <layout> + <property name="column">0</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkEntry" id="password1Entry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="visibility">False</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <property name="visibility">0</property> + <layout> + <property name="column">1</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label13"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Confirm password</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Confirm password</property> + <layout> + <property name="column">0</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> </child> <child> <object class="GtkEntry" id="password2Entry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="visibility">False</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <property name="visibility">0</property> + <layout> + <property name="column">1</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> </child> </object> </child> - </object> - </child> + <!-- </object> + </child> --> <child type="label"> <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes">Set new password</property> + <property name="label" translatable="1">Set new password</property> <attributes> - <attribute name="weight" value="bold"/> + <attribute name="weight" value="bold"></attribute> </attributes> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> <child> <object class="GtkBox"> - <property name="visible">True</property> - <property name="can-focus">False</property> <child> <object class="GtkFrame"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="label-xalign">0.5</property> - <property name="shadow-type">none</property> - <child> + <!-- <child> <object class="GtkAlignment"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="left-padding">12</property> + <property name="left-padding">12</property> --> <child> - <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="margin-top">8</property> - <property name="column-homogeneous">True</property> + <property name="column-homogeneous">1</property> <child> <object class="GtkLabel" id="label21"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Gateway Username</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Gateway Username</property> <property name="justify">right</property> + <layout> + <property name="column">0</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkSearchEntry" id="gatewayUsernameEntry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="primary-icon-name">edit-find-symbolic</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <!-- <property name="primary-icon-name">edit-find-symbolic</property> <property name="primary-icon-activatable">False</property> - <property name="primary-icon-sensitive">False</property> + <property name="primary-icon-sensitive">False</property> --> + <layout> + <property name="column">1</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label24"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> <property name="valign">center</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Gateway Domain</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Gateway Domain</property> <property name="justify">right</property> + <layout> + <property name="column">0</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> </child> <child> <object class="GtkSearchEntry" id="gatewayDomainEntry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="primary-icon-name">edit-find-symbolic</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <!-- <property name="primary-icon-name">edit-find-symbolic</property> <property name="primary-icon-activatable">False</property> - <property name="primary-icon-sensitive">False</property> + <property name="primary-icon-sensitive">False</property> --> + <layout> + <property name="column">1</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> </child> </object> </child> - </object> - </child> + <!-- </object> + </child> --> <child type="label"> <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> <attributes> - <attribute name="weight" value="bold"/> + <attribute name="weight" value="bold"></attribute> </attributes> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkFrame"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="label-xalign">0.5</property> - <property name="shadow-type">none</property> - <child> + <!-- <child> <object class="GtkAlignment"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="left-padding">12</property> + <property name="left-padding">12</property> --> <child> - <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="margin-top">8</property> - <property name="column-homogeneous">True</property> + <property name="column-homogeneous">1</property> <child> <object class="GtkLabel" id="label33"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Gateway Password</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Gateway Password</property> + <layout> + <property name="column">0</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkEntry" id="gatewayPassword1Entry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="visibility">False</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <property name="visibility">0</property> + <layout> + <property name="column">1</property> + <property name="row">0</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label34"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">end</property> - <property name="margin-right">8</property> - <property name="label" translatable="yes">Confirm Gateway Password</property> + <property name="margin-end">8</property> + <property name="label" translatable="1">Confirm Gateway Password</property> + <layout> + <property name="column">0</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> </child> <child> <object class="GtkEntry" id="gatewayPassword2Entry"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="visibility">False</property> + <property name="focusable">1</property> + <property name="hexpand">1</property> + <property name="visibility">0</property> + <layout> + <property name="column">1</property> + <property name="row">1</property> + </layout> </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> </child> </object> </child> - </object> - </child> + <!-- </object> + </child> --> <child type="label"> <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> <attributes> - <attribute name="weight" value="bold"/> + <attribute name="weight" value="bold"></attribute> </attributes> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - </packing> </child> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="shadow-type">in</property> + <property name="vexpand">1</property> + <property name="focusable">1</property> <property name="min-content-width">130</property> <property name="min-content-height">254</property> - <child> + <property name="child"> <object class="GtkTreeView" id="profchangelist"> - <property name="visible">True</property> - <property name="can-focus">True</property> + <property name="focusable">1</property> <property name="enable-grid-lines">both</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection3"/> </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn1"> - <property name="title" translatable="yes" context="Multi password changer" comments="A column table with multiple check-boxes">Select</property> - <property name="clickable">True</property> + <property name="title" translatable="1" context="Multi password changer" comments="A column table with multiple check-boxes">Select</property> + <property name="clickable">1</property> <child> <object class="GtkCellRendererToggle" id="cellrenderertoggle1"/> <attributes> @@ -511,7 +366,7 @@ </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn2"> - <property name="title" translatable="yes" context="Multi password changer table">Name</property> + <property name="title" translatable="1" context="Multi password changer table">Name</property> <child> <object class="GtkCellRendererText" id="cellrenderertext1"/> <attributes> @@ -522,7 +377,7 @@ </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn3"> - <property name="title" translatable="yes" context="Multi password changer table">Group</property> + <property name="title" translatable="1" context="Multi password changer table">Group</property> <child> <object class="GtkCellRendererText" id="cellrenderertext2"/> <attributes> @@ -533,7 +388,7 @@ </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn4"> - <property name="title" translatable="yes" context="Multi password changer table">Domain\Username</property> + <property name="title" translatable="1" context="Multi password changer table">Domain\Username</property> <child> <object class="GtkCellRendererText" id="cellrenderertext3"/> <attributes> @@ -544,7 +399,7 @@ </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn5"> - <property name="title" translatable="yes" context="Multi password changer table">Gateway Domain\Username</property> + <property name="title" translatable="1" context="Multi password changer table">Gateway Domain\Username</property> <child> <object class="GtkCellRendererText" id="cellrenderertext4"/> <attributes> @@ -554,43 +409,45 @@ </object> </child> </object> - </child> + </property> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">7</property> - </packing> </child> <child> <object class="GtkLabel" id="statusLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="ellipsize">end</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">7</property> - </packing> + </child> + <child> + <object class="GtkButton" id="btnDoChange"> + <property name="label" translatable="1">Change</property> + <property name="focusable">1</property> + <property name="receives-default">1</property> + </object> + </child> + <child> + <object class="GtkButton" id="btnCancelChange"> + <property name="label" translatable="1">Cancel</property> + <property name="focusable">1</property> + <property name="receives-default">1</property> + </object> </child> </object> + </child> - <action-widgets> + + <!-- <action-widgets> <action-widget response="0">btnCancelChange</action-widget> </action-widgets> <child type="titlebar"> <object class="GtkLabel" id="titleLabel"> - <property name="visible">True</property> - <property name="can-focus">False</property> <property name="halign">baseline</property> - <property name="label" translatable="yes"><span weight='bold' size='larger'>Multi Password Changer</span></property> - <property name="use-markup">True</property> + <property name="label" translatable="1"><span weight='bold' size='larger'>Multi Password Changer</span></property> + <property name="use-markup">1</property> <property name="ellipsize">start</property> </object> </child> <action-widgets> <action-widget response="0">btnCancelChange</action-widget> - </action-widgets> + </action-widgets> --> </object> -</interface>
\ No newline at end of file +</interface> diff --git a/src/remmina_main.c b/src/remmina_main.c index b59b08562..451ed9c0d 100644 --- a/src/remmina_main.c +++ b/src/remmina_main.c @@ -1604,6 +1604,9 @@ GtkWidget *remmina_main_new(void) gtk_window_set_default_size(remminamain->window, 800, 400); gtk_window_set_resizable(remminamain->window, FALSE); } + /* Header */ + remminamain->header = GTK_HEADER_BAR(RM_GET_OBJECT("main_headerbar")); + /* New Button */ remminamain->button_new = GTK_BUTTON(RM_GET_OBJECT("button_new")); if (kioskmode && kioskmode == TRUE) @@ -1621,7 +1624,7 @@ GtkWidget *remmina_main_new(void) GMenu* menu = G_MENU(RM_GET_OBJECT("menu_bar_options")); remminamain->menu_popup_full = gtk_popover_menu_new_from_model(menu); gtk_menu_button_set_popover(remminamain->menu_header_button, remminamain->menu_popup_full); - + menu = G_MENU(RM_GET_OBJECT("menu_bar_connection_click")); remminamain->menu_popup = gtk_popover_menu_new_from_model(menu); if (kioskmode && kioskmode == TRUE) { diff --git a/src/remmina_main.h b/src/remmina_main.h index 661dded6f..99db3a25d 100644 --- a/src/remmina_main.h +++ b/src/remmina_main.h @@ -48,6 +48,7 @@ typedef struct _RemminaMainPriv RemminaMainPriv; typedef struct _RemminaMain { GtkBuilder * builder; GtkWindow * window; + GtkHeaderBar * header; /* Menu widgets */ GtkPopover * menu_popup; GtkMenuButton * menu_header_button; diff --git a/src/remmina_mpchange.c b/src/remmina_mpchange.c index 5da4346f5..90497e034 100644 --- a/src/remmina_mpchange.c +++ b/src/remmina_mpchange.c @@ -58,12 +58,13 @@ struct mpchanger_params { gchar *gatewaydomain; gchar *gatewaypassword; - GtkEntry *eGroup, *eUsername, *eDomain, *ePassword1, *ePassword2; + GtkSearchEntry *eGroup, *eUsername, *eDomain, *ePassword1, *ePassword2; GtkEntry *eGatewayUsername, *eGatewayDomain, *eGatewayPassword1, *eGatewayPassword2; GtkListStore* store; GtkDialog* dialog; GtkTreeView* table; GtkButton* btnDoChange; + GtkButton* btnCancelChange; GtkLabel* statusLabel; GtkTreeIter iter; @@ -289,7 +290,72 @@ static void remmina_mpchange_dochange_clicked(GtkButton *btn, gpointer user_data gtk_label_set_text(mpcp->statusLabel, _("Resetting passwords, please wait…")); enable_inputs(mpcp, FALSE); - mpcp->sid = g_idle_add(changenext, (gpointer)mpcp); + //TODO GTK4 make this work again + //mpcp->sid = g_idle_add(changenext, (gpointer)mpcp); + + while (changenext(mpcp) == G_SOURCE_CONTINUE){ + //Currently looping as opposed to repeat calling the function with + //g_idle_add to work with gtk4 changes. Needs improved + } + gtk_window_destroy(mpcp->dialog); + +} + + + +static void remmina_mpchange_cancelchange_clicked(GtkButton *btn, gpointer user_data) +{ + TRACE_CALL(__func__); + struct mpchanger_params* mpcp = (struct mpchanger_params*)user_data; + gtk_window_destroy(mpcp->dialog); + +} + +static void remmina_mpchange_handle_dialog_response(GtkDialog *self, gpointer user_data) +{ + gtk_window_destroy(self); + +} + +static void remmina_mpchange_cleanup(GtkDialog *self, gpointer user_data) +{ + TRACE_CALL(__func__); + struct mpchanger_params *mpcp = (struct mpchanger_params *)user_data; + + if (mpcp->sid) { + g_source_remove(mpcp->sid); + mpcp->sid = 0; + } + + if (mpcp->searchentrychange_timeout_source_id) { + g_source_remove(mpcp->searchentrychange_timeout_source_id); + mpcp->searchentrychange_timeout_source_id = 0; + } + + if (mpcp->changed_passwords_count) { + GtkWidget *msgDialog; + msgDialog = gtk_message_dialog_new(GTK_WINDOW(mpcp->dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + ngettext("%d password changed.", "%d passwords changed.", mpcp->changed_passwords_count), mpcp->changed_passwords_count); + GtkWindow* mainwindow = remmina_main_get_window(); + if (mainwindow) + gtk_window_set_transient_for(GTK_WINDOW(msgDialog), mainwindow); + gtk_window_set_modal(GTK_DIALOG(msgDialog), true); + g_signal_connect(msgDialog, "response", G_CALLBACK(remmina_mpchange_handle_dialog_response), (gpointer)mpcp); + gtk_widget_show(msgDialog); + } + + // Free data + g_free(mpcp->username); + g_free(mpcp->password); + g_free(mpcp->domain); + g_free(mpcp->group); + g_free(mpcp->gatewayusername); + g_free(mpcp->gatewaypassword); + g_free(mpcp->gatewaydomain); + g_free(mpcp); } @@ -388,7 +454,8 @@ static gboolean remmina_file_multipasswd_changer_mt(gpointer d) msgDialog = gtk_message_dialog_new(mainwindow, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "%s", initerror); //gtk_dialog_run(GTK_DIALOG(msgDialog)); - gtk_window_destroy(msgDialog); + gtk_window_set_modal(GTK_DIALOG(msgDialog), true); + //gtk_window_destroy(msgDialog); return FALSE; } @@ -401,28 +468,30 @@ static gboolean remmina_file_multipasswd_changer_mt(gpointer d) dialog = GTK_DIALOG(gtk_builder_get_object(bu, "MPCDialog")); mpcp->dialog = dialog; + g_signal_connect(mpcp->dialog, "unrealize", G_CALLBACK(remmina_mpchange_cleanup), (gpointer)mpcp); + if (mainwindow) gtk_window_set_transient_for(GTK_WINDOW(dialog), mainwindow); - mpcp->eGroup = GTK_ENTRY(GET_DIALOG_OBJECT("groupEntry")); + mpcp->eGroup = GTK_SEARCH_ENTRY(GET_DIALOG_OBJECT("groupEntry")); gtk_editable_set_text(mpcp->eGroup, mpcp->group); g_signal_connect(G_OBJECT(mpcp->eGroup), "changed", G_CALLBACK(remmina_mpchange_searchfield_changed), (gpointer)mpcp); g_signal_connect(G_OBJECT(mpcp->eGroup), "stop-search", G_CALLBACK(remmina_mpchange_stopsearch), (gpointer)mpcp); - mpcp->eUsername = GTK_ENTRY(GET_DIALOG_OBJECT("usernameEntry")); + mpcp->eUsername = GTK_SEARCH_ENTRY(GET_DIALOG_OBJECT("usernameEntry")); gtk_editable_set_text(mpcp->eUsername, mpcp->username); g_signal_connect(G_OBJECT(mpcp->eUsername), "changed", G_CALLBACK(remmina_mpchange_searchfield_changed), (gpointer)mpcp); - mpcp->eGatewayUsername = GTK_ENTRY(GET_DIALOG_OBJECT("gatewayUsernameEntry")); + mpcp->eGatewayUsername = GTK_SEARCH_ENTRY(GET_DIALOG_OBJECT("gatewayUsernameEntry")); gtk_editable_set_text(mpcp->eGatewayUsername, mpcp->gatewayusername); g_signal_connect(G_OBJECT(mpcp->eGatewayUsername), "changed", G_CALLBACK(remmina_mpchange_searchfield_changed), (gpointer)mpcp); - mpcp->eDomain = GTK_ENTRY(GET_DIALOG_OBJECT("domainEntry")); + mpcp->eDomain = GTK_SEARCH_ENTRY(GET_DIALOG_OBJECT("domainEntry")); gtk_editable_set_text(mpcp->eDomain, mpcp->domain); g_signal_connect(G_OBJECT(mpcp->eDomain), "changed", G_CALLBACK(remmina_mpchange_searchfield_changed), (gpointer)mpcp); - mpcp->eGatewayDomain = GTK_ENTRY(GET_DIALOG_OBJECT("gatewayDomainEntry")); + mpcp->eGatewayDomain = GTK_SEARCH_ENTRY(GET_DIALOG_OBJECT("gatewayDomainEntry")); gtk_editable_set_text(mpcp->eGatewayDomain, mpcp->gatewaydomain); g_signal_connect(G_OBJECT(mpcp->eGatewayDomain), "changed", G_CALLBACK(remmina_mpchange_searchfield_changed), (gpointer)mpcp); @@ -456,39 +525,16 @@ static gboolean remmina_file_multipasswd_changer_mt(gpointer d) mpcp->btnDoChange = GTK_BUTTON(GET_DIALOG_OBJECT("btnDoChange")); g_signal_connect(mpcp->btnDoChange, "clicked", G_CALLBACK(remmina_mpchange_dochange_clicked), (gpointer)mpcp); - //gtk_dialog_run(dialog); - gtk_window_destroy(GTK_WIDGET(dialog)); + mpcp->btnCancelChange = GTK_BUTTON(GET_DIALOG_OBJECT("btnCancelChange")); + g_signal_connect(mpcp->btnCancelChange, "clicked", G_CALLBACK(remmina_mpchange_cancelchange_clicked), (gpointer)mpcp); + + gtk_window_set_modal(dialog, true); + gtk_widget_show(dialog); + //gtk_window_destroy(GTK_WIDGET(dialog)); - if (mpcp->sid) { - g_source_remove(mpcp->sid); - mpcp->sid = 0; - } - if (mpcp->searchentrychange_timeout_source_id) { - g_source_remove(mpcp->searchentrychange_timeout_source_id); - mpcp->searchentrychange_timeout_source_id = 0; - } - if (mpcp->changed_passwords_count) { - GtkWidget *msgDialog; - msgDialog = gtk_message_dialog_new(GTK_WINDOW(mpcp->dialog), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - ngettext("%d password changed.", "%d passwords changed.", mpcp->changed_passwords_count), mpcp->changed_passwords_count); - //gtk_dialog_run(GTK_DIALOG(msgDialog)); - gtk_window_destroy(msgDialog); - } - // Free data - g_free(mpcp->username); - g_free(mpcp->password); - g_free(mpcp->domain); - g_free(mpcp->group); - g_free(mpcp->gatewayusername); - g_free(mpcp->gatewaypassword); - g_free(mpcp->gatewaydomain); - g_free(mpcp); return FALSE; } |