Example #1
0
        public GfaxSendPhoneBook(Glade.XML xml, string myparent)
        {
            //Phonebook[] pb; delete me

            //gxml = xml;
            //parent = myparent; delete me
            myPhoneBooks = Phonetools.get_phonebooks();

            if (myPhoneBooks == null)
            {
                G_Message m = new G_Message(Catalog.GetString("You don't have any phone books yet."));
                m = null;
                return;
            }

            gsxml = new Glade.XML(null, "send-druid.glade", "PhbookDialog", null);
            gsxml.Autoconnect(this);

            // Get the widget so we can manipulate it
            //phbd = (Gtk.Dialog) gsxml.GetWidget("PhbookDialog");
            //book = (Gtk.TreeView) gsxml.GetWidget("book_treeview");
            //list = (Gtk.TreeView) gsxml.GetWidget("list_treeview");
            phbd = PhbookDialog;
            book = book_treeview;
            list = list_treeview;

            book.Selection.Changed += new EventHandler(on_book_treeview_selection);

            phbd.Resizable      = true;
            book_store          = new ListStore(typeof(string));
            book.HeadersVisible = false;
            book.Selection.Mode = SelectionMode.Multiple;

            bs = new G_ListView(book, book_store);
            // Got have a column title or things won't show up
            bs.AddColumnTitle(Catalog.GetString("Phone books"), 0, COLUMN_0);


            list_store = new ListStore(
                typeof(string),
                typeof(string),
                typeof(string));

            ls = new G_ListView(list, list_store);
            ls.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_0);
            ls.AddColumnTitle(Catalog.GetString("Phone Number"), 1, COLUMN_1);
            ls.AddColumnTitle(Catalog.GetString("Contact"), 2, COLUMN_2);
            list.HeadersVisible = true;
            list.Selection.Mode = SelectionMode.Multiple;

            // populate the list
            foreach (Phonebook p in myPhoneBooks)
            {
                bs.AddTextToRow(p.Name);
            }

            phbd.Run();
        }
Example #2
0
        bool pbIsReadOnly = false;                      //wether current phone book is no editable.

        public GfaxPhonebook()
        {
            myPhoneBooks = Phonetools.get_phonebooks();

            Application.Init();
            gxml = new Glade.XML(null, "send-druid.glade", "PhbookWindow", null);
            gxml.Autoconnect(this);

            ItemStore = new ListStore(typeof(string), typeof(string), typeof(string));
            ItemView  = new G_ListView(ItemTreeview, ItemStore);
            ItemView.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_0);
            ItemView.AddColumnTitle(Catalog.GetString("Phone Number"), 1, COLUMN_1);
            ItemView.AddColumnTitle(Catalog.GetString("Contact"), 2, COLUMN_2);
            ItemTreeview.HeadersVisible = true;
            //ItemTreeview.Selection.Mode = SelectionMode.Multiple;
            ItemTreeview.Selection.Changed +=
                new EventHandler(on_ItemTreeview_selection);

            // Populate the drop down combo box with phonebooks and populate
            // the list with the first phonebook.
            // TODO sort these alphabetically
            if (myPhoneBooks.Length > 0)
            {
                string[] list = new string[myPhoneBooks.Length];

                if (myPhoneBooks != null)
                {
                    // populate the list
                    int i = 0;
                    PhonebookComboBox.RemoveText(0);
                    foreach (Phonebook p in myPhoneBooks)
                    {
                        list[i++] = p.Name;
                        PhonebookComboBox.AppendText(p.Name);
                    }
                    PhonebookComboBox.Active = 0;
                }

                //Console.WriteLine(list[PhonebookComboBox.Active]);
                DeletePhonebookButton.Sensitive = true;
            }
            else
            {
                DeletePhonebookButton.Sensitive = false;
            }

            SaveCloseButton.Sensitive = false;
            UpdateButton.Sensitive    = false;
            ClearButton.Sensitive     = false;
            AddButton.Sensitive       = false;

            Application.Run();
        }
