[smuxi: 5/12] Frontend-GNOME: fix open log buttons being sensitive after startup



commit 9b5fd1c724106cb6111de82d6c624bb0f97d8cf8
Author: Mirco Bauer <meebey meebey net>
Date:   Sat Aug 18 16:23:18 2018 +0800

    Frontend-GNOME: fix open log buttons being sensitive after startup
    
    When starting Smuxi the open log buttons are sensitive and can be activated.
    Clicking one of the open log buttons directly after startup shows an error
    dialog as there is no log file for the Smuxi session chat. The error message is:
    
        Cannot start process because a file name has not been provided.
    
    The buttons should only be sensitive if the current active chat has a log file
    though. Thus the initial state of the buttons will be set to being insensitive
    and when switching to a different chat the buttons will be made sensitive in
    MainWindow.OnNotebookSwitchPage().

 src/Frontend-GNOME/Views/MenuWidget.cs | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/Frontend-GNOME/Views/MenuWidget.cs b/src/Frontend-GNOME/Views/MenuWidget.cs
index fa3eb5bf..84b89e9a 100644
--- a/src/Frontend-GNOME/Views/MenuWidget.cs
+++ b/src/Frontend-GNOME/Views/MenuWidget.cs
@@ -112,6 +112,12 @@ namespace Smuxi.Frontend.Gnome
             f_OpenLogToolAction.IconName = Gtk.Stock.Open;
             f_FindGroupChatToolAction.IconName = Gtk.Stock.Find;
 
+            // disable the open log buttons initially as they will only be
+            // enabled for chats that have a log file in
+            // MainWindow.OnNotebookSwitchPage()
+            f_OpenLogAction.Sensitive = false;
+            f_OpenLogToolAction.Sensitive = false;
+
             f_MenuToolbar.ShowAll();
             f_MenuToolbar.NoShowAll = true;
             f_MenuToolbar.Visible = (bool) Frontend.FrontendConfig["ShowToolBar"];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]