コード例 #1
0
ファイル: ViewsScreen.cs プロジェクト: octogonz/yamster
 void ReloadQueries(bool threadsOnly)
 {
     foreach (var gridQuery in this.gridQueries)
     {
         if (gridQuery.ModelType == YamsterModelType.Thread)
         {
             var copyQuery = gridQuery.Query.Clone();
             if (!chkShowReadThreads.Active)
             {
                 // Add a filter clause to hide threads that were already read
                 copyQuery.FilterNode = new YqlOperationNode(YqlOperation.And,
                                                             new YqlOperationNode(YqlOperation.Not,
                                                                                  new YqlThreadPropertyNode(YqlThreadProperty.Read)
                                                                                  ),
                                                             copyQuery.FilterNode
                                                             );
             }
             gridQuery.View.LoadQuery(copyQuery);
         }
         else if (!threadsOnly)
         {
             gridQuery.View.LoadQuery(gridQuery.Query);
         }
     }
     validateViewsLagger.RequestAction();
     showFocusedGridQueryLagger.RequestAction();
 }
コード例 #2
0
        public void LoadThread(YamsterThread thread, YamsterMessage messageToHighlight = null)
        {
            if (messageToHighlight != null && messageToHighlight.Thread != thread)
            {
                throw new ArgumentException("messageToHighlight must belong to the specified thread");
            }

            this.threadToLoad       = thread;
            this.messagesToLoad     = threadToLoad.Messages;
            this.messageToHighlight = messageToHighlight;

            rebuildViewLagger.RequestAction();
            UpdateUI();
        }
コード例 #3
0
        void UpdateViewAction()
        {
            bool fireEvent = focusedItemChangedLagger.ActionQueued;

            try
            {
                Debug.Assert(!suppressFocusedItemChangedEvent);
                suppressFocusedItemChangedEvent = true;

                object oldFocusedItem = this.FocusedItem;
                ctlTreeView.Selection.UnselectAll();

                int startTime = Environment.TickCount;
                ApplyFilterAndSort();
                int totalMs = unchecked (Environment.TickCount - startTime);
                if (totalMs > 50)
                {
                    Debug.WriteLine("Grid: ApplyFilterAndSort() took " + totalMs + " ms");
                }

                int index = viewItems.IndexOf(oldFocusedItem);
                if (index >= 0)
                {
                    var treePath = this.GetTreePathFromItemIndex(index);
                    ctlTreeView.Selection.SelectPath(treePath);
                }
                else
                {
                    fireEvent = true;
                }
                ctlTreeView.QueueDraw();
            }
            finally
            {
                suppressFocusedItemChangedEvent = false;
            }
            if (fireEvent)
            {
                focusedItemChangedLagger.RequestAction();
            }

            if (ViewUpdated != null)
            {
                ViewUpdated(this, EventArgs.Empty);
            }
        }
コード例 #4
0
ファイル: GroupConfigScreen.cs プロジェクト: octogonz/yamster
 void YamsterCache_GroupChanged(object sender, YamsterGroupChangedEventArgs e)
 {
     switch (e.ChangeType)
     {
     case YamsterModelChangeType.Added:
     case YamsterModelChangeType.PropertyChanged:     // might be the ShowInYamster property
         reloadGroupsLagger.RequestAction();
         break;
     }
 }
コード例 #5
0
ファイル: AddGroupWindow.cs プロジェクト: octogonz/yamster
        public AddGroupWindow() :
            base(Gtk.WindowType.Toplevel)
        {
            this.appContext = AppContext.Default;
            this.Build();

            ctlGrid.ItemType = typeof(JsonSearchedGroup);
            SetupColumns();

            searchLagger = new ActionLagger(SearchAction, 100);
            searchLagger.RequestAction(ActionLaggerQueueing.ForceDelayed);

            UpdateUI();
        }
コード例 #6
0
ファイル: GroupConfigScreen.cs プロジェクト: octogonz/yamster
        public GroupConfigScreen()
        {
            this.Build();

            this.appContext = AppContext.Default;
            yamsterCache    = appContext.YamsterCache;

            reloadGroupsLagger = new ActionLagger(ReloadGroupsAction);
            reloadGroupsLagger.RequestAction();

            appContext.YamsterCache.GroupChanged += YamsterCache_GroupChanged;

            suspendEvents = false;
            UpdateUI();
        }
コード例 #7
0
        public ConversationsScreen()
        {
            appContext   = AppContext.Default;
            yamsterCache = appContext.YamsterCache;

            this.Build();

            ctlGrid.ItemType = typeof(YamsterConversation);
            SetupColumns();

            reloadConversationsLagger = new ActionLagger(ReloadConversationsAction, 1000);
            reloadConversationsLagger.RequestAction();

            ctlGrid.FilterDelegate = ctlGrid_Filter;

            this.yamsterCache.MessageChanged += yamsterCache_MessageChanged;
        }