Example #3
0
        public NewPhoneBook()
        {
            booknames = new ArrayList();

            Glade.XML xml = new Glade.XML(null, "gfax.glade", "NewPhoneBookDialog", null);
            xml.Autoconnect(this);

            GfaxRadioButton.Active = true;

            EvolutionRadioButton.Sensitive = true;
            // turn these off until somewhere near supported
            DatabaseRadioButton.Visible = false;
            LDAPRadioButton.Visible     = false;

            store = new ListStore(
                typeof(Boolean),
                typeof(string));

            view = new G_ListView(EvolutionTreeView, store);

            view.AddColumnTitleToggle(Catalog.GetString("Use"), 0, COLUMN_0);
            view.AddColumnTitle(Catalog.GetString("Phone Book"), 0, COLUMN_1);

            EvolutionTreeView.HeadersVisible = true;

            NewPhoneBookDruid.ShowAll();
        }
Example #4
0
        public GfaxPhonebook()
        {
            myPhoneBooks = Phonetools.get_phonebooks();

            Application.Init ();
            gxml = new Glade.XML (null, "send-druid.glade","PhbookWindow",null);
            gxml.Autoconnect (this);

            ItemStore = new ListStore(typeof (string), typeof (string), typeof (string));
            ItemView = new G_ListView(ItemTreeview, ItemStore);
            ItemView.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_0);
            ItemView.AddColumnTitle(Catalog.GetString("Phone Number"), 1, COLUMN_1);
            ItemView.AddColumnTitle(Catalog.GetString("Contact"), 2, COLUMN_2);
            ItemTreeview.HeadersVisible = true;
            //ItemTreeview.Selection.Mode = SelectionMode.Multiple;
            ItemTreeview.Selection.Changed +=
                    new EventHandler(on_ItemTreeview_selection);

            // Populate the drop down combo box with phonebooks and populate
            // the list with the first phonebook.
            // TODO sort these alphabetically
            if ( myPhoneBooks.Length > 0) {
                string[] list = new string[myPhoneBooks.Length];

                if ( myPhoneBooks != null ) {
                    // populate the list
                    int i = 0;
                    PhonebookComboBox.RemoveText(0);
                    foreach (Phonebook p in myPhoneBooks) {
                        list[i++] = p.Name;
                        PhonebookComboBox.AppendText(p.Name);
                    }
                    PhonebookComboBox.Active = 0;
                }

                //Console.WriteLine(list[PhonebookComboBox.Active]);
                DeletePhonebookButton.Sensitive = true;
            } else {
                DeletePhonebookButton.Sensitive = false;
            }

            SaveCloseButton.Sensitive = false;
            UpdateButton.Sensitive = false;
            ClearButton.Sensitive = false;
            AddButton.Sensitive = false;

            Application.Run ();
        }
Example #5
0
        public GfaxSendPhoneBook(Glade.XML xml, string myparent)
        {
            //Phonebook[] pb; delete me

            //gxml = xml;
            //parent = myparent; delete me
            myPhoneBooks = Phonetools.get_phonebooks();

            if ( myPhoneBooks == null ) {
                G_Message m = new G_Message(Catalog.GetString("You don't have any phone books yet."));
                m = null;
                return;
            }

            gsxml = new Glade.XML (null, "send-druid.glade","PhbookDialog",null);
            gsxml.Autoconnect (this);

            // Get the widget so we can manipulate it
            //phbd = (Gtk.Dialog) gsxml.GetWidget("PhbookDialog");
            //book = (Gtk.TreeView) gsxml.GetWidget("book_treeview");
            //list = (Gtk.TreeView) gsxml.GetWidget("list_treeview");
            phbd = PhbookDialog;
            book = book_treeview;
            list = list_treeview;

            book.Selection.Changed += new EventHandler (on_book_treeview_selection);

            phbd.Resizable = true;
            book_store = new ListStore(typeof(string));
            book.HeadersVisible = false;
            book.Selection.Mode = SelectionMode.Multiple;

            bs = new G_ListView(book, book_store);
            // Got have a column title or things won't show up
            bs.AddColumnTitle(Catalog.GetString("Phone books"), 0, COLUMN_0);

            list_store = new ListStore(
                    typeof (string),
                    typeof (string),
                    typeof (string));

            ls = new G_ListView(list, list_store);
            ls.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_0);
            ls.AddColumnTitle(Catalog.GetString("Phone Number"), 1, COLUMN_1);
            ls.AddColumnTitle(Catalog.GetString("Contact"), 2, COLUMN_2);
            list.HeadersVisible = true;
            list.Selection.Mode = SelectionMode.Multiple;

            // populate the list
            foreach (Phonebook p in myPhoneBooks)
                bs.AddTextToRow(p.Name);

            phbd.Run();
        }