コード例 #8
0
ファイル: MessageComposer.cs プロジェクト: octogonz/yamster
        public MessageComposer()
        {
            this.Build();

            appContext = AppContext.Default;

            txtBody.Buffer.Changed += Buffer_Changed;

            ctlWidgetBox.ModifyBg(Gtk.StateType.Normal, new Color(255, 255, 255));
            ctlCancelBox.ModifyBg(Gtk.StateType.Normal, new Color(255, 255, 255));
            this.ComposerMode = MessageComposerMode.Idle;

            // This is workaround for a GTK bug where ctlReplyToBox.Visible = false
            // has no effect during initialization.
            updateUiLagger = new ActionLagger(UpdateUI, lagIntervalMs: 100);
            updateUiLagger.RequestAction(ActionLaggerQueueing.ForceDelayed);
        }
コード例 #9
0
ファイル: GroupThreadScreen.cs プロジェクト: octogonz/yamster
        public GroupThreadScreen()
        {
            appContext   = AppContext.Default;
            yamsterCache = appContext.YamsterCache;

            this.Build();

            ctlGroupGrid.Columns[GroupGridColumn.ShouldSync].Visible = false;
            ctlGroupGrid.Columns[GroupGridColumn.TrackRead].Visible  = false;

            reloadGroupsLagger  = new ActionLagger(ReloadGroupsAction);
            reloadThreadsLagger = new ActionLagger(ReloadThreadsAction);

            reloadGroupsLagger.RequestAction();

            yamsterCache.GroupChanged  += yamsterCache_GroupChanged;
            yamsterCache.ThreadChanged += yamsterCache_ThreadChanged;
        }
コード例 #10
0
ファイル: UserChooserWindow.cs プロジェクト: octogonz/yamster
        public UserChooserWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            // On Mac, this prevents the parent window from losing focus
            Debug.Assert(this.TypeHint == Gdk.WindowTypeHint.Normal);

            appContext   = AppContext.Default;
            yamsterCache = appContext.YamsterCache;

            ctlGrid.ItemType = typeof(YamsterUser);

            SetupColumns();

            ctlGrid.FilterDelegate = ctlGrid_Filter;

            reloadLagger = new ActionLagger(ReloadAction, 100);
            reloadLagger.RequestAction(ActionLaggerQueueing.ForceDelayed);
        }
コード例 #11
0
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            appContext   = AppContext.Default;
            yamsterCache = appContext.YamsterCache;

            MainWindow.ChatPaneWidth = appContext.Settings.ChatPaneWidth;

            Build();

            this.ctlChatPaneVBox.WidthRequest = MainWindow.ChatPaneWidth;

#if YAMSTER_MAC
            ctlMenuBar.Visible = false;
#endif
            ctlStatusBarMain.Push(0, "  Version " + Utilities.YamsterTerseVersion + "  -  https://github.com/octogonz/yamster");
            ctlStatusBarTotalYams.Push(0, "");
            SetStatusBarFormat(ctlStatusBarTotalYams, x => x.Xalign = 0.5f);
            ctlStatusBarSyncStatus.Push(0, "");
            SetStatusBarFormat(ctlStatusBarSyncStatus, x => x.Xalign = 0.5f);

            yamsterCache.MessageChanged += yamsterCache_MessageChanged;

            ctlViewsScreen.ThreadViewer         = ctlThreadViewer;
            ctlGroupThreadScreen.ThreadViewer   = ctlThreadViewer;
            ctlSearchScreen.ThreadViewer        = ctlThreadViewer;
            ctlConversationsScreen.ThreadViewer = ctlThreadViewer;

            ctlGroupConfigScreen.PerformLogin += ctlGroupConfigScreen_PerformLogin;

            updateStatusBarLagger = new ActionLagger(UpdateStatusBarAction);
            updateStatusBarLagger.RequestAction();

#if !DEBUG
            btnTest.Visible = false;
#endif
        }
コード例 #12
0
ファイル: GroupThreadScreen.cs プロジェクト: octogonz/yamster
 public void ReloadThreads()
 {
     reloadThreadsLagger.RequestAction();
 }
コード例 #13
0
ファイル: GroupThreadScreen.cs プロジェクト: octogonz/yamster
 public void ReloadGroups()
 {
     reloadGroupsLagger.RequestAction();
 }
コード例 #14
0
 protected void chkShowMultiParticipant_Clicked(object sender, EventArgs e)
 {
     reloadConversationsLagger.RequestAction();
 }
コード例 #15
0
ファイル: AddGroupWindow.cs プロジェクト: octogonz/yamster
 protected void btnSearch_Clicked(object sender, EventArgs e)
 {
     searchLagger.RequestAction();
 }
コード例 #16
0
 void syncWindow_StatusChanged(object sender, EventArgs e)
 {
     updateStatusBarLagger.RequestAction();
 }