Example #6
0
        public GfaxSend(string fname, string[] args)
        {
            filename        = fname;
            includeFilename = args[0];

            Application.Init();

            if (Settings.Faxtracing == true)
            {
                Console.WriteLine("[GfaxSend] File name is : {0}", fname);
            }

            // check to see if we've run before, if so gfax will be there
            if (Settings.RunSetupAtStart)
            {
                Settings.RunSetupAtStart = false;
                MessageDialog md;
                md = new MessageDialog(
                    null,
                    DialogFlags.DestroyWithParent,
                    MessageType.Info,
                    ButtonsType.Ok,
                    Catalog.GetString(
                        @"
This is the first time you have run Gfax.
Please run Gfax from the menu or command line and set your 
MODEM TYPE, PORT and Fax number under preferences.

Gfax is initially setup to use Efax, you may change it use 
Hylafax if you prefer or require connection to a network 
facsimile server.")
                    );
                md.Run();
                md.Destroy();
                Application.Quit();
                dosend = false;
                Environment.Exit(0);
            }

/*
 *                      if ( Settings.FaxNumber.Length <= 4 ) {
 *                              MessageDialog md;
 *                              md = new MessageDialog (
 *                                      null,
 *                                      DialogFlags.DestroyWithParent,
 *                                      MessageType.Info,
 *                                      ButtonsType.Ok,
 *                                      Catalog.GetString(
 *                                              @"
 * You must have a Fax number set in your preferences under
 * Phone Information.")
 *                              );
 *                              md.Run ();
 *                              md.Destroy();
 *                              //Application.Quit();
 *                              dosend = false;
 *                              return;
 *                      }
 */
            gxml = new Glade.XML(null, "send-druid.glade", "NewFaxDialog", null);
            gxml.Autoconnect(this);

            // Set the program icon
            //Gdk.Pixbuf Icon = new Gdk.Pixbuf(null, "gfax.png");
            //((Gtk.Window) gxml["NewFaxDialog"]).Icon = Icon;
            //NewFaxDialog.Icon = Icon;

            ItemStore = new ListStore(
                typeof(Boolean),
                typeof(string),
                typeof(string),
                typeof(string));

            ItemListview = new G_ListView(ItemTreeview, ItemStore);

            ItemListview.AddColumnTitleToggle(Catalog.GetString("Send"), 0, COLUMN_0);
            ItemListview.AddColumnTitle(Catalog.GetString("Phone Number"), 0, COLUMN_1);
            ItemListview.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_2);
            ItemListview.AddColumnTitle(Catalog.GetString("Contact"), 0, COLUMN_3);

            ItemTreeview.HeadersVisible = true;

            //ItemTreeview.Selection.Mode = SelectionMode.Multiple;

            ResolutionCheckbutton.Active = Settings.HiResolution;
            EmailCheckbutton.Active      = Settings.EmailNotify;
            EmailEntry.Text = Settings.EmailAddress;

            if (Settings.TransmitAgent == "efax")
            {
                EmailCheckbutton.Visible = false;
                EmailEntry.Visible       = false;
                SendCheckbutton.Visible  = false;
                SendDateedit.Visible     = false;
            }

            if (SendCheckbutton.Active)
            {
                SendDateedit.Sensitive = false;
            }

            // If we have a file name from the gnome print dialog
            if (includeFilename != "do_filename")
            {
                FilenameEntry.Text      = Catalog.GetString("Spooled from print job");
                FilenameEntry.Sensitive = false;
                BrowseButton.Sensitive  = false;
            }

            Application.Run();
        }
Example #7
0
        public Gfax(string fname, string[] args)
            : base(APPNAME, VERSION, Modules.UI, args, new object [0])
        {
            //Phonebook[] pb;  delete me

            // Set the program icon
            Gtk.Window.DefaultIconName = "gfax";

            Application.Init();

            // check to see if we've run before, if so gfax will be there
            if (Settings.RunSetupAtStart)
            {
                Settings.RunSetupAtStart = false;

                MessageDialog md;
                md = new MessageDialog(
                    null,
                    DialogFlags.DestroyWithParent,
                    MessageType.Info,
                    ButtonsType.Ok,
                    Catalog.GetString(
                        @"
This is the first time you have run Gfax.
You should set your MODEM TYPE and PORT under preferences.

Gfax is initially setup to use Efax, you may change it use 
Hylafax if you prefer or require connection to a network 
facsimile server.")
                    );
                md.Run();
                md.Destroy();
            }

            if (!Directory.Exists(gfax.SpoolDirectory))
            {
                G_Message gm = new G_Message(Catalog.GetString(
                                                 @"Your spool directory is missing!
					
Please login as the root user and create the "
                                                 + gfax.SpoolDirectory +
                                                 " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }
            if (!Directory.Exists(gfax.SpoolDirectory + "/doneq"))
            {
                G_Message gm = new G_Message(Catalog.GetString(
                                                 @"The doneq directory is missing in your spool directory!
					
Please login as the root user and create the "
                                                 + gfax.SpoolDirectory + "/doneq" +
                                                 " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }
            if (!Directory.Exists(gfax.SpoolDirectory + "/recq"))
            {
                G_Message gm = new G_Message(Catalog.GetString(
                                                 @"The recq directory is missing in your spool directory!
					
Please login as the root user and create the "
                                                 + gfax.SpoolDirectory + "/recq" +
                                                 " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }


            gxml = new Glade.XML(null, "gfax.glade", "GfaxWindow", null);
            gxml.Autoconnect(this);


            // Set initial gui state as per preferences
            // GConf.PropertyEditors.EditorShell doesn't handle
            // checkmenuitems;
            eventsEnabled = false;
            if (Settings.TransmitAgent == "hylafax")
            {
                AutoQRefreshCheckMenuItem.Active      = Settings.RefreshQueueEnabled;
                EmailNotificationCheckMenuItem.Active = Settings.EmailNotify;
                HiResolutionModeCheckMenuItem.Active  = Settings.HiResolution;
                LogEnabledCheckMenuItem.Active        = Settings.LogEnabled;
            }
            if (Settings.TransmitAgent == "efax")
            {
                AutoQRefreshCheckMenuItem.Active         = Settings.RefreshQueueEnabled;
                AutoQRefreshCheckMenuItem.Sensitive      = false;
                EmailNotificationCheckMenuItem.Active    = false;
                EmailNotificationCheckMenuItem.Sensitive = false;
                HiResolutionModeCheckMenuItem.Active     = Settings.HiResolution;
                LogEnabledCheckMenuItem.Visible          = false;
            }

            FaxTracingCheckMenuItem.Active = Settings.Faxtracing;

            eventsEnabled = true;

            StatusText.Editable = false;
            StatusText.CanFocus = false;
            StatusText.Buffer   = StatusTextBuffer;

            // Set the program icon
            Gdk.Pixbuf Icon = new Gdk.Pixbuf(null, "gfax.png");

            gfax.MainWindow = GfaxWindow;

            // Setup listview icons
            InitListViewIcons();

            StatusStore = new ListStore(
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(DateTime),
                typeof(string));

            RecvStore = new ListStore(
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(DateTime),
                typeof(string));


            lv = new G_ListView(StatusList, StatusStore);
            lv.AddColumnIcon(Gtk.Stock.Info, 0);
            lv.AddColumnTitle(Catalog.GetString("Jobid"), 1, 1);
            lv.AddColumnTitle(Catalog.GetString("Number"), 2, 2);
            lv.AddColumnTitle(Catalog.GetString("Status"), 3, 3);
            lv.AddColumnTitle(Catalog.GetString("Owner"), 4, 4);
            lv.AddColumnTitle(Catalog.GetString("Pages"), 5, 5);
            lv.AddColumnTitle(Catalog.GetString("Dials"), 6, 6);
            lv.AddColumnDateTime(Catalog.GetString("Send At"), "G", 7, 7);
            lv.AddColumnTitle(Catalog.GetString("Information"), 8, 8);

            // List view for completed jobs tab
            jobsCompletedView = new G_ListView(JobsCompleteList, StatusStore);
            jobsCompletedView.AddColumnIcon(Gtk.Stock.Info, 0);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Jobid"), 1, 1);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Number"), 2, 2);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Status"), 3, 3);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Owner"), 4, 4);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Pages"), 5, 5);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Dials"), 6, 6);
            jobsCompletedView.AddColumnDateTime(Catalog.GetString("Send At"), "G", 7, 7);
            jobsCompletedView.AddColumnTitle(Catalog.GetString("Information"), 8, 8);

            jobsReceivedView = new G_ListView(JobsReceivedList, RecvStore);
            jobsReceivedView.AddColumnIcon(Gtk.Stock.Info, 0);
            jobsReceivedView.AddColumnTitle(Catalog.GetString("Sender"), 1, 1);
            jobsReceivedView.AddColumnTitle(Catalog.GetString("Status"), 2, 2);
            jobsReceivedView.AddColumnTitle(Catalog.GetString("Pages  "), 3, 3);
            jobsReceivedView.AddColumnDateTime(Catalog.GetString("Arrived"), "G", 4, 4);
            jobsReceivedView.AddColumnTitle(Catalog.GetString("Filename"), 5, 5);

            StatusList.Selection.Changed +=
                new EventHandler(on_StatusList_selection);
            StatusList.Selection.Mode = SelectionMode.Multiple;
            StatusList.HeadersVisible = true;

            JobsCompleteList.Selection.Changed +=
                new EventHandler(on_JobsCompleteList_selection);
            JobsCompleteList.Selection.Mode = SelectionMode.Multiple;
            JobsCompleteList.HeadersVisible = true;

            JobsReceivedList.Selection.Changed +=
                new EventHandler(on_JobsReceivedList_selection);
            JobsReceivedList.Selection.Mode = SelectionMode.Multiple;
            JobsReceivedList.HeadersVisible = true;

            // Make sure headers are visible
            lv.AddTextToRow(null, "", "", "", "", "", "", null, "");
            jobsCompletedView.AddTextToRow(null, "", "", "", "", "", "", null, "");
            jobsReceivedView.AddTextToRow(null, "", "", "", null, "");
            StatusStore.Clear();
            RecvStore.Clear();

            DeleteJobButton.Sensitive = false;
            if (Settings.TransmitAgent == "hylafax")
            {
                ModifyJobButton.Sensitive = false;
            }
            else
            {
                ModifyJobButton.Visible = false;
            }
            ViewPrintButton.Sensitive = false;

            // Setup some global variables
            gfax.MainProgressBar   = Appbar.Progress;
            gfax.GStatusTextBuffer = StatusTextBuffer;
            gfax.GAppbar           = Appbar;

            gfax.Pulser = new Pulser();
            gfax.Status = new Status(StatusText, StatusTextBuffer);

            if (Settings.RefreshQueueEnabled)
            {
                GLib.Timeout.Add((uint)(Settings.RefreshQueueInterval * 1000),
                                 new TimeoutHandler(queue_refresh));
            }

            async_update_status();

            if (Settings.TransmitAgent == "hylafax")
            {
                while (gfax.activeNetwork)
                {
                    System.Threading.Thread.Sleep(100);
                }

                async_net_read_finished();
            }

            activeQ = ActiveQ.send;
            async_update_queue_status("sendq");

            StatusIcon sicon = new StatusIcon(Icon);

            sicon.Activate += new EventHandler(OnImageClick);
            sicon.Tooltip   = "Gfax Facsimile Sender";
            // showing the trayicon
            sicon.Visible = true;
            // setup system tray icon
            gfax.MainWindow.SkipTaskbarHint = true;
            gfax.MainWindow.Iconify();

            Application.Run();
        }
Example #8
0
File: gui.cs Project: horga83/gfax
        public Gfax(string fname, string[] args)
            : base(APPNAME, VERSION, Modules.UI, args, new object [0])
        {
            //Phonebook[] pb;  delete me

             			// Set the program icon
             			Gtk.Window.DefaultIconName = "gfax";

            Application.Init ();

            // check to see if we've run before, if so gfax will be there
            if ( Settings.RunSetupAtStart ) {
                Settings.RunSetupAtStart = false;

                MessageDialog md;
                md = new MessageDialog (
                    null,
                    DialogFlags.DestroyWithParent,
                    MessageType.Info,
                    ButtonsType.Ok,
                    Catalog.GetString(
                        @"
            This is the first time you have run Gfax.
            You should set your MODEM TYPE and PORT under preferences.

            Gfax is initially setup to use Efax, you may change it use
            Hylafax if you prefer or require connection to a network
            facsimile server.")
                );
                md.Run ();
                md.Destroy();
            }

            if (!Directory.Exists(gfax.SpoolDirectory)) {
                G_Message gm = new G_Message(Catalog.GetString(
                    @"Your spool directory is missing!

            Please login as the root user and create the "
            + gfax.SpoolDirectory +
            " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }
            if (!Directory.Exists(gfax.SpoolDirectory + "/doneq")) {
                G_Message gm = new G_Message(Catalog.GetString(
                    @"The doneq directory is missing in your spool directory!

            Please login as the root user and create the "
            + gfax.SpoolDirectory + "/doneq" +
            " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }
            if (!Directory.Exists(gfax.SpoolDirectory + "/recq")) {
                G_Message gm = new G_Message(Catalog.GetString(
                    @"The recq directory is missing in your spool directory!

            Please login as the root user and create the "
            + gfax.SpoolDirectory + "/recq" +
            " directory.\n\nAll users should be able to write to it.\n"));
                return;
            }

            gxml = new Glade.XML (null, "gfax.glade", "GfaxWindow", null);
            gxml.Autoconnect (this);

            // Set initial gui state as per preferences
            // GConf.PropertyEditors.EditorShell doesn't handle
            // checkmenuitems;
            eventsEnabled = false;
             	if (Settings.TransmitAgent == "hylafax") {
                AutoQRefreshCheckMenuItem.Active = Settings.RefreshQueueEnabled;
                EmailNotificationCheckMenuItem.Active = Settings.EmailNotify;
                HiResolutionModeCheckMenuItem.Active = Settings.HiResolution;
                LogEnabledCheckMenuItem.Active = Settings.LogEnabled;
            }
            if (Settings.TransmitAgent == "efax") {
                AutoQRefreshCheckMenuItem.Active = Settings.RefreshQueueEnabled;
                AutoQRefreshCheckMenuItem.Sensitive = false;
                EmailNotificationCheckMenuItem.Active = false;
                EmailNotificationCheckMenuItem.Sensitive = false;
                HiResolutionModeCheckMenuItem.Active = Settings.HiResolution;
                LogEnabledCheckMenuItem.Visible = false;
            }

            FaxTracingCheckMenuItem.Active = Settings.Faxtracing;

            eventsEnabled = true;

            StatusText.Editable = false;
            StatusText.CanFocus = false;
            StatusText.Buffer = StatusTextBuffer;

            // Set the program icon
            Gdk.Pixbuf Icon = new Gdk.Pixbuf(null, "gfax.png");

            gfax.MainWindow = GfaxWindow;

             			// Setup listview icons
             			InitListViewIcons();

            StatusStore = new ListStore(
             						typeof (Gdk.Pixbuf),
                        typeof (string),
                        typeof (string),
                        typeof (string),
                        typeof (string),
                        typeof (string),
                        typeof (string),
             						typeof (DateTime),
                        typeof (string));

            RecvStore = new ListStore(
             						typeof (Gdk.Pixbuf),
                        typeof (string),
                        typeof (string),
                        typeof (string),
             						typeof (DateTime),
                        typeof (string));

            lv = new G_ListView(StatusList, StatusStore);
             			lv.AddColumnIcon(Gtk.Stock.Info, 0);
             			lv.AddColumnTitle(Catalog.GetString("Jobid"),	1, 1);
             			lv.AddColumnTitle(Catalog.GetString("Number"),	2, 2);
             			lv.AddColumnTitle(Catalog.GetString("Status"),	3, 3);
             			lv.AddColumnTitle(Catalog.GetString("Owner"),	4, 4);
             			lv.AddColumnTitle(Catalog.GetString("Pages"),	5, 5);
             			lv.AddColumnTitle(Catalog.GetString("Dials"),	6, 6);
             			lv.AddColumnDateTime(Catalog.GetString("Send At"), "G",	7, 7);
             			lv.AddColumnTitle(Catalog.GetString("Information"),	8, 8);

            // List view for completed jobs tab
            jobsCompletedView = new G_ListView(JobsCompleteList, StatusStore);
             			jobsCompletedView.AddColumnIcon(Gtk.Stock.Info, 0);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Jobid"),	1, 1);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Number"),	2, 2);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Status"),	3, 3);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Owner"),	4, 4);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Pages"),	5, 5);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Dials"),	6, 6);
             			jobsCompletedView.AddColumnDateTime(Catalog.GetString("Send At"), "G",	7, 7);
             			jobsCompletedView.AddColumnTitle(Catalog.GetString("Information"),	8, 8);

            jobsReceivedView = new G_ListView(JobsReceivedList, RecvStore);
             			jobsReceivedView.AddColumnIcon(Gtk.Stock.Info, 0);
             			jobsReceivedView.AddColumnTitle(Catalog.GetString("Sender"),	1, 1);
             			jobsReceivedView.AddColumnTitle(Catalog.GetString("Status"),	2, 2);
             			jobsReceivedView.AddColumnTitle(Catalog.GetString("Pages  "),	3, 3);
             			jobsReceivedView.AddColumnDateTime(Catalog.GetString("Arrived"), "G",	4, 4);
             			jobsReceivedView.AddColumnTitle(Catalog.GetString("Filename"),	5, 5);

            StatusList.Selection.Changed +=
                new EventHandler(on_StatusList_selection);
            StatusList.Selection.Mode = SelectionMode.Multiple;
            StatusList.HeadersVisible = true;

            JobsCompleteList.Selection.Changed +=
                new EventHandler(on_JobsCompleteList_selection);
            JobsCompleteList.Selection.Mode = SelectionMode.Multiple;
            JobsCompleteList.HeadersVisible = true;

            JobsReceivedList.Selection.Changed +=
                new EventHandler(on_JobsReceivedList_selection);
            JobsReceivedList.Selection.Mode = SelectionMode.Multiple;
            JobsReceivedList.HeadersVisible = true;

            // Make sure headers are visible
            lv.AddTextToRow(null,"","","","","","",null,"");
            jobsCompletedView.AddTextToRow(null,"","","","","","",null,"");
            jobsReceivedView.AddTextToRow(null,"","","",null,"");
            StatusStore.Clear();
            RecvStore.Clear();

            DeleteJobButton.Sensitive = false;
            if (Settings.TransmitAgent == "hylafax")
                ModifyJobButton.Sensitive = false;
            else
                ModifyJobButton.Visible = false;
            ViewPrintButton.Sensitive = false;

            // Setup some global variables
            gfax.MainProgressBar = Appbar.Progress;
            gfax.GStatusTextBuffer = StatusTextBuffer;
            gfax.GAppbar = Appbar;

            gfax.Pulser = new Pulser();
            gfax.Status = new Status(StatusText, StatusTextBuffer);

            if (Settings.RefreshQueueEnabled)
                GLib.Timeout.Add((uint)(Settings.RefreshQueueInterval * 1000),
                    new TimeoutHandler (queue_refresh));

            async_update_status();

            if (Settings.TransmitAgent == "hylafax" ) {
                while (gfax.activeNetwork)
                    System.Threading.Thread.Sleep(100);

                async_net_read_finished();
            }

            activeQ = ActiveQ.send;
            async_update_queue_status("sendq");

            StatusIcon sicon = new StatusIcon(Icon);
            sicon.Activate += new EventHandler (OnImageClick);
            sicon.Tooltip = "Gfax Facsimile Sender";
            // showing the trayicon
            sicon.Visible = true;
            // setup system tray icon
            gfax.MainWindow.SkipTaskbarHint = true;
            gfax.MainWindow.Iconify();

            Application.Run ();
        }
Example #9
0
        public GfaxSend(string fname, string[] args)
        {
            filename = fname;
            includeFilename = args[0];

            Application.Init ();

            if (Settings.Faxtracing == true) {
                Console.WriteLine("[GfaxSend] File name is : {0}", fname);
            }

            // check to see if we've run before, if so gfax will be there
            if ( Settings.RunSetupAtStart ) {
                Settings.RunSetupAtStart = false;
                MessageDialog md;
                md = new MessageDialog (
                    null,
                    DialogFlags.DestroyWithParent,
                    MessageType.Info,
                    ButtonsType.Ok,
                    Catalog.GetString(
                        @"
            This is the first time you have run Gfax.
            Please run Gfax from the menu or command line and set your
            MODEM TYPE, PORT and Fax number under preferences.

            Gfax is initially setup to use Efax, you may change it use
            Hylafax if you prefer or require connection to a network
            facsimile server.")
                );
                md.Run ();
                md.Destroy();
                Application.Quit();
                dosend = false;
                Environment.Exit(0);
            }
            /*
            if ( Settings.FaxNumber.Length <= 4 ) {
                MessageDialog md;
                md = new MessageDialog (
                    null,
                    DialogFlags.DestroyWithParent,
                    MessageType.Info,
                    ButtonsType.Ok,
                    Catalog.GetString(
                        @"
            You must have a Fax number set in your preferences under
            Phone Information.")
                );
                md.Run ();
                md.Destroy();
                //Application.Quit();
                dosend = false;
                return;
            }
            */
            gxml = new Glade.XML (null, "send-druid.glade","NewFaxDialog",null);
            gxml.Autoconnect (this);

            // Set the program icon
            //Gdk.Pixbuf Icon = new Gdk.Pixbuf(null, "gfax.png");
            //((Gtk.Window) gxml["NewFaxDialog"]).Icon = Icon;
            //NewFaxDialog.Icon = Icon;

            ItemStore = new ListStore(
                    typeof (Boolean),
                    typeof (string),
                    typeof (string),
                    typeof (string));

            ItemListview = new G_ListView(ItemTreeview, ItemStore);

            ItemListview.AddColumnTitleToggle(Catalog.GetString("Send"), 0, COLUMN_0);
            ItemListview.AddColumnTitle(Catalog.GetString("Phone Number"), 0, COLUMN_1);
            ItemListview.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_2);
            ItemListview.AddColumnTitle(Catalog.GetString("Contact"), 0, COLUMN_3);

            ItemTreeview.HeadersVisible = true;

            //ItemTreeview.Selection.Mode = SelectionMode.Multiple;

            ResolutionCheckbutton.Active = Settings.HiResolution;
            EmailCheckbutton.Active = Settings.EmailNotify;
            EmailEntry.Text = Settings.EmailAddress;

            if (Settings.TransmitAgent == "efax") {
                EmailCheckbutton.Visible = false;
                EmailEntry.Visible = false;
                SendCheckbutton.Visible = false;
                SendDateedit.Visible = false;
            }

            if (SendCheckbutton.Active)
                SendDateedit.Sensitive = false;

            // If we have a file name from the gnome print dialog
            if (includeFilename != "do_filename") {
                FilenameEntry.Text = Catalog.GetString("Spooled from print job");
                FilenameEntry.Sensitive = false;
                BrowseButton.Sensitive = false;
            }

            Application.Run ();
        }